Topics / Counting & Probability
Inclusion-Exclusion
Overlapping sets, Venn diagrams, PIE counting
## What you need to know
- Two sets: .
- Three sets: .
- General principle: add the single sets, subtract pairwise intersections, add triple intersections, and so on with alternating signs.
- Complement form: elements in none of the sets number .
- Multiples of in : ; multiples of both and are multiples of .
- Venn-diagram bookkeeping: fill the innermost region first and work outward.
## How AMC 10 tests it
- Problems 5–12: survey problems (" take math, take science, take both") asking for the "neither" count or an "exactly one" region.
- Problems 10–18: integers up to divisible by at least one of several numbers, or by none.
- Problems 15–22: inclusion-exclusion hidden inside arrangements ("every color is used," "at least one letter in its original spot").
- Occasionally an "exactly two" region, where the union formula is not enough and the diagram must be filled.
## Standard approaches
1. Draw the Venn diagram and fill regions from the center; many problems need no formula.
2. For "at least one," compute the union; for "none," subtract the union from the total.
3. For divisibility, each term is .
4. For "every box used," count all assignments and subtract those missing a box: .
5. Check that every region is a nonnegative integer; a negative region means a misread.
## Worked example
How many positive integers at most are divisible by or but not by ?
(A) (B) (C) (D) (E)
Solution. Divisible by or : . Among these, remove those divisible by : multiples of or of . Every multiple of is a multiple of , so this is just the multiples of : . Answer , so .
## Pitfalls
- Subtracting the pairwise overlaps but forgetting to add the triple overlap back.
- Reading " take both" as an "exactly both" region when it includes the triple region (or the reverse).
- Using instead of when and share a factor.
- Reporting the union when the question asks for the complement, or vice versa.
Traps that recur
- Adding the five box probabilities (5 · 1/25) without subtracting overlaps, or dropping the alternating signs in inclusion–exclusion. (2021 AMC 10B #22)
- Forgetting to add back the single arrangement with both red and blue empty (all candy in white), which gives 1931. (2010 AMC 10B #22)
- Subtracting all 400 multiples of 5 instead of only the multiples of 5 that are also multiples of 3 or 4. (2001 AMC 10 #25)
- Applying |A union B union C| = sum of singles minus pairs plus triple with the wrong meaning of the 9, which counts students in at least two classes, not pairwise overlaps. (2017 AMC 10B #13)
Problems, easiest first
How many numbers between and are integer multiples of or but not ?
There are students participating in an after-school program offering classes in yoga, bridge, and painting. Each student must take at least one of these three classes, but may take two or all three. There are students taking yoga, taking bridge, and taking painting. There are students taking at …
Daphne is visited periodically by her three best friends: Alice, Beatrix, and Claire. Alice visits every third day, Beatrix visits every fourth day, and Claire visits every fifth day. All three friends visited Daphne yesterday. How many days of the next 365-day period will exactly two friends visit her?
Ang, Ben, and Jasmin each have blocks, colored red, blue, yellow, white, and green; and there are empty boxes. Each of the people randomly and independently of the other two people places one of their blocks into each box. The probability that at least one box receives blocks all of the same color is …
Seven distinct pieces of candy are to be distributed among three bags. The red bag and the blue bag must each receive at least one piece of candy; the white bag may remain empty. How many arrangements are possible?
How many positive integers not exceeding are multiples of or but not ?