Definition 7.1.1 · Overcounting
Overcounting is the process of counting more than what you need and then systematically subtracting the parts which do not belong.
Count everything in two or three overlapping groups: add the groups, subtract the overlaps, add back the middle.
In this section you will be able to see why adding two overlapping groups counts some things twice, and how to fix it.
Your teacher asks: “Who has a cat?” 12 hands go up. “Who has a dog?” 9 hands go up. Are there 21 pet owners? Not if some kids raised their hand twice!
Sometimes the easy way to count is to count too much, then fix it. Kids with a cat and a dog got counted twice, so you subtract them once.
Overcounting is the process of counting more than what you need and then systematically subtracting the parts which do not belong.
The principle of inclusion and exclusion (PIE) is a counting technique that uses overcounting to compute the number of elements that satisfy at least one of several properties while guaranteeing that elements satisfying more than one property are not counted twice.
Out of 200 students, there are 100 taking Geometry, 70 taking Algebra, and 30 taking both. How many students are taking neither?
In this section you will be able to count things in A or B with |A ∪ B| = |A| + |B| − |A ∩ B|.
How many numbers from 1 to 100 can be split into equal groups of 2 or equal groups of 7? Adding 50 and 14 gives 64. But wait: 14, 28 and 42 are on both lists!
The union is everything in or . The intersection is everything in both. Adding and counts the intersection twice, so subtract it once.
When the “good” cases are many and the “bad” cases are few, count the bad ones with PIE and subtract from the total.
is the union of elements in both and (i.e. all elements that are in set or set , but duplicates are only written once).
is the intersection of elements in both and (i.e. only those elements which are in both sets).
Given two sets, and ,
Basically, we count the number of possibilities in 2 "things" and subtract the duplicates.
When the number of cases that don't work is much less than the number of cases that do work, it can often be helpful to use complementary counting along with PIE.
Find how many numbers from 1 to 100 (inclusive) that are divisible by 2 or 7.
How many numbers from 1 to 100 are divisible by 2?
How many subsets of the set have at most 4 even numbers and at most 2 elements that are multiples of 3?
How can you apply the Principle of Inclusion and Exclusion to this problem?
Mark and George are playing a guessing game. George randomly chooses 2 numbers between 1 and 25. Mark then asks George if exactly 1 of the 2 numbers is divisible by 7. George, truthfully, answers yes. Mark then proceeds to guess 1 multiple of 7 and 1 number that is not a multiple of 7. What is the probability that Mark guesses at least 1 number correctly?
How many multiples of 7 are there from 1 to 25? How many numbers are not multiples of 7?
How many different ways are there to arrange the letters in the word LOLLIPOP if each of the L's must be next to an O?
LOLLIPOP has 3 L's but only 2 O's. Each O has just 2 sides. What must happen to one of the O's?
How many positive numbers less than or equal to 100 are multiples of 2 or 3?
How many positive numbers less than or equal to 100 are NOT multiples of 2 or 3?
In a town of 351 adults, every adult owns a car, motorcycle, or both. If 331 adults own cars and 45 adults own motorcycles, how many of the car owners do not own a motorcycle?
How many positive numbers less than or equal to 200 are multiples of 2 and 3 but not a multiple of 5?
Sets and , shown in the Venn diagram, have the same number of elements. Their union has 2007 elements and their intersection has 1001 elements. Find the number of elements in .
At Euler Middle School, 198 students voted on two issues in a school referendum with the following results: 149 voted in favor of the first issue and 119 voted in favor of the second issue. If there were exactly 29 students who voted against both issues, how many students voted in favor of both issues?
In this section you will be able to count things in A, B or C: add the singles, subtract the pairs, add back the triple.
Your school has art, band and chess clubs. Some students are in two clubs. A few are in all three! How do you count each student exactly once?
With three circles, the middle gets messy. A student in all three clubs is added 3 times, then subtracted 3 times. That leaves 0, so you add them back once.
Given three sets, ,
In this formula, we count the number of possibilities in 3 "things", subtract the possibilities that are duplicates in all 3 pairs of sets, and add back the number of duplicates that are in all 3 sets.
How many numbers less than or equal to 193 are multiples of 2, 3, or 5?
How many numbers up to 193 are divisible by 2? By 3? By 5?
Five different awards are to be given to three students. Each student will receive at least one award. In how many different ways can the awards be distributed?
Forget the rule for a moment. Each award can go to any of the 3 students. How many ways?
Mrs. Sanders has three grandchildren, who call her regularly. One calls her every three days, one calls her every four days, and one calls her every five days. All three called her on December 31, 2016. On how many days during the next year did she not receive a phone call from any of her grandchildren?
Alice refuses to sit next to either Bob or Carla. Derek refuses to sit next to Eric. How many ways are there for the five of them to sit in a row of 5 chairs under these conditions?
There are 20 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 10 students taking yoga, 13 taking bridge, and 9 taking painting. There are 9 students taking at least two classes. How many students are taking all three classes?
Call a number prime-looking if it is composite but not divisible by 2, 3, or 5. The three smallest prime-looking numbers are 49, 77, and 91. There are 168 prime numbers less than 1000. How many prime-looking numbers are there less than 1000?
In this section you will be able to see the pattern behind PIE for any number of sets (optional).
What if there are 4 overlapping groups? Or 10? You can’t draw that Venn diagram nicely. But the pattern keeps going!
Add every single set, subtract every pair, add every triple, subtract every quadruple, and so on. The signs take turns until you reach the term with all the sets.
The star in the widget is one element. However many sets it is in, the rounds always count it exactly once in the end.
The same principle applies when counting more than 3 events. For any events, to find the total number of ways such that any of the events occur:
Alternate between adding the number of ways and subtracting the number of ways until you reach the case where all events occur. Whether you add or subtract the number of ways where all events occur depends on whether is odd, since we alternate between adding and subtracting.
Stated more formally, if are finite sets, then:
Don't be afraid of the complex notation. There is no need to memorize or understand this formula if you understand the concept above.
Each just means "add up every term of this kind": all the singles, then all the pairs, then all the triples, with the signs taking turns
Students are being assigned to faculty mentors in the Berkeley Math Department. If there are 7 distinct students and 3 distinct mentors, and each student has exactly one mentor, in how many ways can students be assigned to mentors such that each mentor has at least one student?
How many different subsets of contain at least one element in common with each of the sets , and ?
In this section you will be able to mix two-set and three-set PIE on contest problems.
Time for a tough one from the AIME! Look for the two events, find each chance, and subtract the overlap. Every problem has three hints if you get stuck.
Want every problem from this chapter on one page? Open the problem set.
Many states use a sequence of three letters followed by a sequence of three digits as their standard license-plate pattern. Given that each three-letter three-digit arrangement is equally likely, the probability that such a license plate will contain at least one palindrome (a three-letter arrangement or a three-digit arrangement that reads the same left to right as it does right to left) is , where and are relatively prime positive integers. Find .