Chapter

Pigeonhole Principle I

The module develops the simple and strengthened pigeonhole principle: residues, pairs, intervals, geometric partitions, partial sums, subset sums, and first Ramsey/Erdos-Szekeres ideas.
Log in to track solved progress and bookmarks.

Theory

Key Idea

The pigeonhole principle says: if there are more objects than boxes, then some box contains at least two objects. The strengthened form says: if \(N\) objects are distributed among \(k\) boxes, some box contains at least \(\lceil N/k ceil\) objects.

The olympiad part is choosing the right “boxes”. They may be months, residues, sums, intervals, colors, odd parts of numbers, small regions in a geometric partition, or pairs of parameters.

Basic Facts

  • If \(k+1\) objects lie in \(k\) boxes, two objects lie in the same box.
  • If \(N\) objects lie in \(k\) boxes, some box contains at least \(\lceil N/k ceil\) objects.
  • Residues modulo \(n\) give \(n\) boxes.
  • For problems where a sum must be divisible by \(n\), partial sums are often useful.
  • In geometry, the boxes are often small regions into which a large figure is partitioned.

When to Use This Method

  • You need to prove that among many objects, two share a property.
  • There are residues, months, colors, intervals, parity classes, or other finite categories.
  • You need to prove existence of a pair with small distance or a special sum.
  • The statement says “for every choice of sufficiently many objects”.

How to Recognise the Method

Ask: which property can take only a small number of values? If there are more objects than possible values, two objects share that value. For divisibility, boxes are often residues. For closeness, boxes are intervals or small cells.

If subset sums appear, consider partial sums or all subset sums and compare the number of sums with the number of possible values.

Typical Mistakes

  • Choosing boxes without proving there are fewer boxes than objects.
  • Finding two objects in the same box but not explaining why this gives the required property.
  • Forgetting residue \(0\) in modular problems.
  • In geometric problems, using regions with diameter too large.
  • In subset-sum problems, forgetting to remove common elements from two equal-sum subsets.

Mini-Checklist

  • What are the objects?
  • What are the boxes?
  • How many objects and how many boxes are there?
  • What does it mean for two objects to be in the same box?
  • Do we need the simple or strengthened form?
  • If sums are used, can equal sums be turned into nonempty disjoint sets?

Examples

Example 1. Birth Months

The simplest box model.

Problem. Prove that among \(13\) people, two were born in the same month.

Solution.

The boxes are the \(12\) months. The objects are the \(13\) people. Since there are more objects than boxes, some month contains at least two people.

Comment. It is important to name the boxes explicitly.

Example 2. Residues

Residues modulo a number give ready-made boxes.

Problem. Prove that among any \(n+1\) integers, two have the same residue modulo \(n\).

Solution.

There are \(n\) possible residues: \(0,1,\ldots,n-1\). There are \(n+1\) numbers, so two fall into the same residue class.

Comment. Their difference is divisible by \(n\).

Example 3. Strengthened Principle

Sometimes we need many objects in one box, not just two.

Problem. A box contains \(25\) balls of three colors. Prove that some color occurs at least \(9\) times.

Solution.

If every color occurred at most \(8\) times, there would be at most \(3\cdot8=24\) balls, contradiction. Hence some color occurs at least \(9\) times.

Comment. This is the form \(\lceil25/3 ceil=9\).

Example 4. Sum \(11\)

Boxes can be pairs of numbers.

Problem. From the numbers \(1,2,\ldots,10\), \(6\) are chosen. Prove that two chosen numbers have sum \(11\).

Solution.

Split the numbers into pairs \((1,10),(2,9),(3,8),(4,7),(5,6)\). There are \(5\) pair-boxes and \(6\) chosen numbers. One pair contains both chosen numbers, whose sum is \(11\).

Comment. These boxes are specially designed, not residues.

Example 5. One Number Divides Another

The boxes are odd parts of numbers.

Problem. Prove that among any \(10\) numbers from \(1,\ldots,18\), two are such that one divides the other.

Solution.

Write each number as \(2^k m\), where \(m\) is odd. The possible odd parts in \(1,\ldots,18\) are \(1,3,5,7,9,11,13,15,17\), only \(9\) boxes. Among \(10\) numbers, two have the same odd part. They differ only by a power of \(2\), so the smaller divides the larger.

Comment. This is an important non-obvious choice of boxes.

Example 6. Geometric Box

Partitioning a figure controls distance.

Problem. In a square of side \(2\), \(5\) points are chosen. Prove that two of them are at distance at most \(\sqrt{2}\).

Solution.

Divide the square into \(4\) unit squares. By the pigeonhole principle, two points lie in one small square. The diagonal of a unit square is \(\sqrt{2}\), so the distance between these two points is at most \(\sqrt{2}\).

Comment. The diameter of each box must not exceed the required distance.

Example 7. Partial Sums

A consecutive block sum appears from equal residues.

