enumerations: Enumerations

Description Usage Arguments Details Value Warning Examples

View source: R/enumeration.R

Description

Calculates the total number of enumerations,
given a superset of size 'n' and subsets of size 'k',
where enumeration means:

a) Permutation (isOrdered = TRUE)
b) Combination (isOrdered = FALSE)

Usage

1
enumerations(n, k, isOrdered)

Arguments

n

Number of elements in the whole set

k

Number of elements in each subset

isOrdered

Does the ordering matter?

Details

~Permutation:

n! / (n - k)!

~Combination:

n! / [(n - k)! * k!]

Value

Total number of enumerations

Warning

The function does not assume a default value for isOrdered.
Therefore, all three arguments are required in order to calculate the result.

Examples

1
2
3
4
5
## Permutations with a 35 element set, and 3 elements per subset:
enumerations(35, 3, T)

## Combinations with a 255 element set, and 5 elements per subset:
enumerations(255, 5, FALSE)

Mithradatha/MTH2401 documentation built on May 7, 2019, 4:58 p.m.