Function reference · Math
binom
Computes a binomial coefficient: the number of ways to choose k items from n.
Notation
binom(n, k)
Write it in an expression: nerdamer('binom(5,2)'), or in the Playground.
nerdamer.binom
nerdamer.binom(n: ExpressionInput, k: ExpressionInput): Expression
A method on the default import. Arguments can be strings, as in Notation.
Parameters
n- The number of items, a nonnegative integer.
k- How many to choose, an integer.
Returns
The exact coefficient, as an integer.
Examples
Good to know
- A negative
nis an error.
JavaScript examples
nerdamer.binom(5, 2).text()
// → 10