Functions and operators

(nk)=n!k! (n−k)!\binom{n}{k} = \frac{n!}{k!\,(n-k)!} Binomial coefficient

“n choose k”: the number of ways to pick k items from n, ignoring order.

In ML papers

(nk)\binom{n}{k}, read "nn choose kk", counts the ways to choose kk items out of nn when order does not matter: n!k!(n−k)!\frac{n!}{k!(n-k)!}. It is a number stacked in tall parentheses, not a vector or a fraction.

ML papers use it to count pairs ((n2)\binom{n}{2} comparisons between nn items, as in pairwise ranking losses), subsets (Shapley values average over them), and in the binomial distribution (nk)pk(1−p)n−k\binom{n}{k} p^k (1-p)^{n-k}, the chance of kk successes in nn tries. The pass@kk estimator for code generation (Chen et al. 2021) is a ratio of two binomial coefficients.

How to type it

LaTeXShows
\binom{n}{k}(nk)\binom{n}{k}
{n \choose k} older style(nk){n \choose k}

A worked example

(52)=5×42×1=10\binom{5}{2} = \frac{5 \times 4}{2 \times 1} = 10

Five models compared in pairs need 10 matchups.

Common confusions

Related

ab\frac{a}{b}Fractionm∼Bernoulli⁡(p)m \sim \operatorname{Bernoulli}(p)Bernoulli distributiony∼Cat⁡(π)y \sim \operatorname{Cat}(\boldsymbol{\pi})Categorical distribution

Decode this example →