Permutations and Combinations
Learn permutations and combinations: the counting principle, factorials, nPr and nCr formulas, and when order matters, with many fully worked counting examples.
Key takeaways
- The counting principle: if one choice has m options and another has n, together they have m × n outcomes
- A permutation counts arrangements where ORDER matters; a combination counts selections where order does NOT
- Permutations: nPr = n! / (n − r)! · Combinations: nCr = n! / (r!(n − r)!)
- Factorial n! means n × (n−1) × … × 2 × 1, and 0! is defined as 1
The art of counting without listing
How many four-digit PINs are possible? How many ways can a team of 5 be picked from 20? Listing them all is impossible, so we need clever counting methods. This branch of maths — called combinatorics — gives formulas that count huge numbers of possibilities in one calculation, and it powers probability and computer science.
If you have not met probability yet, probability basics pairs naturally with this topic, because counting outcomes is how you find probabilities.
The fundamental counting principle
The starting rule is simple: if one decision can be made in m ways and a separate decision in n ways, then the two together can be made in m × n ways. Multiply the choices.
Worked example 1: A café offers 3 sandwiches and 4 drinks. How many sandwich-and-drink meals are possible?
- Sandwich: 3 ways. Drink: 4 ways.
3 × 4 = 12meals.
Worked example 2: A four-digit PIN uses digits 0–9, and digits can repeat. How many PINs are possible?
- Each of the 4 positions has 10 choices.
10 × 10 × 10 × 10 = 10⁴ = 10,000PINs.
Factorials
When you arrange a set of items in order with no repeats, the choices shrink by one each time: this gives a factorial.
n! = n × (n − 1) × (n − 2) × … × 2 × 1
By definition, 0! = 1.
| n | n! |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 6 |
| 4 | 24 |
| 5 | 120 |
| 6 | 720 |
Worked example 3: In how many orders can 5 different books be arranged on a shelf?
- First slot: 5 choices, then 4, then 3, then 2, then 1.
5 × 4 × 3 × 2 × 1 = 5! = 120orders.
Permutations: order matters
A permutation counts arrangements where order matters and you choose r items from n without repeats:
nPr = n! / (n − r)!
Use it for rankings, podium places, race finishes, seat orders and passwords without repeats.
Worked example 4: From 5 runners, gold and silver medals are awarded. How many ways?
- Order matters (gold ≠ silver), choosing 2 from 5:
5P2 = 5! / (5 − 2)! = 5! / 3!. = 120 / 6 = 20ways.
You can also reason directly: 5 choices for gold, then 4 for silver, 5 × 4 = 20 — the same answer.
Worked example 5: How many 3-letter "words" (any letter order, no repeats) can be made from A, B, C, D, E, F?
6P3 = 6! / (6 − 3)! = 6! / 3! = 720 / 6 = 120.- 120 arrangements.
Combinations: order does not matter
A combination counts selections where order does not matter:
nCr = n! / (r! · (n − r)!)
Use it for choosing teams, committees, lottery numbers and any "pick a group" situation. The extra r! divides out the orderings of the chosen group, because they all count as one selection.
Worked example 6: How many ways to choose 2 students from 5 for a committee?
- Order does not matter, so use combinations:
5C2 = 5! / (2! · 3!). = 120 / (2 × 6) = 120 / 12 = 10ways.
Worked example 7: A lottery draws 6 numbers from 49. How many possible draws?
- Order does not matter:
49C6 = 49! / (6! · 43!). - This equals
13,983,816. - That is why your chance of matching all six is about 1 in 14 million.
Permutation or combination? The key question
Always ask: does the order matter?
| Situation | Order matters? | Use |
|---|---|---|
| Gold, silver, bronze medals | Yes | Permutation |
| Picking a 5-a-side team | No | Combination |
| Setting a 4-digit PIN | Yes | Permutation (with repeats) |
| Choosing 3 pizza toppings | No | Combination |
| Seating people in a row | Yes | Permutation |
| Lottery numbers | No | Combination |
Worked example 8: From 8 friends, how many ways to (a) choose 3 to share a taxi, and (b) award them 1st, 2nd and 3rd in a race?
- (a) Order does not matter:
8C3 = 8! / (3! · 5!) = 40320 / (6 × 120) = 40320 / 720 = 56. - (b) Order matters:
8P3 = 8! / 5! = 40320 / 120 = 336.
Notice (b) is exactly 3! (= 6) times larger than (a), because each group of 3 can be ranked in 6 orders.
Why does dividing by r! turn a permutation into a combination? A permutation counts every ordering separately. But for a committee, the same three people in any order are the same committee. Each group of r people can be ordered in r! ways, so we divide the permutation count by r! to collapse those duplicates into a single selection.
Where this is used
Combinatorics underpins probability — counting favourable and total outcomes. Computer science uses it to count passwords, estimate algorithm running times, and design networks. Geneticists count gene combinations; sports leagues count fixtures; cryptographers measure how hard a code is to crack by counting possibilities. Whenever you need "how many ways," permutations and combinations give the answer instantly.
Practice activity
- A menu has 4 starters and 5 mains. How many starter-and-main meals?
- Calculate 6!.
- From 7 athletes, how many ways to award gold and silver (order matters)?
- How many ways to choose 3 books from 10 to take on holiday (order does not matter)?
- How many 3-digit codes are possible using digits 0–9 if digits can repeat?
Answers:
4 × 5 =20.6! =720.7P2 = 7!/5! = 42, so 42.10C3 = 10!/(3!·7!) = 720/6 =120.10 × 10 × 10 =1000.
Summary
Counting starts with the fundamental principle: multiply independent choices (m × n). A factorial n! counts orderings of n items, with 0! = 1. A permutation nPr = n!/(n−r)! counts selections where order matters; a combination nCr = n!/(r!(n−r)!) counts selections where order does not. The decisive question is always "does order matter?" Dividing a permutation by r! removes duplicate orderings to give the combination. These tools count possibilities that are far too numerous to list — the foundation of probability and computer science.
Quick quiz
Test yourself and earn XP
If a meal has 3 starters and 4 mains, how many starter-and-main combinations are there?
By the counting principle, multiply: 3 × 4 = 12.
Which counts arrangements where order matters?
A permutation counts ordered arrangements; a combination ignores order.
What is 4! ?
4! = 4 × 3 × 2 × 1 = 24.
How many ways to choose 2 students from 5 (order does not matter)?
5C2 = 5!/(2!·3!) = 120/(2×6) = 10.
How many ways to award gold and silver to 5 runners (order matters)?
5P2 = 5!/(5−2)! = 120/6 = 20.
FAQ
Ask: does the order matter? Ranking, seating, passwords and podium positions are permutations. Choosing a team, a committee or a handful of items where order is irrelevant are combinations.
There is exactly one way to arrange nothing — the empty arrangement. Defining 0! = 1 keeps the permutation and combination formulas consistent, for example nCn = 1.
It is the factorial sign. n! means multiply all the whole numbers from n down to 1, so 5! = 5 × 4 × 3 × 2 × 1 = 120.
Keep exploring
More in Math