Skip to content

binomialCoefficient(n, k): bigint

Defined in: packages/combinatorics/src/binomial-coefficient.ts:26

Count the combinations of k from n items as a bigint. Returns 0n for k > n.

O(min(k, n - k)) arithmetic operations when k <= n.

number

number

bigint

With INVALID_COUNT for an invalid count or COUNT_TOO_LARGE if n exceeds COMBINATORICS_MAX_COUNT.