mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
729 B
729 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 |
|---|
Returns
| Type | Description |
|---|---|
| Number | BigNumber | Number of possible combinations. |
Examples
var math = mathjs();
math.combinations(7, 5); // returns 21