Permut
Description
Minimum Origin Version Required: 2019 SR0
This function is used to calculate the number of permutations for a specified k elements from a given set with n elements, denoted by:
Please note that a permutation is different from a combination in which the combination is a set of elements regardless of the internal order, while the internal order in a permutation is significant. For example, in the 3 elements of "a, b, c", "ab" and "ba" are considered the same combination but two different permutations.
Syntax
double Permut(int n, int k)
Parameters
n
- The number of elements in a given set. It must be a positive integer.
k
- The number of elements in each permutation. It must be a positive integer and k < n.
Return
Return the number of k-permutations from a given set with n elements.
Example
permut(4, 2) = ; // returns 12 permut(8, 2) = ; // returns 56
/math-117ac9ed37ca176e4648beac30b669c1.png)