Pigeonhole Principle, Inclusion-Exclusion
So, the pigeonhole principle. All that it says is this:
If there are more pigeons than pigeonholes, that means some holes must have more than
pigeons.
It is a mapping rule: if there is a total injection from
That means, if
If we have
For example, let's say we have 7 pigeons and 6 pigeonholes. Dividing
Another example: ignoring leap years and assuming that one year has 365 days, the minimum number of people there has to be for at least 2 of them being born on the same day is 366.
Why is that? Well, imagine 365 people, there is a chance that each of them was born on different days. In order to make sure that at least 2 of them were born on the same day, there must be
Let's look at another example from the practice section of the course.
At a certain school, there are 11 different classes offered to first-year students, and each student must enroll in exactly 4 of them. How many students must be in one class year to guarantee that at least 2 students will have the same schedule?
This is firstly an n choose k problem,
So, what we need to do is this:
We have 331 as the answer, so, there must be 331 students in one class year to guarantee that at least 2 students have the same schedule.
Let's take a look at the Principle of Inclusion-Exclusion.
We looked at the sum rule before, remember it says that if there are two disjoint sets, the size of their sum is the sum of the size of the first set and the size of the other set:
But, what if they are not disjoint? Like this:
Then, we would simply have to subtract the intersection from the above equation, and this is the principle of inclusion-exclusion:
The reason is that when we count
Another way to look at it is that when
So, by the sum rule,
From the picture, it looks like
We can break the set
Therefore, by the sum rule:
With a little arrangement, we see that
which was our starting point.
Plugging this definition of
Therefore, it proves our lemma, and the Principle of Inclusion-Exclusion.
What if we have three sets?
In that case, we would still subtract the intersections, but if we do, there will still be a small section where all the sets intersect that we need to add back in:
This picture taken from the slides of the lecture helps visualize it:
One thing to realize is that intersections with odd number of sets occur positively, and those with even numbers occur negatively. For example,
So, we have
We can express it as the sum of the sizes of the intersections, the sizes of the intersection
We need to specify the sign of that particular size of intersection, if it is odd, we want to add it with a positive sign; if it's even, we add it negatively. We can use
To write it down precisely: