Combination (nCr) in LaTeX (C(n, k))
- LaTeX command
C(n, k)- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Try Combination (nCr) in a real LaTeX document
Open a ready-to-compile document that already uses C(n, k), with the right packages loaded. Edit it and see the PDF, no install needed.
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.
أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf
يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي
- أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
- ارفع صورة وحولها إلى LaTeX بسلاسة
- احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث