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.
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.
In this lesson
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.
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.
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.
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.
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
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
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.