Minimum Origin Version Required: 2019 SR0
This function is used to calculate the number of k-combinations (with repetitions) from a given set with n elements, denoted by:
Please note that it counts the repetition as a possible combination, which is different from the Combine function. For example, in a set of 3 elements of "a, b, c", there are 3 combinations for 2 elements without repetitions (calculated by the Combine function): ab, ac, bc. But if take repetitions into account, there are 6 combinations (calculated by the Combina function): aa, ab, ac, bb, bc, cc.
double Combina(int n, int k)
- The number of elements in a given set. It must be a positive integer.
- The k-combinations. It must be a positive integer and k < n.
Return the number of k-combinations (with repetitions) from a given set with n elements.
combina(4, 2) = ; // returns 10
Combina(8, 2) = ; // returns 36
Combine, Permut, Permutationa