Sub topic 5
Choosing between permutations and combinations
This chapter assumes you know the multiplication principle, can simplify factorials, and have seen the formulas for permutations and combinations. Here the goal is not to compute them. The goal is to pick the right one reliably, which is where most GRE counting mistakes happen.
The swap test
A permutation counts ordered selections. A combination counts unordered selections. The formulas differ by one factor:
| Count | Formula | Meaning |
|---|---|---|
| Permutations, P(n, k) | n! / (n − k)! | Choose k of n items and arrange them in order |
| Combinations, C(n, k) | n! / (k! (n − k)!) | Choose k of n items, ignoring order |
To decide which one applies, take a single outcome and swap two of the chosen items. Then ask whether you have a different outcome or the same one.
- If swapping gives a different outcome, order matters. Use a permutation.
- If swapping gives the same outcome, order does not matter. Use a combination.
Take the choice of 3 people from a group of 8. If the three people are a gold, silver, and bronze medalist, swapping gold and silver changes who won what, so it is a different outcome. If the three people are a committee, swapping two of them changes nothing, because the same three people are on it.
The swap test works because every group of k items can be arranged in k! ways. Permutations count each group k! times, and combinations count it once. This gives the relationship to remember:
P(n, k) = C(n, k) × k!
import math
print(math.factorial(5)) # 120
print(math.perm(5, 3)) # 60: ordered selections of 3 from 5
print(math.comb(5, 3)) # 10: unordered selections of 3 from 5The output shows 60 = 10 × 3!. Each of the 10 groups can be lined up in 6 orders.
Brute-force check on a small case
When you are unsure, list the outcomes for a tiny version of the problem. Python's itertools can do this and confirm that the formulas match the listing.
import itertools
import math
people = ["A", "B", "C", "D", "E"]
ordered = list(itertools.permutations(people, 3))
unordered = list(itertools.combinations(people, 3))
print(len(ordered), math.perm(5, 3)) # 60 60
print(len(unordered), math.comb(5, 3)) # 10 10
print(len(ordered) == len(unordered) * math.factorial(3)) # True
print(ordered[0], ordered[1]) # ('A', 'B', 'C') ('A', 'B', 'D')
print(unordered[0]) # ('A', 'B', 'C')The listing shows that ('A', 'B', 'C') and ('C', 'B', 'A') are separate entries among the ordered outcomes. Among the unordered outcomes, they are one entry.
Reading the problem for signals
The wording of a GRE problem usually tells you whether order matters. The deciding factor is whether the chosen items play different roles.
| Order matters (permutation) | Order does not matter (combination) |
|---|---|
| Distinct positions: president, vice president, treasurer | A committee, team, or panel with equal members |
| Ranked results: first, second, third place | A set of items picked from a larger set |
| Arrangements in a line or sequence | Hands of cards |
| Codes, passwords, and lock settings | Pairs, such as handshakes or matches |
| Assigning different jobs to different people | Subsets of a set |
Two cautions apply when reading the wording:
- A "combination lock" is really a permutation problem, because the order of the digits matters. The name is misleading.
- The phrase "select" can describe either type. Look at what happens after the selection. If the chosen items receive different titles, positions, or places, order matters.
A decision flow
The flow below applies the swap test and also catches the case where repetition is allowed. In that case neither formula applies.
Worked examples
Example 1: same pool, different questions
Eight runners compete in a race. How many ways can the top three finish? Medals are different, so order matters:
P(8, 3) = 8 × 7 × 6 = 336
Now suppose three of the eight runners are chosen at random to take a drug test. The three are not ranked, so order does not matter:
C(8, 3) = (8 × 7 × 6) / (3 × 2 × 1) = 56
The ratio is 336 / 56 = 6 = 3!, as the relationship predicts.
Example 2: a selection followed by a role
A committee of 4 is chosen from 10 people, and one member of the committee is named chair. Here order matters only partly. The four members are interchangeable except for the chair. Two approaches give the same count.
Approach 1 is to choose the chair first, then choose the other three members from the remaining nine:
10 × C(9, 3) = 10 × 84 = 840
Approach 2 is to choose the committee, then choose the chair from its four members:
C(10, 4) × 4 = 210 × 4 = 840
import math
print(10 * math.comb(9, 3)) # 840
print(math.comb(10, 4) * 4) # 840When a problem mixes unordered selection with a special role, split it into steps and multiply. Use a combination for each unordered step and a direct count for each role.
Example 3: repetition allowed
A PIN has 4 digits, and digits can repeat. There are 10 choices at each of 4 positions:
10 × 10 × 10 × 10 = 10,000
Without repeats, the count is P(10, 4) = 10 × 9 × 8 × 7 = 5,040. Permutations assume that each item is used at most once. If the problem lets an item be reused, go back to the multiplication principle.
Example 4: pairs, matches, and handshakes
Seven teams play in a league. If each pair of teams plays exactly once, a match between team A and team B is the same match as one between B and A. Order does not matter:
C(7, 2) = 21 matches
If each pair plays twice, once at each team's home field, then "A hosts B" differs from "B hosts A." Order matters:
P(7, 2) = 7 × 6 = 42 matches
Notice that 42 = 21 × 2!. The same pairs are counted, but each one now has two orders.
Common errors
- Overcounting with a permutation. You use P(n, k) for a committee and get an answer k! times too large. If your answer seems too big for an unordered problem, divide by k! and see whether the result is more sensible.
- Undercounting with a combination. You use C(n, k) when positions are distinct. Multiply by k! to assign the roles, or use P(n, k) directly.
- Missing a hidden order. The words "select" and "choose" hide the role structure. Look for titles, ranks, or different tasks later in the problem.
- Forgetting repetition. Check whether an item can appear twice before using either formula.
- Mixing "and" and "or." When a problem has several independent selections joined by "and," multiply the counts. When it splits into mutually exclusive cases joined by "or," add them. Choosing 2 men and 2 women from separate groups is a product of two combinations. Choosing "2 men or 3 women" is a sum.
- Counting the same group twice by choosing roles in separate steps. If you pick a chair first and then pick members, make sure the members do not include the chair again. The choice of 9 rather than 10 in Example 2 prevents this.
Checking by shrinking the problem
On the GRE, you can test a method by replacing the numbers with tiny ones. Suppose you are unsure whether a 5-person, 3-seat problem needs P or C. Try 3 people and 2 seats, list the outcomes by hand, and see which formula matches. Listing takes under a minute and prevents a wrong setup from carrying through a calculation.
Exercises
Exercise
A club has 12 members. (a) In how many ways can a 3-person delegation be chosen to attend a conference? (b) In how many ways can a president, secretary, and treasurer be chosen?
Show answer
(a) The delegation is unordered: C(12, 3) = 220. (b) The three offices are different, so order matters: P(12, 3) = 12 × 11 × 10 = 1,320. The ratio is 1,320 / 220 = 6 = 3!.
Exercise
Seven teams play a tournament. How many games are played if every pair plays once? How many if every pair plays twice, once at each team's home?
Show answer
Once per pair: C(7, 2) = 21 games. Home and away: each pair has two orderings, so P(7, 2) = 7 × 6 = 42 games, which equals 21 × 2.
Exercise
How many 4-digit PINs can be made from the digits 0 through 9 (a) if digits may repeat, and (b) if no digit may repeat?
Show answer
(a) Each position has 10 choices: 10^4 = 10,000. (b) Without repeats the choices drop at each step: P(10, 4) = 10 × 9 × 8 × 7 = 5,040.
Exercise
A committee of 5 is chosen from 9 people. One member is the chair and a different member is the secretary. The other three have no special role. How many committees are possible?
Show answer
Choose the chair in 9 ways and the secretary in 8 ways. Then choose the other three members from the remaining 7: C(7, 3) = 35. The total is 9 × 8 × 35 = 2,520. Check by another route: C(9, 5) = 126 committees, times 5 × 4 = 20 ways to pick the chair and secretary within each, gives 2,520.