Permutation and Combination Calculator
Permutations and combinations are the two fundamental counting formulas in combinatorics. A permutation P(n, r) counts ordered selections of r items from n distinct items, while a combination C(n, r) counts unordered selections. The permutation formula is P(n, r) = n! / (n - r)!, and the combination formula is C(n, r) = n! / (r! * (n - r)!). The ratio between them is simply r! because every combination corresponds to r! permutations. Enter n and r below to compute both at once.
Permutation and combination formulas
nPr = n! / (n - r)!
nCr = n! / (r! * (n - r)!) = nPr / r!
Both are computed iteratively using the falling factorial product n * (n-1) * ... * (n-r+1) to avoid computing large factorials. The combination is then the permutation divided by r!.
When to use permutations vs. combinations
- Permutations: passwords, race placements, seating arrangements, any situation where order matters.
- Combinations: card hands, lottery tickets, committee membership, any situation where order does not matter.
- P(n, r) is always greater than or equal to C(n, r).
- P(n, r) = C(n, r) * r!, confirming C(n, r) = P(n, r) / r!.
- C(n, 1) = n and P(n, 1) = n for any n.
Permutation and combination: frequently asked questions
What is the difference between a permutation and a combination?
A permutation counts ordered arrangements: choosing 3 people from 10 and assigning them to first, second, and third place gives P(10,3) = 720 distinct ordered outcomes. A combination counts unordered selections: choosing 3 people from 10 for a committee gives C(10,3) = 120, because the order does not matter.
What is the formula for nPr?
P(n, r) = n! / (n - r)!. It is the number of ways to choose r items from n and arrange them in order. Equivalently, P(n, r) = n * (n-1) * ... * (n-r+1), a falling factorial.
What is the formula for nCr?
C(n, r) = n! / (r! * (n - r)!). It equals P(n, r) / r! because dividing by r! removes the r! orderings of the selected r items. It is also written as the binomial coefficient.
When should I use permutations versus combinations?
Use permutations when the order of selection matters (passwords, race rankings, seating arrangements). Use combinations when only the selected group matters, not the order (lottery tickets, committee selection, card hands).
What is P(n, n)?
P(n, n) = n!, the total number of ways to arrange all n items in order. For example, P(5, 5) = 120 is the number of distinct orderings of 5 items.
Official sources
- NIST Digital Library of Mathematical Functions, Section 26: dlmf.nist.gov/26.
- NIST, Mathematical topics: nist.gov/topics/mathematics.
Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.