Problem. Prove that among \(n\) integers, there is a nonempty consecutive block whose sum is divisible by \(n\).

Solution.

Consider partial sums \(s_1,\ldots,s_n\). If one is divisible by \(n\), we are done. Otherwise the \(n\) sums have only \(n-1\) nonzero residues, so two have the same residue. Their difference is the sum of a consecutive block and is divisible by \(n\).

Comment. This is one of the main templates of the module.

Example 8. Monotone Subsequence

A sophisticated box can be a pair of numbers.

Problem. Prove that among \(10\) distinct numbers, there is an increasing subsequence of length \(4\) or a decreasing subsequence of length \(4\).

Solution.

For each number, record the pair \((a,b)\): the length of the longest increasing subsequence starting there and the length of the longest decreasing subsequence starting there. If neither type has length \(4\), then \(a,b\in\{1,2,3\}\), only \(9\) pairs. But there are \(10\) numbers. Two positions would have the same pair; for the earlier and later position this is impossible, because if the earlier number is smaller, its increasing length is larger, and if it is larger, its decreasing length is larger.

Comment. This is a strong example of the pigeonhole principle.

Problems

Problems

#5.1
#5.1

Thirteen People

Pigeonhole principle Grade 7 Grade 8 ★☆☆☆☆

Prove that among \(13\) people, two were born in the same month.

Details
Problem: COM-B1-M05-P001
Difficulty: Level 1 of 5
Tag: Pigeonhole principle
Grade: Grade 7, Grade 8
#5.2
#5.2

Same Last Digit

Remainders Grade 7 Grade 8 ★☆☆☆☆

Prove that among any \(11\) integers, two have the same last digit.

Details
Problem: COM-B1-M05-P002
Difficulty: Level 1 of 5
Tag: Remainders
Grade: Grade 7, Grade 8
#5.3
#5.3

Socks of Two Colors

Strengthened Pigeonhole Grade 7 Grade 8 ★☆☆☆☆

A drawer contains socks of two colors. Prove that among any \(5\) socks taken out, \(3\) have the same color.

Details
Problem: COM-B1-M05-P003
Difficulty: Level 1 of 5
Tag: Strengthened Pigeonhole
Grade: Grade 7, Grade 8
#5.4
#5.4

Residues Modulo \(n\)

Remainders Grade 7 Grade 8 ★☆☆☆☆

Prove that among any \(n+1\) integers, two have a difference divisible by \(n\).

Details
Problem: COM-B1-M05-P004
Difficulty: Level 1 of 5
Tag: Remainders
Grade: Grade 7, Grade 8
#5.5
#5.5

Sum \(11\)

Pairs Grade 7 Grade 8 ★☆☆☆☆

From \(1,\ldots,10\), \(6\) numbers are chosen. Prove that two chosen numbers have sum \(11\).

Details
Problem: COM-B1-M05-P005
Difficulty: Level 1 of 5
Tag: Pairs
Grade: Grade 7, Grade 8
#5.6
#5.6

Seventeen Numbers

Remainders Grade 8 Grade 9 ★★☆☆☆

Prove that among any \(17\) integers, three have the same residue modulo \(8\).

Details
Problem: COM-B1-M05-P006
Difficulty: Level 2 of 5
Tag: Remainders
Grade: Grade 8, Grade 9
#5.7
#5.7

Same Number of Acquaintances

Pigeonhole principle Grade 8 Grade 9 ★★☆☆☆

Prove that in any group of \(6\) people, two have the same number of acquaintances inside the group.

Details
Problem: COM-B1-M05-P007
Difficulty: Level 2 of 5
Tag: Pigeonhole principle
Grade: Grade 8, Grade 9
#5.8
#5.8

One Number Divides Another

Divisibility Grade 8 Grade 9 ★★☆☆☆

Prove that among any \(10\) numbers from \(1,\ldots,18\), two are such that one divides the other.

Details
Problem: COM-B1-M05-P008
Difficulty: Level 2 of 5
Tag: Divisibility
Grade: Grade 8, Grade 9
#5.9
#5.9

Difference Divisible by \(100\)

Remainders Grade 8 Grade 9 ★★☆☆☆

Prove that among any \(101\) integers, two have a difference divisible by \(100\).

Details
Problem: COM-B1-M05-P009
Difficulty: Level 2 of 5
Tag: Remainders
Grade: Grade 8, Grade 9
#5.10
#5.10

Sum \(21\)

Pairs Grade 8 Grade 9 ★★☆☆☆

From \(1,\ldots,20\), \(11\) numbers are chosen. Prove that two chosen numbers have sum \(21\).

Details
Problem: COM-B1-M05-P010
Difficulty: Level 2 of 5
Tag: Pairs
Grade: Grade 8, Grade 9
#5.11
#5.11

Five Points in a Square

Geometry Grade 8 Grade 9 ★★☆☆☆

In a square of side \(2\), \(5\) points are chosen. Prove that two are at distance at most \(\sqrt{2}\).

