Permutations_With_Repetition: Enumerate the Permutations of the Elements of a Vector When Some of those Elements are Identical
Description
This function enumerates the possible combinations of n elements where the first element is repeated n1 times, the second element is repeated n2 times, the third n3 times, ...
Usage
Permutations_With_Repetition(Sample_Sizes)
Value
Returns a matrix where each row contains a permutation.
Arguments
Sample_Sizes
Numeric vector (n1,...,nk) that indicates the number of times each element is repeated.
Warning
The number of permutations and the computational time increase exponentially with the number of elements and with the number of sets.