AMC 10 Step by Step
Printable problems

Inclusion-Exclusion

Overlapping sets, Venn diagrams, PIE counting

What you need to know

  • Two groups. (number in AA or BB) == (number in AA) ++ (number in BB) −- (number in both). Things in both were counted twice, so subtract them once. Example: from 11 to 6060 there are 1515 multiples of 44, 1010 of 66, and 55 of both (the multiples of 1212). So 15+10−5=2015+10-5 = 20 are multiples of 44 or 66.
  • Three groups. Add the three groups, subtract the three overlaps of two groups, then add back the overlap of all three. Writing #( )\#(\ ) for "the number in": #(A or B or C)=#(A)+#(B)+#(C)−#(A and B)−#(A and C)−#(B and C)+#(A and B and C)\#(A\text{ or }B\text{ or }C) = \#(A)+\#(B)+\#(C)-\#(A\text{ and }B)-\#(A\text{ and }C)-\#(B\text{ and }C)+\#(A\text{ and }B\text{ and }C). Example: from 11 to 100100, the multiples of 22, 33, or 55 number 50+33+20−16−10−6+3=7450+33+20-16-10-6+3 = 74.
  • Any number of groups. This is the Principle of Inclusion-Exclusion (PIE): add the single groups, subtract the overlaps of two, add the overlaps of three, and so on, switching signs each time.
  • Counting "none." The number in none of the groups is the total minus the number in at least one. Example: 100−74=26100-74 = 26 numbers from 11 to 100100 are divisible by none of 22, 33, 55.
  • Counting multiples. From 11 to NN there are ⌊N/m⌋\lfloor N/m\rfloor multiples of mm, where ⌊ ⌋\lfloor\ \rfloor means "round down." A number is a multiple of both aa and bb exactly when it is a multiple of lcm(a,b)\text{lcm}(a,b). Example: from 11 to 100100 there are ⌊100/6⌋=16\lfloor 100/6\rfloor = 16 multiples of 66.
  • Filling in a Venn diagram. Start with the innermost region and work outward. Example: in a class of 4545, 3030 take math, 2020 take science, and 1010 take both. Put 1010 in the middle, 30−10=2030-10 = 20 in "math only," 20−10=1020-10 = 10 in "science only," and 45−40=545-40 = 5 outside.

How AMC 10 tests it

  • Problems 5–12: survey problems ("3030 take math, 2020 take science, 1010 take both") asking how many take neither, or how many are in exactly one group.
  • Problems 10–18: whole numbers up to NN divisible by at least one of several numbers, or by none.
  • Problems 15–22: PIE hidden inside arrangements ("every color is used," "at least one letter in its original spot").
  • Sometimes an "exactly two" region, where the "or" formula is not enough and you must fill in the diagram.

Standard approaches

  1. Draw the Venn diagram and fill it in from the center out; many problems need no formula.
  2. For "at least one," find the "or" count. For "none," subtract it from the total.
  3. For divisibility, each term is ⌊N/lcm⌋\lfloor N/\text{lcm}\rfloor.
  4. For "every box gets used," count all ways, then subtract the ways that miss a box. With nn different objects and kk different boxes: kn−(k1)(k−1)n+(k2)(k−2)n−⋯k^n-\binom{k}{1}(k-1)^n+\binom{k}{2}(k-2)^n-\cdots. Example: 44 different balls in 33 boxes, none empty: 34−3⋅24+3⋅14=81−48+3=363^4-3\cdot2^4+3\cdot1^4 = 81-48+3 = 36.
  5. Check that every region is a whole number that is zero or positive. A negative region means you misread something.

Worked example

How many positive integers at most 600600 are divisible by 44 or 66 but not by 99?

(A) 150150 (B) 167167 (C) 178178 (D) 184184 (E) 200200

Solution.

Step 1: divisible by 44 or 66. There are ⌊600/4⌋=150\lfloor 600/4\rfloor = 150 multiples of 44 and ⌊600/6⌋=100\lfloor 600/6\rfloor = 100 multiples of 66. Both means a multiple of lcm(4,6)=12\text{lcm}(4,6) = 12: ⌊600/12⌋=50\lfloor 600/12\rfloor = 50. By PIE, 150+100−50=200150+100-50 = 200.

Step 2: which of these are divisible by 99? Divisible by 44 and 99 means a multiple of lcm(4,9)=36\text{lcm}(4,9) = 36. Divisible by 66 and 99 means a multiple of lcm(6,9)=18\text{lcm}(6,9) = 18. Every multiple of 3636 is a multiple of 1818, so count the multiples of 1818: ⌊600/18⌋=33\lfloor 600/18\rfloor = 33 (since 18⋅33=59418\cdot33 = 594).

Step 3: subtract. 200−33=167200-33 = 167.

The answer is (B) 167\boxed{\textbf{(B)}\ 167}.

Pitfalls

  • Subtracting the overlaps of two groups but forgetting to add back the overlap of all three.
  • Reading "1010 take both" as the "exactly these two" region when it also includes people in the third group, or the other way around.
  • Using ⌊N/(ab)⌋\lfloor N/(ab)\rfloor instead of ⌊N/lcm(a,b)⌋\lfloor N/\text{lcm}(a,b)\rfloor when aa and bb share a factor. From 11 to 6060, 55 numbers are multiples of both 44 and 66, not ⌊60/24⌋=2\lfloor 60/24\rfloor = 2.
  • Giving the "at least one" count when the question asks for "none," or the other way around.

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 © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. The topic note, tags and key insights are original to this site.