Details
Problem: COM-B1-M05-P011
Difficulty: Level 2 of 5
Tag: Geometry
Grade: Grade 8, Grade 9
#5.12
#5.12

Block with Sum Divisible by \(10\)

Subset Sum Grade 8 Grade 9 ★★☆☆☆

Prove that among any \(10\) integers, there is a nonempty consecutive block whose sum is divisible by \(10\).

Details
Problem: COM-B1-M05-P012
Difficulty: Level 2 of 5
Tag: Subset Sum
Grade: Grade 8, Grade 9
#5.13
#5.13

General Partial Sum Version

Subset Sum Grade 8 Grade 9 ★★★☆☆

Prove that among any \(n\) integers, there is a nonempty consecutive block whose sum is divisible by \(n\).

Details
Problem: COM-B1-M05-P013
Difficulty: Level 3 of 5
Tag: Subset Sum
Grade: Grade 8, Grade 9
#5.14
#5.14

Sum or Difference Divisible by \(10\)

Remainders Grade 8 Grade 9 ★★★☆☆

Prove that among any \(7\) integers, two have either sum or difference divisible by \(10\).

Details
Problem: COM-B1-M05-P014
Difficulty: Level 3 of 5
Tag: Remainders
Grade: Grade 8, Grade 9
#5.15
#5.15

Integer Midpoint

Parity Grade 8 Grade 9 ★★★☆☆

Five points with integer coordinates are chosen in the plane. Prove that the midpoint of some segment between two chosen points also has integer coordinates.

Details
Problem: COM-B1-M05-P015
Difficulty: Level 3 of 5
Tag: Parity
Grade: Grade 8, Grade 9
#5.16
#5.16

Six People

Friendship Grade 8 Grade 9 ★★★☆☆

Prove that among any \(6\) people, there are either three mutual acquaintances or three mutual strangers.

Details
Problem: COM-B1-M05-P016
Difficulty: Level 3 of 5
Tag: Friendship
Grade: Grade 8, Grade 9
#5.17
#5.17

Five Points in a Triangle

Geometry Grade 8 Grade 9 ★★★☆☆

In an equilateral triangle of side \(2\), \(5\) points are chosen. Prove that two are at distance at most \(1\).

Details
Problem: COM-B1-M05-P017
Difficulty: Level 3 of 5
Tag: Geometry
Grade: Grade 8, Grade 9
#5.18
#5.18

Two Consecutive Numbers

Intervals Grade 8 Grade 9 ★★★☆☆

From \(1,\ldots,100\), \(51\) numbers are chosen. Prove that two chosen numbers are consecutive.

Details
Problem: COM-B1-M05-P018
Difficulty: Level 3 of 5
Tag: Intervals
Grade: Grade 8, Grade 9
#5.19
#5.19

Difference Divisible by \(5\)

Remainders Grade 8 Grade 9 ★★★☆☆

Prove that among any \(6\) integers, two have a difference divisible by \(5\).

Details
Problem: COM-B1-M05-P019
Difficulty: Level 3 of 5
Tag: Remainders
Grade: Grade 8, Grade 9
#5.20
#5.20

Two Groups with Equal Sum

Pigeonhole principle Grade 8 Grade 9 ★★★☆☆

Prove that among \(10\) positive integers not exceeding \(100\), one can choose two different nonempty groups with the same sum.

Details
Problem: COM-B1-M05-P020
Difficulty: Level 3 of 5
Tag: Pigeonhole principle
Grade: Grade 8, Grade 9
#5.21
#5.21

Two Disjoint Groups

Subset Sum Grade 9 ★★★★☆

Prove that among any \(10\) positive integers not exceeding \(99\), one can choose two nonempty disjoint groups with the same sum.

Details
Problem: COM-B1-M05-P021
Difficulty: Level 4 of 5
Tag: Subset Sum
Grade: Grade 9
#5.22
#5.22

Five Around One Person

Friendship Grade 9 ★★★★☆

In a group of \(10\) people, prove that there is a person who has either \(5\) acquaintances or \(5\) strangers.

Details
Problem: COM-B1-M05-P022
Difficulty: Level 4 of 5
Tag: Friendship
Grade: Grade 9
#5.23
#5.23

Subset Sum Divisible by \(n\)

Remainders Grade 9 ★★★★☆

Prove that among any \(n\) integers, there is a nonempty subset whose sum is divisible by \(n\).

Details
Problem: COM-B1-M05-P023
Difficulty: Level 4 of 5
Tag: Remainders
Grade: Grade 9
#5.24
#5.24

Monotone Subsequence

Challenge Grade 9 ★★★★★

Prove that among any \(10\) distinct real numbers, there is an increasing subsequence of length \(4\) or a decreasing subsequence of length \(4\).

Details
Problem: COM-B1-M05-P024
Difficulty: Level 5 of 5
Tag: Challenge
Grade: Grade 9

Ladders

No published ladders were found.
Previous Chapter
Next Chapter