Permutations vs. Combinations: nPr and nCr Explained
Most counting problems hinge on one question: does the order of the items you pick matter? Once you can answer that, choosing between permutations and combinations becomes almost automatic.
Last updated:
Factorials: the number of ways to line things up
Both permutations and combinations are built on the factorial. The factorial n! is the product of every whole number from 1 to n, and it counts the ways to arrange n distinct items in a row. Three people, A, B and C, can stand in line in 3 × 2 × 1 = 6 ways: three choices for the front, two for the middle, and one left for the end.
Factorials grow explosively. 10! is 3,628,800, so ten guests can be seated in a row in more than three and a half million orders. 20! is 2,432,902,008,176,640,000, a 19-digit number, and 52!, the number of ways to shuffle a standard deck of cards, is about 8.07 × 10^67, a 68-digit number. That is far beyond what an ordinary calculator displays exactly, which is why a dedicated factorial tool is useful when you need every digit.
By definition, 0! = 1. There is exactly one way to arrange nothing, and this convention keeps the formulas below working when you choose zero items or all of them.
- 3! = 6, 5! = 120, 10! = 3,628,800
- 0! = 1 by definition
- n! = n × (n − 1)!, so each factorial builds on the previous one
Permutations (nPr): choosing and arranging
A permutation counts the ways to choose r items from n distinct items and put them in order. There are n options for the first position, n − 1 for the second, and so on for r positions, so nPr = n × (n − 1) × ... × (n − r + 1) = n! ÷ (n − r)!.
Suppose a club of 5 members elects a president, a vice president and a secretary. There are 5 candidates for president, 4 remaining for vice president and 3 for secretary, giving 5P3 = 5 × 4 × 3 = 60 outcomes. Alice as president with Bob as secretary is a different result from Bob as president with Alice as secretary, even though the same people are involved.
The same logic gives 8P3 = 336 possible podiums (gold, silver, bronze) in a race of 8 runners, and 10P4 = 5,040 four-digit PINs if no digit may be repeated.
Combinations (nCr): choosing without arranging
A combination counts the ways to choose r items from n when the order inside the selection does not matter. Every group of r items appears r! times in the permutation count, once for each internal ordering, so dividing removes the duplicates: nCr = nPr ÷ r! = n! ÷ (r!(n − r)!).
If the club simply picks a 3-person committee with no titles, the answer is 5C3 = 60 ÷ 3! = 60 ÷ 6 = 10. You can read the permutation result as 10 possible committees, each of which can hand out the three titles in 6 ways.
Combinations are symmetric: nCr = nC(n − r). Choosing 8 players from 10 is the same as choosing the 2 who sit out, so 10C8 = 10C2 = 45. Use whichever side is smaller to save work. Another everyday example is a round-robin tournament: with 8 teams, each match is a pair of teams, so there are 8C2 = 28 games.
- 5P3 = 60 (three people with distinct roles)
- 5C3 = 10 (three people, no roles)
- nPr = nCr × r! always holds
- 10C8 = 10C2 = 45 by symmetry
The swap test: does reordering change the result?
The most reliable way to decide is to imagine swapping two of the chosen items. If the swap produces a different outcome, as with seats, rankings, job titles or the digits of a code, you need a permutation. If nothing changes, as with team rosters, a hand of cards or pizza toppings, you need a combination.
Consider a raffle among 10 people with two winning tickets. If both prizes are identical, the number of possible winner pairs is 10C2 = 45. If there is a first prize and a second prize, then Alice-first-Bob-second differs from Bob-first-Alice-second, and the count doubles to 10P2 = 90. The wording of the problem, not the numbers, decides which formula applies.
Lotteries are the classic combination. In a game where you pick 6 numbers from 1 to 49 and the order of the draw is irrelevant, there are 49C6 = 13,983,816 possible tickets, so a single ticket has roughly a 1 in 14 million chance of matching all six. A five-card poker hand from a 52-card deck is likewise a combination: 52C5 = 2,598,960 hands.
When repetition is allowed
The nPr formula assumes each item can be used only once. When repeats are allowed, every position has all n options, so the count is n to the power r. A four-digit PIN that may reuse digits has 10^4 = 10,000 possibilities, roughly twice the 5,040 you get without repeats.
Coin flips and dice follow the same rule: four coin tosses produce 2^4 = 16 sequences, and three rolls of a die produce 6^3 = 216. This is also the basic arithmetic behind password strength. With an alphabet of n characters and a length of r, there are n^r possible passwords, and each extra character multiplies the total by n.
If order does not matter but repeats are allowed, as when you buy 4 pieces of fruit from 3 kinds, you are counting multisets, and the count is (n + r − 1)Cr. For the fruit example that is 6C4 = 15. Asking two questions, whether order matters and whether repeats are allowed, tells you which of the four formulas to use.
- Order matters, no repeats: nPr = n! ÷ (n − r)!
- Order does not matter, no repeats: nCr = n! ÷ (r!(n − r)!)
- Order matters, repeats allowed: n^r
- Order does not matter, repeats allowed: (n + r − 1)Cr
Checking your answers with a calculator
The permutation and combination calculators take n and r and return nPr, nCr and n! together. Both values must be whole numbers with 0 ≤ r ≤ n; asking for more items than you have is reported as an error rather than silently returning zero. Results are computed as exact integers, so even large inputs show every digit.
If your answer disagrees with a textbook, compare the two results. When yours is exactly r! times larger or smaller than the expected answer, you have almost certainly mixed up permutations and combinations, and rereading the problem for words like ranked, assigned or arranged will usually settle it.