Permutation Calculator

Permutation Calculator

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.

Enter n and r to count the arrangements

What is a Permutation?

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.

Permutation Formula

Counting formulas as given in Blitzstein and Hwang, chapter 1. See Sources.

1. Without repetition

nPr = n × (n − 1) × … × (n − r + 1) = n! ÷ (n − r)!

Multiplying the r terms directly avoids working out two enormous factorials and dividing.

2. With repetition

n × n × … × n = nʳ

3. Removing the order

nCr = nPr ÷ r!
With repetition: C(n + r − 1, r)

Worked Example: A Podium from Eight Runners

Given:
8 runners in a final; how many ways can gold, silver and bronze (3 places) be awarded?
Step 1:
Choices for each place:
gold 8 · silver 7 · bronze 6
Step 2:
Multiply:
8 × 7 × 6 = 336 = 8! ÷ 5!
Step 3:
If only the three medallists mattered:
336 ÷ 3! = 336 ÷ 6 = 56 combinations
Result:
8P3 = 336

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.

Everyday Permutation Counts

How quickly ordered arrangements grow.

Examples of permutation counts
SituationCountWays
4-digit PIN10⁴10,000
4-digit PIN, no repeated digits10P45,040
Top 3 of 20 in a race20P36,840
3 different letters A–Z26P315,600
Order of 10 books on a shelf10!3,628,800
Shuffles of a 52-card deck52!8.07 × 10⁶⁷

Common Permutation Mistakes

  • Using permutations when order doesn't matter. A lottery draw or a committee is a combination. Using nPr overcounts by a factor of r!.
  • Forgetting repetition. A 4-digit PIN allows repeats, so it's 10⁴ = 10,000, not 10P4 = 5,040.
  • Calculating huge factorials on a calculator. 200! overflows most calculators and spreadsheets. Multiply only the r terms you need, as this calculator does with exact arithmetic.
  • Ignoring identical items. The letters of BOOK have 4!/2! = 12 distinct arrangements, not 24, because swapping the two O's changes nothing.

Permutation FAQs

What’s the difference between a permutation and a combination?

Permutations count ordered arrangements; combinations count selections where order doesn’t matter. nPr = nCr × r!.

What is 0!?

1, by definition. That makes nPn = n! ÷ 0! = n! work, and there’s exactly one way to arrange nothing.

What is nP0?

1: there’s one way to choose and arrange no items.

How big is 52!?

About 8.07 × 10⁶⁷, a 68-digit number. A well-shuffled deck is almost certainly in an order that has never existed before.

Why can’t r be bigger than n without repetition?

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.

How do I count arrangements with identical items?

Divide n! by the factorial of each group of repeats. MISSISSIPPI: 11! ÷ (4! × 4! × 2!) = 34,650.

How do I calculate permutations in Excel?

=PERMUT(n, r) without repetition and =PERMUTATIONA(n, r) with repetition. Both lose precision beyond about 15 significant digits.

Why is there a limit of 5,000?

To keep the exact answer readable and quick to work out in your browser. 5000P5000 already has over 16,000 digits.

Sources

Related Tools