Count the ordered arrangements of r items chosen from n, with or without repetition. Results are exact, however large, with the matching combination count alongside.
nPr = n! ÷ (n − r)!
How many items there are to choose from.
Each item used at most once, so r can’t exceed n.
A permutation is an arrangement where order matters. Gold Ann, silver Ben and bronze Cat is a different permutation from gold Ben, silver Ann and bronze Cat, even though the same three people are on the podium.
Counting them is a matter of multiplying choices. There are n options for the first place, n − 1 left for the second, and so on for r places. If items can be reused, as with the digits of a PIN, every place has all n options.
When order doesn't matter, as when picking a team rather than ranking it, you want combinations instead. Each combination of r items can be put in order r! ways, so there are always r! times more permutations than combinations.
Counting formulas as given in Blitzstein and Hwang, chapter 1. See Sources.
Multiplying the r terms directly avoids working out two enormous factorials and dividing.
A random guess at the exact podium has a 1 in 336 chance. Guessing just which three runners medal is easier, at 1 in 56.
How quickly ordered arrangements grow.
| Situation | Count | Ways |
|---|---|---|
| 4-digit PIN | 10⁴ | 10,000 |
| 4-digit PIN, no repeated digits | 10P4 | 5,040 |
| Top 3 of 20 in a race | 20P3 | 6,840 |
| 3 different letters A–Z | 26P3 | 15,600 |
| Order of 10 books on a shelf | 10! | 3,628,800 |
| Shuffles of a 52-card deck | 52! | 8.07 × 10⁶⁷ |
Permutations count ordered arrangements; combinations count selections where order doesn’t matter. nPr = nCr × r!.
1, by definition. That makes nPn = n! ÷ 0! = n! work, and there’s exactly one way to arrange nothing.
1: there’s one way to choose and arrange no items.
About 8.07 × 10⁶⁷, a 68-digit number. A well-shuffled deck is almost certainly in an order that has never existed before.
You can’t pick more different items than exist. With repetition allowed, r can be anything, like a 6-digit code using only the digits 0–9.
Divide n! by the factorial of each group of repeats. MISSISSIPPI: 11! ÷ (4! × 4! × 2!) = 34,650.
=PERMUT(n, r) without repetition and =PERMUTATIONA(n, r) with repetition. Both lose precision beyond about 15 significant digits.
To keep the exact answer readable and quick to work out in your browser. 5000P5000 already has over 16,000 digits.
Related Tools
Basic probability calculations.
P(A|B) calculations.
P(A and B) calculations.
Three event probabilities.
Conditional probability.
Probability-weighted average.