Minimum Origin Version Required: 2019 SR0
This function is used to calculate the number of permutations (with repetitions) for a specified k elements from a given set with n elements, denoted by:
Please note that this function takes both the repetitions and the internal order of the sub-set into account. For example, in the 3 elements of "a, b, c", there are 9 permutations with repetitions for 2 elements: "'a, ab, ac, bb, bc, cc, cb, ca, ba".
double Permutationa( int n, int k )
- The number of elements in a given set. It must be a positive integer.
- The number of elements in each permutation. It must be a positive integer and k < n.
Return the number of k-permutations from a given set with n elements.
permutationa(4, 2) = ; // returns 16
permutationa(8, 2) = ; // returns 64
Combine, Combina, Permut