Binomial coefficient in LaTeX (binom)

\binom{n}{k} from amsmath writes the binomial coefficient "n choose k": n above k in parentheses, without a fraction bar.

Preamble

The snippets on this page need these lines before \begin{document}:

\usepackage{amsmath}

Write n choose k

The first argument is the upper entry, the second the lower one. Both can be whole expressions.

\[
  \binom{n}{k} = \frac{n!}{k!\,(n-k)!}
  \qquad
  \binom{n+1}{k} = \binom{n}{k} + \binom{n}{k-1}
\]
Change the formula

The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.

(nk)=n!k! (n−k)!(n+1k)=(nk)+(nk−1)\binom{n}{k} = \frac{n!}{k!\,(n-k)!} \qquad \binom{n+1}{k} = \binom{n}{k} + \binom{n}{k-1}

Open this formula in the editor

Set the size

In a line of text \binom is set small, as fractions are. \dbinom forces the display size and \tbinom the text size.

Small: $\binom{n}{k}$, large: $\dbinom{n}{k}$.
\[
  \sum_{k=0}^{n} \tbinom{n}{k} = 2^n
\]
Result
The compiled example

Open in the editor

Other brackets

\genfrac{left}{right}{thickness}{style}{top}{bottom} builds the same structure with any delimiters. A thickness of 0pt removes the bar; an empty style argument keeps the current size. The example defines a command for Stirling numbers in braces.

\newcommand{\stirling}[2]{\genfrac{\{}{\}}{0pt}{}{#1}{#2}}
\[
  \stirling{n}{k}
  \qquad
  \genfrac{[}{]}{0pt}{}{n}{k}
\]
Result
The compiled example

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages