934 B
934 B
Function combinations
Compute the number of ways of picking k unordered outcomes from n
possibilities.
Combinations only takes integer arguments. The following condition must be enforced: k <= n.
Syntax
math.combinations(n, k)
Parameters
| Parameter | Type | Description |
|---|---|---|
n |
number | BigNumber | Total number of objects in the set |
k |
number | BigNumber | Number of objects in the subset |
Returns
| Type | Description |
|---|---|
| number | BigNumber | Number of possible combinations. |
Throws
| Type | Description |
|---|
Examples
math.combinations(7, 5) // returns 21