Permutation and combination
Last updated: 2026-11-26
A permutation is an ordered selection: the same items in a different order count as a different outcome. A combination is a selection where order doesn't matter, so only which items you took counts. The counting here assumes you pick from different items and use none of them twice.
Start learning No account needed
1. The swap test
A word problem may not say whether order matters. Write down one outcome, then swap two of the chosen items. If the swapped version is a different result in the story, count permutations. If it is the same result, count combinations. Apply the test to the story itself, because words like "choose" or "arrange" can mislead you.
2. A worked example: two roles or one committee
From five people you pick a president and a secretary. Separately, you pick a committee of two. Predict which count is larger, and by what factor. The lists are built and counted by scripts/permutation-vs-combination-worked-example.py in the Professor Turing repository.
5 people: A B C D E
president and secretary: 20 outcomes
committee of 2: 10 outcomes
outcomes using only A and B
officers: AB, BA
committee: AB
8 runners
gold, silver, bronze: 336
3 who advance, unranked: 56
orders of 3 chosen runners: 6
3-digit codes
digits may repeat: 1000
no repeated digit: 720
sets of 3 different digits: 120
AB and BA are two different officer results, since the president changes. As a committee they are one result. Each committee of two can be ordered in 2 ways, so 20 ordered outcomes collapse into 10.
3. Build the formulas from the counting
For ordered picks of r items from n, multiply the choices as they shrink. With 8 runners and 3 medals there are 8 × 7 × 6 = 336 results. Written with factorials, this is n! / (n − r)!.
If you only care which 3 runners advance, each group of 3 was counted 3! = 6 times among those 336. Divide: 336 / 6 = 56. In general the number of combinations is n! / (r! (n − r)!). The extra r! in the denominator removes the orders. Wikipedia's article on combinations relates the two counts the same way: each combination of r items has r! orderings.
4. A common misconception: a "combination lock" counts combinations
Take a code lock on which 123 and 321 are different codes. On that lock order matters, despite the name. If digits may repeat, there are 10 × 10 × 10 = 1000 three-digit codes, which is neither of the two formulas above. It is the multiplication rule on its own. With no repeated digit there are 720 ordered codes, and 120 sets of digits.
So ask two questions before you pick a formula. Does order change the result? Can an item be used again?
| Order matters? | Repeats allowed? | How to count r picks from n |
|---|---|---|
| Yes | No | n! / (n − r)! |
| No | No | n! / (r! (n − r)!) |
| Yes | Yes | nr, the product of r factors of n |
Unordered selection with repeats is a further case that this page leaves out.
5. Test yourself
Case 1. A pizza gets 3 different toppings from a list of 7. How many pizzas are possible?
Answer to case 1
Swapping toppings leaves the same pizza, so it is a combination: 7 × 6 × 5 / 6 = 35.
Case 2. How many 4-letter strings can you make from 6 different letters, using no letter twice?
Answer to case 2
Order matters: 6 × 5 × 4 × 3 = 360.
Case 3. From 6 players, pick a captain and then 2 other players with no separate roles.
Answer to case 3
6 choices of captain, then 10 pairs from the other 5, giving 60. The captain is a role, and the other two are a set.
For related practice, see how to study for discrete math and how to test yourself.
What the sources found, and their limits
Wikipedia, "Permutation," "Combination" and "Rule of product." Ordered selections of distinct items and their count, unordered selections and the link between the two formulas, and the multiplication principle. Limits: reference articles under CC BY-SA 4.0; the permutation article also uses the word for rearranging a whole set. Sources: Permutation, Combination and Rule of product, read on 2026-11-25.
The swap test is our way of putting the order question. The examples, the table, the lock discussion and the self-test cases are ours.
How Professor Turing helps
Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks you questions instead of giving the final answer, does not grade a bare guess, and remembers what you got wrong. No account is needed to start. It's an AI tutor, free to try.
Bring a counting problem and say which count you would use. Its first reply asks about your attempt, such as whether swapping two picks changes the result, before it teaches anything. You must be 18 or older, and guest conversations are deleted 7 days after the last activity.
FAQ
How do you know whether order matters? Write one outcome and swap two of the chosen items. If the story treats the result as different, order matters. A president and secretary change when swapped, while two committee members do not.
Why divide by r factorial for combinations? An ordered count lists each group of r items r! times, once for each order. With 3 of 8 runners, 336 ordered results contain each group 6 times, so there are 56 groups.
Start with what you're working on
Tell the tutor which counting problem you are working on and let it ask you the questions.
Start learning No account needed
See also: how to study for discrete math · all study guides