The pigeonhole principle
Let us start with a simple example that motives the main result of the section.
A man enters an elevator with six other people. As he reaches to press the button to select his floor, he notices that seven buttons are already lit up. This doesn’t add up, he thinks. If every person on the elevator selected one floor, there should be at most (possibly less, as different people could want to go to the same floor) six buttons selected. One of you pressed more than one button! He exclaims annoyed.
Exercise.
Suppose that people attend an event and some or all purchase tickets for a raffle. If tickets for different prizes were sold, prove that someone must get at least two prizes.
Solution.
Suppose otherwise, that is, that everyone gets at most one prize. Since there are people, that means that at most prizes are distributed. But this is false, as there are prizes.
The following important fact can be formalized using the language of injective functions.
Pigeonhole principle.
If there are pigeons to be distributed among fewer than pigeonholes, then at least one pigeonhole will have at least two pigeons.
Imagine that people are standing in line to get the COVID vaccine. The line has spots. Since it’s the middle of the pandemic, the people are asked to leave one free space between every two people standing in line to ensure a safe distance. Show that this is impossible.
In a perhaps more mathematical language:
Exercise.
Consider the set of all integers satisfying (so, has elements). Prove that every subset of of size more than must contain two numbers that are consecutive. In symbols, there exists such that .
Solution.
Consider the sets (the pigeonholes) for . These are pairwise disjoint and there are of them. If (the pigeons) is a set of more than elements from , then one of the above sets must contain two elements of , say and . This pair of integers has the desired property.
Exercise.
Prove the following versions of the pigeonhole principle.
If are real numbers such that , then there is at least one value of such that .
If are integers, and is a real number such that , then there is at least one value of such that .
Solution.
By contrapositive, if for all , then .
If, in addition, each is an integer, then rounding up each side of the inequality yields the second result.
Exercise.
Color each point of the grid in one of three colors. Prove that some rectangle has all four vertices of the same color. Moreover, argue that this rectangle can always be found within a fixed compact region of the plane.
Reflect.
Can you do this for more than three colors?
Solution.
Call the coloring and consider the rectangle .
For every, , call . There are rows in and each row can be colored in ways, so by the pigeonhole principle, the coloring function given by is not injective. That is, two rows and have the same coloring.
Once again, by the pigeonhole principle and since each , the function is not injective. So, there are two points in the same row, and , that are the same colour. It is clear that all four points formed by must then be the same colour, and so we are done.
Exercise.
Let be a positive integer and be a subset of size of the set .
- Prove that there exist distinct such that divides .
- Show, with an example, that the conclusion is false if has size instead.
Exercise.
A bridge club has members. Every day, four members of the club get together and play one game of bridge. Prove that after two years, there is some particular set of four members that has played at least four games of bridge.
Solution.
There are ways of picking four members of the club. If at most three of these choices repeat in the days, then there were at most matches, which is impossible if they play every day. Hence, some choice of four players repeated at least four times.
Generalized pigeonhole principles
Exercise.
Show that if more than elements are put into sets, some set contains elements.
Exercise.
Among any 200 positive integers, there are 29 of them that are pairwise congruent mod 7.
Exercise.
Show that if are positive integers and more than pigeons are put in pigeonhole, for some , the th pigeonhole contains at least pigeons.
Exercise.
Prove this generalized pigeonhole principle:
If you put pigeons into pigeonholes, one hole has pigeons.
Exercise.
Every point on the plane is colored red or blue. Prove that there are always two points exactly one unit apart that have the same color.
Exercise.
Any five points placed inside a unit square contain a pair of points at distance at most .
Exercise.
Any subset of of size at least contains two relative primes.
Exercise.
Among any positive integers, two of them have a distance divisible by .
Hard exercise (special case of the Erdős–Szekeres theorem).
Prove that any sequence of different naturals contains a monotonic subsequence of length .
For every , construct a sequence of naturals containing no monotonic subsequence of length .
Hard exercise (IMO 1972).
From a set of ten two-digit decimal numbers, two disjoint subsets have the same sum.