1 - Advanced PIE
LESSON 6 : ADVANCED PRINCIPLE OF INCLUSION & EXCLUSION (PIE)
- We learned that PIE allows us to calculate the number of objects that
are members of at least one group.
- But PIE is much more powerful than that. Today we will explore more
advanced uses of PIE.
6.1: REVIEW: WHAT IS PIE AGAIN?
If we have two sets, and , and we want to count the number of elements in
(that is, ), we can use this formula:
This formula ensures that for each of the following cases, an element is only
counted once:
1. Element is in neither nor
○ not counted at all
2. Element is in but not
○ counted only in term 1
3. Element is in but not
○ counted only in term 2
4. Element is in both and
○ added twice in terms 1 and 2, subtracted once in term 3
Review problem: SEM offers three languages for all of its 175 freshman, all of
whom must take at least one. 72 take Spanish, 48 take Latin, and 28 take
French. 30 students are taking both Spanish and Latin, 14 are taking Latin and
French, and 11 are taking French and Spanish. How many students are taking all
three?
Answer:
Arjun Vikram & Aneesh Sharma, April 2019
2 - Advanced PIE
6.2: REVIEW: EXTENSION TO PROBABILITY
Just as PIE works for counting the number of elements in a group, it can work
just as well for probability. The probability
- If two events ARE mutually exclusive, they CANNOT occur at the same time.
- If they are NOT mutually exclusive, however, the two events CAN occur at
the same time.
- This idea is very important in PIE, and introduces us to the idea of
overcounting in probability.
When two events can occur together, the probability of either event occurring
is given by the probability of them both occurring separately minus the the
probability of them occurring together. Algebraically, if we let the events be
and :
Similarly, for three events:
- It is very important to know how PIE applies to probability, as many
questions deal with probability instead of sets
- But as you see, these formulas are almost identical to what we saw for PIE
with sets earlier. So if you understood that, you should be good here.
- In questions, when they ask “what is the probability of X OR Y”... this
formula should come to mind
6.3: EXTENSION TO OTHER TYPES OF PROBLEMS
- Sometimes, there are PIE problems which are not just combinatorics and/or
probability. We aren’t going to look at a problem like this in the notes for
the sake of time, but there are a few problems in the challenge problems
section that extend the idea of PIE past combinatorics and probability. Just
remember that the general idea of PIE is to keep adding and subtracting more
and more intersections until you have counted everything exactly once.
Arjun Vikram & Aneesh Sharma, April 2019
3 - Advanced PIE
6.4: COMPLEMENTARY COUNTING AND PIE
Often, it is useful to use PIE when we are trying to count the number of
elements that aren’t elements of any set, or the probability that no events
happen. We can do this with something called complementary
counting/probability.
The idea behind complementary counting is that the number of elements part of
at least one set plus the number of elements not part of any set is equal to
the total number of elements.
Thus, to find the number of elements not part of any set, we subtract the
number of elements in at least one set from the total number of elements.
The idea behind complementary probability is very similar, that the
probability of no events happening plus the probability of at least one event
happening is 1.
Let’s look at an example:
The Sanders family has three boys and three girls. In how many ways can the 6
children be seated in a row of 6 chairs, so that the boys aren’t all seated
together and the girls aren’t all seated together?
We know there are total ways of seating the kids. So we can use
complementary counting and PIE.
The number of ways to seat the kids so that all the girls are seated together
is . We know this because we can first permute the girls, then
treat them as one unit, and permute the boys and the single unit of girls.
The number of ways to seat the kids so that the boys are all seated together
is also .
The number of ways to seat the kids so that both the girls and boys are seated
together is .
So the number of ways to seat the kids so that at least one of the girls and
boys are together is
Thus, our answer is .
Arjun Vikram & Aneesh Sharma, April 2019
4 - Advanced PIE
6.5: COUNTING THE NUMBER OF ELEMENTS IN MORE THAN ONE SET
So far with PIE, we’ve seen how to count the number of elements in at least
one set. What about counting the number of elements in at least two sets?
Three sets? Seventeen sets?
We are going to see how we can do that.
Let’s look at a problem.
How many positive integers less than or equal to 1000 are divisible by at
least two of 2, 3, and 5?
BOGUS SOLUTION (THIS IS VERY WRONG!):
There are integers which are divisible by all of the two
pairs, but this overcounts integers which are divisible by all three. Thus
our answer is .
Let’s analyze this a bit.
If a number is divisible by 2 and 3 but not 5, it is counted exactly once.
If a number is divisible by 3 and 5 but not 2, it is counted exactly once.
If a number is divisible by 2 and 5 but not 3, it is counted exactly once.
But what if a number is divisible by 2, 3, and 5? We add it thrice, and only
subtract it once! Thus it is double counted. To correct for this, we need to
subtract the count of numbers which are divisible by all 3 numbers twice, not
just once.
So our real answer is
Make sure you understand why!
There is no easy definitive way to know exactly how many times you are
over/undercounting something if you are looking for the number of elements
part of two or more sets. To solve a problem like this, you just have to think
carefully about how much you are over/undercounting each group of elements,
and ensure that in the end you only count each group that you want exactly
once.
Arjun Vikram & Aneesh Sharma, April 2019
5 - Advanced PIE
6.6: OPTIMIZATION USING PIE
Optimization is something you learned about in calculus - finding the minimum
or maximum of something. But optimization is not only done with calculus and
derivatives, optimization problems show up in lots of different aspects of the
AMC, from combinatorics to geometry, and almost none of them work with
calculus.
One type of optimization problem you may see involves PIE: finding the maximum
or minimum number of people that satisfy a condition in a situation that very
much resembles PIE.
The idea behind solving these is to figure out an extreme situation which
maximizes/minimizes the desired number, and work from there.
At the Winter Sochi Olympics Press Conference, there are 200 foreign
journalists. Out of them,
175 people can speak German,
150 people can speak French,
180 people can speak English,
160 people can speak Japanese.
What is the minimum number of foreigners that can speak all the four
languages?
In order to try to minimize the number of foreigners that can speak all
languages, we want to try to maximize the number of people who don’t speak at
least one language. To do so, we want to make the groups of people who don’t
speak each language mutually exclusive.
Thus, there are 25 people who don’t speak German, 50 who don’t speak French,
20 who don’t speak English, and 40 who don’t speak Japanese. Now this means
that there are people who speak all 4 languages.
Arjun Vikram & Aneesh Sharma, April 2019
6 - Advanced PIE
CHALLENGE PROBLEMS:
1. My school now offers 3 new foreign languages: Arabic, Japanese, and
Russian. There are 50 students enrolled in at least one of the classes.
Suppose that 18 are taking both Arabic and Japanese. 15 are taking both Arabic
and Russian, 13 are taking both Japanese and Russian, and 7 are taking all
three languages. How many students are taking at least two languages?
2. What is the sum of all integers from 1 to 100 that are multiples of 2 or 3?
3. Is it possible that among a group of 20 9th graders, 15 play lacrosse, 12
play soccer, and 6 play both? Why or why not?
Arjun Vikram & Aneesh Sharma, April 2019
7 - Advanced PIE
4. Dogs in the GoodDog obedience school earn a blue ribbon for learning how to
sit, a green ribbon for learning how to roll over, and a white ribbon for
learning how to stay. There are 100 dogs in the school. Suppose:
- 73 have blue ribbons, 39 have green ribbons, and 62 have white ribbons.
- 21 have a blue and green ribbon, 28 have a green and white ribbon, and
41 have a blue and white ribbon.
- 14 have all three ribbons.
How many dogs have no ribbons?
5. Five standard 6-sided dice are rolled. What is the probability that at
least 3 of them show a 6?
6. Sam can only remember 10-digit numbers if the first four digits are either
exactly the same as the next four digits or the last four digits of the number
(or both). For example, Sam can remember 1234123456 and 3444533444 but not
3344443334. How many 10-digit numbers can Sam remember?
Arjun Vikram & Aneesh Sharma, April 2019
8 - Advanced PIE
7. 7 people are having a water-balloon fight. At the same time, each of the 7
people throws a water balloon at one of the other 6 people, chosen at random.
What is the probability that there are 2 people who throw balloons at each
other?
8. Prove that you can use PIE for probability using the properties of
probability you have learned.
HINT: Use both combinatorial and constructive probability in your proof.
Arjun Vikram & Aneesh Sharma, April 2019
9 - Advanced PIE
Answers (DO NOT PEEK!):
1. 32
2. 3417
3. No
4. 2
5.
6.
7.
Arjun Vikram & Aneesh Sharma, April 2019