Folioby Interconnected
Log InSign Up

The pigeonhole principle: a surprisingly powerful tool for existence proofs

If you place more pigeons than there are holes, some hole must contain at least two pigeons. This triviality is the starting point for the Erdos--Szekeres theorem on monotone subsequences and for Ramsey theory, illustrating the remarkable reach of non-constructive existence arguments.

FO
Folio Official
March 1, 2026

Proving that something exists is often harder – or easier – than producing an explicit example. The pigeonhole principle provides existence proofs of a distinctive kind: it guarantees that a certain configuration must occur without identifying which one. The principle itself is almost embarrassingly simple, yet its consequences reach deep into combinatorics.

1 The basic form

Theorem 1 (Pigeonhole principle).
If n+1 or more pigeons are placed into n holes, then at least one hole contains two or more pigeons.
Proof.
By contraposition. If every hole contained at most one pigeon, the total number of pigeons would be at most n, contradicting the assumption that there are at least n+1. □
Remark 2.
In mathematical language: if ∣A∣>∣B∣, then no function f:A→B can be injective. No matter how cleverly you assign pigeons to holes, a collision is unavoidable.

2 The generalized form

Theorem 3 (Generalized pigeonhole principle).
If n objects are distributed among k boxes, then at least one box contains ⌈n/k⌉ or more objects.
Proof.
If every box contained fewer than ⌈n/k⌉ objects, the total would be at most k(⌈n/k⌉−1)<k⋅(n/k)=n, a contradiction. □

3 Simple but non-trivial applications

Example 4 (The birthday preamble).
In any group of 367 people, at least two share a birthday (accounting for leap years, there are at most 366 possible birthdays). The pigeonhole principle guarantees the existence of such a pair, even though it does not identify who they are.
Example 5 (Divisibility among chosen numbers).
Choose n+1 numbers from {1,2,…,2n}. Then among the chosen numbers there must exist a pair in which one divides the other.

Write each integer m as m=2aq where q is odd. The odd part q takes values in {1,3,5,…,2n−1}, a set of size n. Since we have chosen n+1 numbers, the pigeonhole principle guarantees two of them – say 2aq and 2bq with a<b– share the same odd part q. Then 2aq∣2bq.

4 The Erdos–Szekeres theorem

A beautiful and deeper application of the pigeonhole principle concerns monotone subsequences.

Theorem 6 (Erdos–Szekeres theorem).
Every sequence of length at least rs+1 contains either an increasing subsequence of length r+1 or a decreasing subsequence of length s+1.
Proof.
Let the sequence be a1​,a2​,…,ars+1​. For each ai​, let ℓi​ denote the length of the longest increasing subsequence starting at ai​.

If ℓi​≥r+1 for some i, the theorem holds immediately.

Otherwise ℓi​∈{1,2,…,r} for all i. Since rs+1 values are drawn from r possible values, the generalized pigeonhole principle guarantees at least s+1 indices i1​<i2​<⋯<is+1​ with ℓi1​​=ℓi2​​=⋯=ℓis+1​​.

Now suppose aij​​≤aij+1​​ for some j. Then the longest increasing subsequence starting at aij​​ could be extended by prepending aij​​ to one starting at aij+1​​, giving ℓij​​>ℓij+1​​– contradicting ℓij​​=ℓij+1​​. Therefore ai1​​>ai2​​>⋯>ais+1​​, producing a decreasing subsequence of length s+1. □
Remark 7.
Setting r=s=n yields a particularly elegant corollary: every sequence of length n2+1 contains a monotone subsequence of length n+1. This result provides the theoretical underpinning for longest increasing subsequence (LIS) problems that frequently appear in competitive programming.

5 An introduction to Ramsey theory

Pushing the pigeonhole principle further leads to Ramsey theory.

Theorem 8 (The Ramsey number R(3,3)=6).
Among any six people, no matter how "friend" and "stranger" relationships are assigned, there must exist either three mutual friends or three mutual strangers.
Proof.
Pick one person A. Of the five remaining people, A is either a friend or a stranger to each. By the pigeonhole principle, at least three of them share the same relationship to A.

Suppose A is friends with B, C, D. Now examine the relationships among B, C, D:
  • If any two of B, C, D are friends, those two together with A form a trio of mutual friends.

  • If B, C, D are all strangers to one another, they form a trio of mutual strangers.

In either case the conclusion holds. (The argument when A has three strangers is symmetric.) □
Remark 9.
To establish R(3,3)=6, one must also show that five people do not suffice – that is, one must construct a counterexample. Place five people at the vertices of a regular pentagon; declare adjacent vertices friends and non-adjacent vertices strangers. One can verify that no monochromatic triangle exists.

6 Existence proofs versus constructive proofs

Remark 10.
A distinguishing feature of the pigeonhole principle is its non-constructive character. It asserts "at least one hole contains two or more pigeons" but does not say which hole. This non-constructivity pervades Ramsey theory: existence is guaranteed, but a recipe for finding the guaranteed object is not provided.

From a constructivist standpoint, this may seem unsatisfying. Yet the mere guarantee of existence is often powerful information – it can settle conjectures, establish lower bounds, and rule out impossible configurations even when no explicit witness is at hand.

7 Takeaway

  • The pigeonhole principle states that placing n+1 objects into n boxes forces at least one box to contain two or more objects.

  • The generalized form – at least ⌈n/k⌉ objects in some box – is equally useful.

  • The Erdos–Szekeres theorem on monotone subsequences is a striking application.

  • Ramsey theory is the ultimate extension: R(3,3)=6 is the gateway.

  • The pigeonhole principle exemplifies non-constructive existence proofs.

In the next article, we discover how symmetry can dramatically simplify counting problems, via Burnside's lemma and Polya's enumeration theorem.

CombinatoricsMathematicsBetween the Lines
FO
Folio Official

Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.

1 followers·107 articles
Combinatorics — Between the LinesPart 6 of 8
Previous
Why the Catalan numbers appear everywhere: parenthesizations, binary trees, and lattice paths
Next
Counting under symmetry: Burnside's lemma and Polya's enumeration theorem

Share your expertise with the world

Write articles with LaTeX support, build your audience, and earn from your knowledge.

Start Writing — It's Free

More from Folio Official

Folio Official·March 1, 2026

Recurrences and generating functions: what happens when you turn a sequence into a function

A generating function is the "business card" of a sequence. Multiplication becomes convolution, and recurrences become algebraic equations. We derive the closed form for the Fibonacci numbers (Binet's formula) as a showcase of the method.

CombinatoricsMathematicsBetween the Lines
Folio Official·March 1, 2026

Combinatorics meets dynamic programming: when counting becomes computation

Dynamic programming is bottom-up evaluation of a recurrence; a generating function is its analytic closed form. We draw the correspondence between the knapsack DP and generating function multiplication, discuss convolution and FFT, and survey the connections across the entire series.

CombinatoricsMathematicsBetween the Lines
Folio Official·March 1, 2026

Inclusion--exclusion: why the alternating signs work

The inclusion--exclusion principle corrects for overcounting by alternately adding and subtracting intersection sizes. We prove the general formula using indicator functions, apply it to count derangements, and trace the thread forward to the Mobius inversion formula on partially ordered sets.

CombinatoricsMathematicsBetween the Lines
Folio Official·March 1, 2026

Counting under symmetry: Burnside's lemma and Polya's enumeration theorem

When objects related by rotation or reflection are considered identical -- as with necklaces -- naive counting fails. Using the language of group actions, Burnside's lemma reduces the problem to a clean formula: the number of distinct objects equals the average number of fixed points across the group.

CombinatoricsMathematicsBetween the Lines