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.
Math poweredAI로 LaTeX 작성
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기