Binomial Coefficients (Choose) in LaTeX
Write “n choose k” with amsmath’s \binom{n}{k}, which draws the two numbers stacked in parentheses. The plain TeX form {n \choose k} gives the same result but is discouraged with amsmath; \dbinom and \tbinom force the large or small size.
Binomial commands
\binom{n}{k}n choose k (amsmath); size follows the context.
\dbinom{n}{k}Display size, even inside a line of text.
\tbinom{n}{k}Text size, even in a displayed equation.
{n \choose k}Plain TeX form; the braces around it are required.
\binom{n}{k_1, k_2, k_3}Multinomial coefficient.
{}^{n}C_{k}Combination notation used in some school courses.
\genfrac{(}{)}{0pt}{}{n}{k}What
\binomdoes under the hood; change the delimiters for other brackets.
Try it live
Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.
Binomial coefficient (n choose k) examples
Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.
Formula
LaTeX\binom{n}{k} = \frac{n!}{k!\,(n-k)!}Binomial theorem
LaTeX(a + b)^n = \sum_{k=0}^{n} \binom{n}{k} a^{n-k} b^{k}Pascal’s rule
LaTeX\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}Binomial distribution
LaTeXP(X = k) = \binom{n}{k} p^k (1 - p)^{n-k}A number
LaTeX\binom{5}{2} = 10Multinomial coefficient
LaTeX\binom{n}{k_1, k_2, \ldots, k_m} = \frac{n!}{k_1!\, k_2! \cdots k_m!}Text size in a display
LaTeX\tbinom{n}{2} \text{ pairs out of } n\tbinomkeeps the coefficient small even in a displayed equation.
\binom or \choose?
\binom{n}{k} comes from amsmath and takes its two parts as arguments, like \frac. \choose is an older plain TeX command that sits between the two parts and takes everything in the surrounding group, so it must be wrapped in braces: {n \choose k}.
With amsmath loaded, \choose still works but amsmath treats it as a “foreign” plain TeX command and may print a warning suggesting \binom. For new documents use \binom.
\usepackage{amsmath}
% ...
There are $\binom{5}{2} = 10$ ways to pick two of five.Sizes inline and in displays
\binom adapts to where it is used: smaller in running text, full size in a displayed equation. \dbinom forces the display size and \tbinom the text size, the same way \dfrac and \tfrac work for fractions.
Common mistakes
Without braces
\choosetakes the whole group on each side, so the +1 ends up in the bottom row.Instead ofn \choose k + 1Write{n \choose k} + 1A fraction has a bar and typed parentheses do not stretch; a binomial coefficient has no bar.
Instead of(\frac{n}{k})Write\binom{n}{k}\binomis not part of plain LaTeX; without amsmath you get “Undefined control sequence”.Instead of\binom{n}{k} (without amsmath in LaTeX)Write\usepackage{amsmath} % in the preamble
In Overleaf, MathJax and Word
Overleaf and pdfLaTeX
\binom,\dbinom,\tbinomand\genfracneed\usepackage{amsmath}.\chooseworks without it.MathJax and KaTeX
MathJax and KaTeX support
\binom,\dbinom,\tbinomand{n \choose k}directly, so either form works in Markdown and on web pages.Microsoft Word
Word can show binomial coefficients as a stacked fraction without a bar inside parentheses, but pasted LaTeX is not converted reliably. Write it here and use Copy for Word to paste an editable equation.
Binomial coefficient (n choose k) in LaTeX: questions
- How do I write n choose k in LaTeX?
- Use
\binom{n}{k}with amsmath loaded. It prints n over k inside parentheses. - What is the difference between \binom and \choose?
- They look the same.
\binom{n}{k}is the amsmath command with two arguments;{n \choose k}is the older plain TeX syntax, which needs braces and can trigger an amsmath warning. - How do I make a binomial coefficient smaller or larger?
\tbinom{n}{k}forces the small text size and\dbinom{n}{k}the large display size.- How do I write the nCr notation?
- Write it with scripts:
{}^{n}C_{r}orC(n, r). In most math writing the stacked\binom{n}{r}is the expected form.
Related LaTeX reference
- How to Write a Fraction in LaTeX\frac{numerator}{denominator}, \dfrac and \tfrac for size, continued fractions with \cfrac, slanted fractions and the a/b form.
- Summation in LaTeX\sum with limits, why inline sums put the limits beside the sigma, \limits and \displaystyle, and multi-line conditions with \substack.
- How to Write a Subscript in LaTeX_ for subscripts and ^ for superscripts, braces for more than one character, text indices, both at once and scripts in text mode.
- LaTeX equation editorSymbol panel, live preview, and PNG, SVG, MathML or Word export.
- All LaTeX reference pagesSymbols, math structures and text formatting in one list.
Have the formula as a picture?
Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.
Convert an image to LaTeX