The number of objects. (n
is an integer and n≥0
)
The size of the sample. (r
is an integer and 0≤r≤n
)
Optional
options: { The options object.
Optional
replacement?: booleanAllow for replacement or not.
The number of combinations.
0.1.0
combination(5, 2)
// => 10
combination(5, 2, { replacement: true })
// => 15
The number of ways to choose a sample of
r
elements from a set ofn
distinct objects where order does not matter.