How to use the permutation calculator
Enter the total number of items, n, and how many you are choosing, r. The calculator returns four answers at once, so you can pick the one that fits your problem:
- Permutations (nPr): order matters and items can’t repeat.
- Combinations (nCr): order doesn’t matter and items can’t repeat.
- Permutations with repetition (nr): order matters and items can repeat.
- Combinations with repetition: order doesn’t matter and items can repeat.
Results are exact whole numbers, even for very large values. Numbers with more than 24 digits are also shown in scientific notation.
Which formula do I need?
| Items can’t repeat | Items can repeat | |
|---|---|---|
| Order matters | nPr = n! ÷ (n − r)! | nr |
| Order doesn’t matter | nCr = n! ÷ (r! (n − r)!) | C(n + r − 1, r) |
Ask yourself two questions. If I swap two chosen items, is it a different outcome? If yes, order matters. Can the same item be picked twice? If yes, repetition is allowed.
Factorials
All four formulas are built from factorials. n! (“n factorial”) means multiplying every whole number from n down to 1:
5! = 5 × 4 × 3 × 2 × 1 = 120 0! = 1 (by definition)
Factorials grow extremely fast: 10! is 3,628,800 and 20! is over 2.4 quintillion. That is why the calculator uses exact big-number arithmetic instead of rounding.
Worked example: choosing 3 from 10
Permutations: a race with 10 runners
How many ways can gold, silver and bronze be awarded? Order matters and no runner can win two medals:
10P3 = 10 × 9 × 8 = 720
Combinations: a 3-person committee from 10 people
The committee is the same whatever order people are picked in, so divide by the 3! = 6 orders of each group:
10C3 = 720 ÷ 6 = 120
With repetition
A 3-character code using 10 digits, where digits can repeat: 103 = 1,000. Choosing 3 scoops from 10 ice-cream flavors, where you can pick the same flavor twice: C(12, 3) = 220.
Real-world uses
- Lotteries: a 6-from-49 draw has 49C6 = 13,983,816 possible tickets. Divide 1 by that to get the jackpot probability, or use the probability calculator to explore repeated draws.
- Passwords and PINs: a 4-digit PIN has 104 = 10,000 possibilities; an 8-character password from 62 letters and digits has 628, about 218 trillion.
- Scheduling and seating: 5 people can sit in a row in 5! = 120 orders.
- Growth in possibilities: adding one more character to that password multiplies the possibilities by 62, a 6,100% increase. The percentage increase calculator shows changes like this.
- Sampling: how many different samples of 5 can be taken from a group of 30? 30C5 = 142,506.
Why combinations are always fewer
Every combination of r items can be arranged in r! different orders, and each of those orders is a separate permutation. So nPr = nCr × r!, and nCr = nPr ÷ r!. When r is 0 or 1 the two are equal; as r grows, permutations quickly outnumber combinations.
Common mistakes
- Using permutations for a “choose a team” problem. If the members have no distinct roles, order doesn’t matter.
- Forgetting that 0! = 1, which makes nC0 = nCn = 1.
- Choosing more items than exist without repetition. If r is larger than n, there are zero ways unless repetition is allowed.
Frequently asked questions
What is the difference between a permutation and a combination?
In a permutation the order matters: gold–silver–bronze is different from bronze–silver–gold. In a combination only the group matters: a committee of Ann, Ben and Cara is the same in any order. That is why there are always at least as many permutations as combinations.
How do you calculate permutations?
Multiply n by each smaller whole number until you have multiplied r numbers together. 10P3 = 10 × 9 × 8 = 720. This is the same as n! ÷ (n − r)!.
How do you calculate combinations?
Work out the permutations, then divide by r! to remove the different orders of the same group. 10C3 = 720 ÷ (3 × 2 × 1) = 120.
What are permutations with repetition?
When each position can reuse any of the n items, such as digits in a PIN, there are nr arrangements. A 4-digit PIN using digits 0–9 has 104 = 10,000 possibilities.
How many ways are there to choose 6 numbers from 49?
Order doesn’t matter, so use combinations: 49C6 = 13,983,816. That means a single ticket has a 1 in 13,983,816 chance of matching all six numbers in a 6-from-49 draw.