Overview
There are tons of problems that ask for a number of values satisfying a condition involving "at least " or "not all" that may initially seem like they revolve around tedious casework.
Complementary counting exploits the condition that:
Favourable Outcomes Total Outcomes Unfavourable Outcomes
As a result, often times it is simpler to solve for both total outcomes and unfavourable outcomes (i.e, outcomes that do not satisfy the given condition) rather than directly solving for favourable outcomes.
Introductory Example
How many 3-digit numbers have at least one 5?
Doing this directly is quite tedious. We first casework on the number of s in the number and then use counting techniques to sum all the possibilities. It goes as follows:
Only one "5":
The single can sit in any of the three positions, and the other two digits must avoid . Reading the products as hundreds tens units:
- in the hundreds place:
- in the tens place:
- in the units place:
This case contributes .
Exactly two "5"s:
- in the hundreds and tens places:
- in the hundreds and units places:
- in the tens and units places:
This case contributes .
All three "5"s:
Only works, contributing .
Summing every case:
Notice the asymmetry in every case? Whenever the hundreds digit is free it has only valid choices, since it cannot be , while a free tens or units digit has . This mess and large amount of things that we need to keep track of make the direct approach tedious here.
Now we solve the same problem by counting the complement instead. The condition "at least one " fails only for numbers that contain no whatsoever, so:
Total 3-digit numbers: every integer from to , which is .
Numbers with no anywhere:
- Hundreds digit: any of , so choices.
- Tens digit: any of , so choices.
- Units digit: choices.
That gives . Therefore:
The same answer, gotten much faster!
Patterns
Complementary counting tends to be useful whenever the favourable set splits into many cases but the unfavourable set is small or uniform. The phrasing of a problem is usually the giveaway!
- at least one the complement is none.
- at least two the complement is zero or one.
- not all the complement is all.
- at least two share a property the complement is everything distinct.
Examples
Example 1: Probability
A fair coin is flipped times. What is the probability of getting at least one heads?
Doing this directly means summing the probabilities of exactly one, two, three, four, and five heads. The complement of "at least one heads" is "no heads," meaning all five flips land tails:
So:
Example 2: Repeated Value
A standard six-sided die is rolled four times. What is the probability that at least two of the rolls show the same value?
The favourable event, "at least two match," encompasses many configurations, but the complement, "all four rolls distinct," is quite simple!
Total outcomes: .
All distinct: .
This is the same engine behind the famous birthday problem, where counting "everyone has a distinct birthday" is far cleaner than dealing with overlaps.
Example 3
1992 AIME · Problem 2. A positive integer is called ascending if, in its decimal representation, there are at least two digits and each digit is less than any digit to its right. How many ascending positive integers are there?
Solution. An ascending integer has a one-to-one bijection by its set of digits, i.e, any chosen set admits exactly one strictly increasing arrangement. The digit never appears, since as the smallest digit it would be forced into the leftmost slot, which a positive integer cannot have. The digits are therefore from the set , and ascending integers correspond exactly to subsets with .
The total subset count is , and the excluded subsets are those with , namely the empty set and the nine sets with size .
Example 4
2021 AMC 10A · Problem 23. Frieda the frog begins a sequence of hops on a grid of squares, moving one square per hop and choosing the direction (up, down, left, or right) uniformly at random; she never hops diagonally. A hop that would leave the grid wraps around to the opposite edge. Starting from the center square, Frieda makes at most four hops and stops as soon as she lands on a corner. What is the probability that she reaches a corner on one of the four hops?
Solution. Classify squares by type: (center), (edge, non-corner), (corner). From any edge square the four neighbours are two corners, the center, and one more edge (reached by wraparound). Recall the recursion module, we can derive some transitions to let us conduct recursion.
"w.p." refers to "With Probability":
Corners are absorbing.
Path enumeration. After the forced opening hop , the frog stays within until a . The corner-reaching paths of length at most are:
Summing:
State counting (alternative). Track the number of length- hop sequences reaching each square (the corresponding cell in these matrices refers to the number of ways to reach that cell on the actual x grid)
Each interior entry is the sum of its non-corner neighbours' counts from the previous step, with wraparound. We sum the number of corner cases over the total possibilities, i.e, , where is the number of hops across all cases:
Practice
- How many 4-digit numbers contain at least one digit equal to ?
- Five distinct books are placed in a row. In how many arrangements are two particular books not next to each other?
- A bag holds red and blue marbles. Three are drawn without replacement. What is the probability that at least one is red?
- How many subsets of contain at least one odd number?
Answers
- .
- .
- .
- . The subsets with no odd number are exactly the subsets of the four even elements.
Practice Problems
| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
| Mastering AMC 8 | Medium | Show TagsComplementary Counting | ||||
Module Progress:
Join the Discord Community!
Stuck on a problem, or don't understand a module? Join the Discord and get help with your doubts while making more math friends.
