Sub topic 1
GRE Counting: Steps, Factorials, Permutations, and Combinations
Prerequisites
This chapter assumes you can multiply, divide, and simplify integers and fractions. You should be able to read a word problem and identify what it asks. You should also know what "and" and "or" mean in a condition.
Counting by steps and by cases
The multiplication principle applies when a task has stages done in sequence. If stage one has m choices and stage two has n choices, the task has m × n outcomes. For example, 3 shirts and 4 pairs of pants give 3 × 4 = 12 outfits.
The addition principle applies when the cases cannot overlap. If case one has m outcomes and case two has n outcomes, the total is m + n. If cases overlap, adding counts the shared outcomes twice, so you must subtract the overlap.
Factorials
The factorial n! is the product n × (n − 1) × ... × 1, and 0! = 1. To simplify, cancel the shared factors. For example, 8!/6! = 8 × 7 = 56.
import math
print(math.factorial(8) // math.factorial(6)) # 56Permutations: when order matters
A permutation is an ordered selection of r items from n items. The count is P(n, r) = n!/(n − r)!. For example, choosing a gold, silver, and bronze medalist from 8 runners gives P(8, 3) = 8 × 7 × 6 = 336.
Combinations: when order does not matter
A combination is an unordered selection. Each combination corresponds to r! permutations, so C(n, r) = P(n, r)/r! = n!/(r!(n − r)!). A committee of 3 from 8 people gives C(8, 3) = 336/6 = 56.
| Situation | Does order matter? | Count |
|---|---|---|
| Medals (first, second, third) | Yes | P(n, r) |
| Committee members | No | C(n, r) |
import math
print(math.perm(8, 3)) # 336
print(math.comb(8, 3)) # 56Exercise
A club has 10 members. In how many ways can it choose a president, a vice president, and a treasurer?
Show answer
Order matters because the three roles differ. P(10, 3) = 10 × 9 × 8 = 720.