kpermutations
In combinatorics, a k-permutation of a set of n distinct elements is an ordered arrangement of k distinct elements chosen from the set. The concept is used when the order of selection matters and repetitions are not allowed. It is denoted by P(n, k) or _nP_k, and is defined for integers 0 ≤ k ≤ n. When k > n, the number of k-permutations is typically considered undefined.
Number of k-permutations without repetition: P(n, k) = n! / (n - k)!. This can be understood as multiplying
Variant with repetition: If repetition of elements is allowed and order matters, the number of length-k sequences