combinations
Returns binomial coefficients.
Syntax
-
combinations(n, k)
-
n
is a non-negative integer -
k
is a non-negative integer no greater thann
-
Description
combinations(n, k)
is the binomial coefficient n!/(k!⋅(n−k)!)
.
combinations(n, k)
is the coefficient in front of x^k
in the expanded form of (1 + x)^n
. It is also the number of distinct k
-sized subsets of a set of cardinality n
.
Examples
combinations(70, 10)
396704524216
succeeded(for(n, 1, 50, assert(∑(combinations(n, k), k, 0, n) = 2^n)))
true
See also
-
binomial (synonym)