StatisticsIntermediate

Permutations and Combinations

Counting problems come in two flavors: ones where order matters (permutations) and ones where it doesn't (combinations). Getting this distinction right is the entire difference between the two formulas.

✔ Quick Answer

A permutation is an arrangement where order matters , ABC and BAC are different. A combination is a selection where order doesn't matter , ABC and BAC are the same group. Use nPr for permutations, nCr for combinations.

1 The Key Distinction: Does Order Matter?

This is the only question you need to answer before choosing a formula. If rearranging the same items produces a different outcome, order matters and you use permutations. If rearranging the same items gives the same outcome, order doesn't matter and you use combinations.

The simplest test

Ask yourself: would swapping two items give a different result? A PIN code 1234 and 4321 are different , order matters, use permutations. A committee of Alice, Bob, and Carol is the same committee regardless of who you list first , order doesn't matter, use combinations.

2 Permutations (nPr)

A permutation is an ordered arrangement. nPr = n! / (n−r)!, where n is the total number of items and r is how many you're arranging.

Permutation Example
How many ways can 3 runners finish in 1st, 2nd, and 3rd place from a race of 8?
1Order matters , 1st/2nd/3rd are different positions
2n = 8 (total runners), r = 3 (positions to fill)
3nPr = 8! / (8−3)! = 8! / 5! = (8 × 7 × 6 × 5!) / 5! = 8 × 7 × 6 = 336
Answer: 336 different possible podium arrangements

You do not need to compute the full factorials. nPr is just r consecutive integers multiplying down from n. 8P3 = 8 x 7 x 6 = 336. Much faster. 8P3 = 8 × 7 × 6. You don't need to compute full factorials.

3 Combinations (nCr)

A combination is a selection where order doesn't matter. nCr = n! / (r! × (n−r)!). The extra r! in the denominator divides out all the ways to rearrange the same selection.

Combination Example
How many ways can you choose 3 students from a class of 8 for a committee?
1Order doesn't matter , the committee {Alice, Bob, Carol} is the same as {Carol, Alice, Bob}
2n = 8, r = 3
3nCr = 8! / (3! × 5!) = (8 × 7 × 6) / (3 × 2 × 1) = 336 / 6 = 56
Answer: 56 different possible committees

Notice the relationship: 8P3 = 336 and 8C3 = 56. The combination is exactly 3! = 6 times smaller, because every group of 3 people can be arranged in 6 different orders. Combinations collapse all those arrangements into one., because each group of 3 can be arranged 6 ways, and combinations don't care about those arrangements.

The relationship

nCr = nPr / r!. Every combination corresponds to r! permutations (all the orderings of the same group). Dividing by r! collapses all those orderings into one.

4 How to Choose Which Formula

Order matters vs order doesn't
PUse permutations when: passwords, PIN codes, race finishing positions, arrangement of objects in a line, seating arrangements at a specific table
CUse combinations when: choosing committee members, selecting lottery numbers, picking teams, choosing toppings on a pizza, dealing cards from a deck
The most common error

Calculating a combination when the problem actually involves order, or vice versa. When in doubt, try a small example: list all outcomes manually and check whether different orderings appear as separate items in your list. If yes, use permutations.

5 Real-World Examples

Lottery: choosing 6 numbers from 1-49 is a combination (the order you pick them doesn't matter). 49C6 = 13,983,816 , about 14 million possible tickets, which is why lotteries are so hard to win.

Passwords: an 8-character password using only digits 0-9 is a permutation with repetition allowed. 10⁸ = 100 million possibilities. This is why longer passwords with more character types are so much harder to crack.

Card games: a 5-card poker hand is a combination (52C5 = 2,598,960 possible hands). Specific hands like a royal flush (4 possible) become probabilities by dividing by the total combinations.

Practice Problems

How many ways can you arrange 4 books on a shelf chosen from 9 books?
Order matters , use permutations. 9P4 = 9 × 8 × 7 × 6 = 3,024
A pizza shop has 10 toppings. How many ways can you choose 3?
Order doesn't matter , use combinations. 10C3 = (10 × 9 × 8)/(3 × 2 × 1) = 720/6 = 120
A class of 12 students needs to elect a president, VP, and treasurer. How many outcomes are possible?
These are distinct positions, so order matters. 12P3 = 12 × 11 × 10 = 1,320
How many 5-card hands can be dealt from a 52-card deck?
Order doesn't matter in a hand. 52C5 = 52!/(5! × 47!) = 2,598,960

Sources & Further Reading

The explanations on this page draw on the following established sources. We link to primary and secondary sources so you can verify claims and go deeper on any topic.