Combination (nCr) in LaTeX (C(n, k))
- LaTeX command
C(n, k)- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Number of ways to choose k items from n without regard to order, read n choose k.
The value is C(n, k) = \frac{n!}{k!(n-k)!}, identical to the binomial coefficient \binom{n}{k}, which is the preferred notation in most mathematics. \binom adapts its size to context; \dbinom forces display size and \tbinom text size. Avoid the plain TeX {n \choose k} syntax in LaTeX, which amsmath warns against. Other notations include nCr, {}^nC_k, and C^k_n, the last common in French texts with the indices swapped, so check the convention. Pascal's rule, C(n, k) = C(n-1, k-1) + C(n-1, k), generates Pascal's triangle.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Combination (nCr): $C(n, k)$
\[ C(n, k) = \binom{n}{k} = \frac{n!}{k!\,(n-k)!} \]
\end{document}Related symbols
- Permutation (nPr)
P(n, k) - Binomial Coefficient
\binom{n}{k} - Multinomial
\binom{n}{k_1, k_2, \ldots, k_m} - Factorial
n! - Falling Factorial
(n)_k - Rising Factorial
n^{(k)}
Frequently asked questions
- How do I write Combination (nCr) in LaTeX?
- Type C(n, k) in math mode, for example $C(n, k) = \binom{n}{k} = \frac{n!}{k!\,(n-k)!}$. It works in plain LaTeX without loading any package.
- Which package do I need for C(n, k)?
- None. C(n, k) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use C(n, k) in text mode, or only in math mode?
- Both. C(n, k) compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI
- Jana diagram TikZ yang cantik menggunakan AI
- Muat naik imej dan tukar ke LaTeX dengan lancar
- Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan