Learn R Programming

ConcordanceTest (version 1.0.3)

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.

Examples

Run this code
Sample_Sizes <- c(2,2,2)
Permutations_With_Repetition(Sample_Sizes)

Run the code above in your browser using DataLab