mathjs/docs/reference/functions/combinations.md
2014-05-15 21:43:08 +02:00

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

See also

permutations, factorial