Module 2.5 · Counting and Probability
Complementary counting
Sometimes the things you want are messy to count, but the things you don't want are easy. Then count everything, count the unwanted cases, and subtract. This is complementary counting, and the words "at least one" are its calling card.
The idea
How many three-digit numbers have at least one repeated digit? Counting directly means cases: exactly two digits equal (in which positions?), or all three equal. Instead, count the opposite.
- All three-digit numbers: (from to ).
- Three-digit numbers with no repeated digit: .
So have at least one repeated digit.
Complementary counting
Use it when the complement is simpler, especially for "at least one," "not," and "at least two" questions.
The opposite of "at least one" is "none." The opposite of "at least two" is "zero or one." The opposite of "not all the same" is "all the same."
Worked example: At least one 7
How many four-digit numbers contain at least one digit ?
All four-digit numbers: . Four-digit numbers with no : the first digit has choices (not , not ) and each other digit has choices (not ): .
So contain at least one .
Worked example: At least one girl
A committee of is chosen from boys and girls. How many committees include at least one girl?
All committees: . Committees with no girls (all boys): . So include at least one girl.
Counting directly would take three cases (exactly , or girls): . Same answer, more work.
Worked example: Avoiding a point
How many shortest paths go from to , moving right or up one unit at a time, and avoid the point ?
All paths: . Paths through : . Paths that avoid it: .
Common mistake
Make sure the "everything" count and the "unwanted" count use exactly the same rules. If the problem is about four-digit numbers, the complement must also be four-digit numbers (leading digit not ). Mixing "four-digit numbers" with "four-digit strings" is the classic slip.
Tip
When you can, check a complementary answer by counting directly on a smaller version of the problem. For example, with two-digit numbers: total, with no , so contain a . Listing them ( and , with counted once) gives .
Practice
How many integers from to are not multiples of ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
How many three-digit numbers have at least one even digit?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A coin is flipped times, and the sequence of heads and tails is recorded. In how many sequences are there at least two heads?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
How many four-digit numbers have at least one repeated digit?
Five students line up in a row. In how many arrangements is Mia not at either end?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
How many integers from to contain at least one digit ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A bag holds red, blue and green marbles, all different. In how many ways can you choose marbles that are not all the same color?
Four people sit in a row of chairs. In how many ways can they be seated so that at least two of them sit in neighboring chairs?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Real contest practice
- 2020 AMC 8, Problem 23: count all ways to hand out awards, then remove those that leave a student empty-handed.
- 2024 AMC 8, Problem 25: a probability that is easiest through the complement (no two adjacent empty seats).