CS2050 L21 Pigeonhole Principle
Overview
Abrahim Ladha develops the pigeonhole principle as a precise existence proof: when more objects are assigned to fewer categories, some category must contain multiple objects, though the theorem may not identify which ones. He applies it to lossless compression, number theory, modular prefix sums, increasing and decreasing subsequences, and geometric distance, emphasizing how to construct the objects and categories for each proof.
Key takeaways
- The pigeonhole principle proves existence across every possible assignment, but by itself it usually does not construct or identify the guaranteed object.
- A lossless compressor cannot shrink every length-n binary file: 2ⁿ inputs cannot injectively fit into the 2ⁿ − 1 shorter binary strings.
- Partitioning {1, …, 2n} into consecutive pairs proves that every subset of size n + 1 contains consecutive, and therefore relatively prime, numbers.
- Representing each number by its power-of-two factor and odd part shows that n + 1 numbers drawn from {1, …, 2n} include a pair where one divides the other.
- For any n integers, n prefix sums distributed among n − 1 nonzero residues either include zero or collide, yielding a contiguous subarray with sum divisible by n.
- For distinct reals, longest increasing and decreasing subsequence scores create distinct grid points; exceeding the rs positions in the short-subsequence region forces one monotone subsequence to be long.
Chapters
- With 10 pigeons and 9 holes, every assignment puts at least 2 pigeons in some hole.
- The result holds for every assignment, not just random or worst-case placements.
- The principle guarantees existence but generally does not identify the specific pigeon or hole.
- Treat the 27 words in a sentence as pigeons and the 26 letters of the alphabet as holes.
- At least 2 words must begin with the same letter, regardless of the sentence's meaning or word order.
- The example illustrates that a proof often requires constructing the objects and categories rather than receiving them in the problem statement.
- A lossless compression function must be injective so that each compressed file decodes to its unique original.
- A perfect compressor would map every length-n file to a shorter file, but there are only 2ⁿ − 1 binary strings of lengths 0 through n − 1.
- The example frames compression as a finite counting problem, rather than relying on how common file formats behave in practice.
- There are 2ⁿ binary files of length n, but only 1 + 2 + 4 + … + 2ⁿ⁻¹ = 2ⁿ − 1 possible shorter outputs.
- Injectivity prevents two distinct original files from sharing one compressed output, so not every length-n file can map to a shorter string.
- Ladha distinguishes this mathematical limit from practical compression: patterned files can shrink, while many arbitrary strings cannot.
- For finite sets A and B, if |A| > |B|, any function from A to B is not injective.
- Non-injectivity means two distinct inputs map to the same output, directly expressing the pigeonhole collision.
- The function model ensures every pigeon is assigned to exactly one hole, with none omitted or assigned to multiple holes.
- For a subset S of {1, 2, …, 2n} with n + 1 elements, group the numbers into n pairs: (1,2), (3,4), and so on.
- Two selected numbers must lie in one pair, so they are consecutive integers k and k + 1.
- Since gcd(k, k + 1) = gcd(k, 1) = 1, S contains a relatively prime pair.
- Write each selected number as 2ᵉⁱ times an odd part Oᵢ.
- Among n + 1 numbers from {1, …, 2n}, the odd parts have at most n possible values, the odd integers through 2n − 1.
- Two numbers share an odd part; their powers of 2 are ordered by size, so the smaller number divides the larger.
- For any n integers, define prefix sums Sᵢ = X₁ + … + Xᵢ for i from 1 to n.
- If any Sᵢ is 0 modulo n, the first i terms already form a qualifying contiguous subarray.
- Otherwise, n prefix sums occupy only n − 1 nonzero residue classes, so two are equal modulo n; subtracting them gives a nonempty contiguous subarray whose sum is divisible by n.
- For distinct real numbers, the target is an increasing subsequence of length at least r + 1 or a decreasing one of length at least s + 1.
- The proof assigns each sequence element two scores: the longest increasing subsequence ending there and the longest decreasing subsequence beginning there.
- The construction turns a statement about sequence structure into a count of distinct score pairs.
- If element i precedes j and aᵢ < aⱼ, the increasing score at j exceeds the score at i; if aᵢ > aⱼ, the decreasing score at i exceeds the score at j.
- Therefore, each of the n elements receives a distinct score pair on an integer grid.
- Avoiding both target subsequence lengths confines scores to an r-by-s region with only rs positions; more than rs elements force a score outside it and hence a long increasing or decreasing subsequence.
- Partition the 2-by-2 square into four 1-by-1 squares and treat the five points as pigeons.
- Two points must share one small square.
- The greatest possible distance within a 1-by-1 square is its diagonal, √2, so the pair is at most √2 apart.
- For any distance d > 0, place an equilateral triangle of side length d anywhere in the plane.
- Its three vertices are colored with only red and blue, so at least two vertices share a color.
- Those same-colored vertices are exactly d apart, proving the claim for every two-coloring of the plane.
Transcript excerpt
0:12 All right. Let's get started. This is CS 3510 and the topic of today is the pigeonhole principle. Oh, wrong class. Sorry. Thank you. I'm a little behind. I'm probably going to make some more mistakes today. Let's see. Um the pigeonhole principle is an incredibly basic, really simple statement that I see misused constantly. Even in papers I see misused. It says a very precise thing and it's a very powerful theorem. It's kind of like a summoning smell spell. It like can will into existence an object with certain properties, but you don't know anything about the object other than that exists that it exists. So it's kind of useless in that sense in that you can't really know anything about this object constructively, but
1:00 you do know that it exists and sometimes that's all you need to prove. So it's a nonconstructive technique to show something exists without actually finding it. It falls from a very basic thing which is just kind of like having too much of something. So if you have n pigeons, k holes uh and n exceeds k, some hole has greater than or equal greater than one uh or greater than equal to two pigeons. Um we'll prove the generalized form another time, but uh just suppose you have nine holes. It's kind of outdated terminology because I guess pigeonholes were more
1:46 common. Suppose you have nine holes and you have 10 pigeons, right? >> If you've nine pigeons and nine holes, well, you could put a pigeon in each hole, but if you have 10 pigeons and nine holes, this 10th pigeon must be placed into some hole. And therefore, there will exist a hole with more than two pigeons in it. That's all the pigeon hole says is some pigeon
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Abrahim Ladha.