Permutation (nPr) in LaTeX (P(n, k))
- LaTeX command
P(n, k)- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Number of ordered arrangements of k items chosen from n distinct items, read n permute k.
Permutations count ordered selections: P(n, k) = \frac{n!}{(n-k)!} = n(n-1)\cdots(n-k+1), so P(5, 2) = 20. It equals the falling factorial (n)_k or n^{\underline{k}}, and relates to combinations by P(n, k) = k!\,C(n, k). Alternatives you will see include nPr, {}^nP_k, and A^k_n (arrangements) in French and Chinese texts. Because P(\cdot) also denotes probability, a reader may misread P(n, k) in a probability chapter; switching to (n)_k or n^{\underline{k}} avoids that. Use \cdots between factors in a product.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Permutation (nPr): $P(n, k)$
\[ P(n, k) = \frac{n!}{(n-k)!} = n(n-1)\cdots(n-k+1) \]
\end{document}Related symbols
- Multinomial
\binom{n}{k_1, k_2, \ldots, k_m} - Combination (nCr)
C(n, k) - Falling Factorial
(n)_k - Binomial Coefficient
\binom{n}{k} - Rising Factorial
n^{(k)} - Factorial
n!
Frequently asked questions
- How do I write Permutation (nPr) in LaTeX?
- Type P(n, k) in math mode, for example $P(n, k) = \frac{n!}{(n-k)!} = n(n-1)\cdots(n-k+1)$. It works in plain LaTeX without loading any package.
- Which package do I need for P(n, k)?
- None. P(n, k) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use P(n, k) in text mode, or only in math mode?
- Both. P(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.