How to write binomial coefficient in LaTeX?

In this tutorial, I will show you how to write binomial coefficients in LaTeX with different methods.

Binomial coefficient with \choose command

If you don’t want to use any package to write the Binomial coefficient in LaTeX, then you can use the {<value> \choose <value>} command.

\documentclass{article}

\begin{document}

  Binomial coefficient with \verb|\chooes| command:
  $$ {n\choose k} = \frac{n!}{k!(n-k)!} $$

\end{document}

Output:

{n\choose k} = \frac{n!}{k!(n-k)!}

Binomial coefficient with amsmath package

The amsmath package provides \binom{}{} command to get the Binomial coefficient in LaTeX. This package also provides \tbinom{}{} command to get a smaller size of Binomial coefficient.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

  Binomial coefficient with \verb|\binom| command:
  $$ \binom{n}{k} = \frac{n!}{k!(n-k)!} $$

  Binomial coefficient with \verb|\tbinom| command:
  $$ \tbinom{n}{k} = \frac{n!}{k!(n-k)!} $$

\end{document}

Output:

 Binomial coefficient with \verb|\binom| command: $$ \binom{n}{k} = \frac{n!}{k!(n-k)!} $$ Binomial coefficient with \verb|\tbinom| command: $$ \tbinom{n}{k} = \frac{n!}{k!(n-k)!} $$

Binomial coefficient with \genfrac command

The amsmath package provides the \genfrac command to get a customized fraction in LaTeX.

\genfrac{left-delim}{right-delim}{thickness}{mathstyle}{numerator}{denominator}

  • left-delim: Specifies the left delimiter for the fraction. Let it empty for no delimiter.
  • right-delim: Specifies the right delimiter for the fraction. Let it empty for no delimiter.
  • thickness: Specify the thickness of the fraction line. Use 0pt to get nothing.
  • mathstyle: Specifies the math style for the fraction. It can take one of the following values:
    • 0 or \displaystyle
    • 1 or \textstyle
    • 2 or \scriptstyle
    • 3 or \scriptscriptstyle
  • numerator: The content that will be the numerator of the fraction.
  • denominator: The content that will be the denominator of the fraction.

For Binomial coefficient, you have to use this,

\genfrac{(}{)}{0pt}{}{n}{k}

\documentclass{article}
\usepackage{amsmath}
\begin{document}

  Binomial coefficient with \verb|\genfrac| command:
  $$ \genfrac{(}{)}{0pt}{}{n}{k} = \frac{n!}{k!(n-k)!} $$

\end{document}

Output:

\genfrac{(}{)}{0pt}{}{n}{k} = \frac{n!}{k!(n-k)!}

Leave a Reply

Your email address will not be published. Required fields are marked *