Counting
The Pigeonhole Principle
R. Inkulu
http://www.iitg.ac.in/rinkulu/
(The Pigeonhole Principle)
1/8
The Pigeonhole Principle1
If k is a positive integer and k + 1 or more balls are placed into k bins, then
there is at least one bin containing two or more of the balls.
1
a.k.a. Dirichlet drawer principle
(The Pigeonhole Principle)
2/8
The Generalized Pigeonhole Principle
If n balls are placed into k bins then there is at least one bin containing at least
d nk e balls.
k(d nk e − 1) < n(( nk + 1) − 1) = n
(The Pigeonhole Principle)
3/8
The Generalized Pigeonhole Principle
If n balls are placed into k bins then there is at least one bin containing at least
d nk e balls.
k(d nk e − 1) < n(( nk + 1) − 1) = n
Corollary: The minimum number of balls such that at least r of these balls
must be in one of k bins when these balls are distributed among the bins is
k(r − 1) + 1.
smallest n satisfying d nk e ≥ r
(The Pigeonhole Principle)
3/8
Few applications
• A function f from a set A with k + 1 or more elements to a set B with k
elements is not one-to-one.
visualize each element of the codomain of f as a bin and each element of A as a ball
(The Pigeonhole Principle)
4/8
Few applications
• A function f from a set A with k + 1 or more elements to a set B with k
elements is not one-to-one.
visualize each element of the codomain of f as a bin and each element of A as a ball
• For every integer n, there is a multiple of n that has only 0s and 1s in its
decimal expansion.
consider the n + 1 decimal numbers of the form 1, 11, . . . , 11 . . . 1 (the last number contains
(n + 1) ones)
(The Pigeonhole Principle)
4/8
More applications
• Suppose during a month with 30 days, a baseball team plays at least one
game a day, but no more than 45 games. Then there must exist a period
of some number of consecutive days during which the team must play
exactly 14 games.
consider the 60 positive integers ∀i ai , ai + 14, where ai denotes the number of games played
on or before the ith day
(The Pigeonhole Principle)
5/8
More applications
• Suppose during a month with 30 days, a baseball team plays at least one
game a day, but no more than 45 games. Then there must exist a period
of some number of consecutive days during which the team must play
exactly 14 games.
consider the 60 positive integers ∀i ai , ai + 14, where ai denotes the number of games played
on or before the ith day
• Suppose we are given n integers a1 , . . . , an+1 , which need not be distinct.
Then there is always a set of consecutive numbers ak+1 , ak+2 , . . . , al
P
whose sum li=k+1 ai is a multiple of n.
consider the sequence of running sums
(The Pigeonhole Principle)
Pj
i=1 ai
modulo n for each aj
5/8
Few more applications
• Consider the numbers 1, 2, . . . , 2n, and take any n + 1 of them. Then
there are two among these n + 1 numbers which are relatively prime.
there are always two numbers which are only 1 apart
(The Pigeonhole Principle)
6/8
Few more applications
• Consider the numbers 1, 2, . . . , 2n, and take any n + 1 of them. Then
there are two among these n + 1 numbers which are relatively prime.
there are always two numbers which are only 1 apart
• Let A ⊂ {1, 2, . . . , 2n} with |A| = n + 1. Then there are always two
numbers in A such that one divides the other.
write every number aj ∈ A in the form aj = 2kj qj , where kj is a nonnegative integer and qj is
an odd integer in [1, 2n − 1]; and two of q1 , q2 , . . . , qn+1 must be equal
(The Pigeonhole Principle)
6/8
Erdos-Szekeres’ theorem
In any sequence a1 , a2 , . . . , an2 +1 of distinct real numbers, there exists
an increasing subsequence2 ai1 < ai2 < . . . < ain+1
(i1 < i2 < . . . < in+1 ) of length n + 1, or
a decreasing subsequence aj1 > aj2 > . . . > ajn+1 (j1 < j2 < . . . < jn+1 )
of length n + 1, or
both.
associate to each number ai , the length of the longest increasing as well as the longest decreasing
subsequence starting at ai
2
subsequence is a sequence obtained from the original sequence by including some of the
terms of the original sequence in their original order
(The Pigeonhole Principle)
7/8
Ramsey numbers
The Ramsey number, denoted with R(m, n), where m and n are positive
integers greater than or equal to 2, denotes the minimum number of people at
a party such that there are either m mutual friends or n mutual enemies,
assuming that every pair of people at the party are friends or enemies.3
3
the exact values of only nine Ramsey numbers known to date; only bounds are known for
many others
(The Pigeonhole Principle)
8/8
Ramsey numbers
The Ramsey number, denoted with R(m, n), where m and n are positive
integers greater than or equal to 2, denotes the minimum number of people at
a party such that there are either m mutual friends or n mutual enemies,
assuming that every pair of people at the party are friends or enemies.3
• R(3, 3) = 6
R(3, 3) ≤ 6: for any one A of these six, there are either three (= d 25 e) or more who are
friends of A, or three or more who are enemies of A
R(3, 3) 6≤ 5: associate F to outer edges of K5 and rest E
3
the exact values of only nine Ramsey numbers known to date; only bounds are known for
many others
(The Pigeonhole Principle)
8/8
Ramsey numbers
The Ramsey number, denoted with R(m, n), where m and n are positive
integers greater than or equal to 2, denotes the minimum number of people at
a party such that there are either m mutual friends or n mutual enemies,
assuming that every pair of people at the party are friends or enemies.3
• R(3, 3) = 6
R(3, 3) ≤ 6: for any one A of these six, there are either three (= d 25 e) or more who are
friends of A, or three or more who are enemies of A
R(3, 3) 6≤ 5: associate F to outer edges of K5 and rest E
• R(2, n) = n for every n ≥ 2
R(2, n) ≤ n: 2 are friends or all are mutual enemies
R(2, n) 6≤ n − 1: all are mutual enemies
3
the exact values of only nine Ramsey numbers known to date; only bounds are known for
many others
(The Pigeonhole Principle)
8/8
© Copyright 2026 Paperzz