Algosim documentation: binomial

binomial

Returns binomial coefficients.

Syntax

Description

binomial(n, k) is the binomial coefficient n!/(k!⋅(n−k)!).

binomial(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

binomial(70, 10)
396704524216
succeeded(for(n, 1, 50, assert(∑(binomial(n, k), k, 0, n) = 2^n)))
true

See also