Skip to content
E
hscscience Maths Ext 1 · Y11
0/100daily goal
0
0
0 due
0
L1 · 0 XP
KJ
Your weak spots
Insights load after your first practice round.
Module 4 · L13 of 15 ~35 min ⚡ +95 XP available

The Pigeonhole Principle

A simple idea, a surprisingly deep tool. If you put more items into containers than there are containers, at least one container must hold more than one item. This almost-obvious fact is the engine behind elegant proofs in combinatorics, number theory, and computer science — and it appears regularly in HSC Extension 1 exams. In this lesson you'll learn how to identify the pigeons, name the pigeonholes, and construct airtight existence proofs.

Today's hook — In a room of 367 people, must at least two share a birthday? And in a drawer of mixed red and blue socks, how many must you pull out in the dark to guarantee a matching pair? Both questions are answered by the same elegant principle — and by the end of this lesson you'll solve them instantly, without listing a single case.
0/5QUESTS
01
Recall — your gut answer first
+5 XP warm-up

A drawer contains only red socks and blue socks. Without looking, what is the minimum number of socks you must pull out to guarantee a matching pair? Write your gut answer — and your reasoning — before reading on.

auto-saved
02
The core idea
+5 XP to read

There are two forms of the Pigeonhole Principle you need. Lock the basic form and the generalised form into memory — every exam question is one of these two.

Basic form: If $n$ items are placed into $m$ containers and $n > m$, then at least one container holds at least 2 items.

Generalised form: If $n$ items go into $m$ containers, then at least one container holds at least $\left\lceil \dfrac{n}{m} \right\rceil$ items, where $\lceil x \rceil$ denotes the ceiling (round-up) function.

BASIC n > m ≥2 in one GENERAL ⌈n/m⌉ in one Pigeons = items, Holes = containers
$$\text{At least one box has} \geq \left\lceil \frac{n}{m} \right\rceil \text{ items}$$
Identify what is "pigeon" and what is "hole"
The hardest part of a pigeonhole problem is recognising which are the items ($n$) and which are the containers ($m$). Name them explicitly before writing your proof.
Existence only, not identity
The principle proves that something must exist — it does not tell you which container is full or which items share a container.
Ceiling function — always round up
$\lceil 7/3 \rceil = \lceil 2.33\ldots \rceil = 3$. Even one extra item forces the ceiling. Use this when the general form applies.
03
What you'll master
Know

Key facts

  • Basic form: $n > m \Rightarrow$ at least one container has $\geq 2$ items
  • Generalised form: at least one container has $\geq \lceil n/m \rceil$ items
  • The principle proves existence — it does not identify which container is full
Understand

Concepts

  • Why $n > m$ is the trigger condition for the basic form
  • How to apply the ceiling function to the generalised form
  • The difference between "at least one" and "all" containers
Can do

Skills

  • Identify the pigeons and pigeonholes in a written problem
  • State and apply both forms of the principle
  • Solve "worst-case" guarantee problems (how many to draw?)
04
Key terms
Pigeonhole PrincipleIf $n$ items are placed into $m$ containers and $n > m$, at least one container holds more than one item.
Generalised formAt least one container must hold $\geq \lceil n/m \rceil$ items when $n$ items go into $m$ containers.
Ceiling function $\lceil x \rceil$The smallest integer $\geq x$. For example, $\lceil 2.1 \rceil = 3$ and $\lceil 4 \rceil = 4$.
Existence proofA proof that demonstrates something must exist without identifying the specific instance.
Worst-case analysisFinding the maximum number of items you can select without meeting a target, then adding one more to guarantee the target.
Pigeons / pigeonholesInformal names for the items being distributed ($n$) and the containers ($m$), respectively.
05
The basic principle and its proof
core concept

The Pigeonhole Principle (also called the Dirichlet Drawer Principle) can be stated simply:

$$\textbf{Basic form: } \text{If } n \text{ items are placed into } m \text{ containers and } n > m, \text{ at least one container has} \geq 2 \text{ items.}$$

Proof by contradiction: Suppose every container holds at most 1 item. Then the total number of items is at most $1 \times m = m$. But we have $n > m$ items — contradiction. Therefore at least one container must hold $\geq 2$ items. $\square$

The name comes from the image of $n$ pigeons returning to a row of $m$ nesting holes: if there are more pigeons than holes, at least one hole must contain at least 2 pigeons.

Real-world relevance. Hash tables in computer science rely on the pigeonhole principle: if a hash function maps $n$ keys to $m < n$ buckets, collisions are unavoidable. The principle also appears in network routing, data compression bounds, and the birthday paradox in cryptography.

Basic form: n items into m boxes, n > m at least one box contains 2 items; Proof sketch: If each box had 1 item, total items m < n — contradiction

Pause — copy the basic Pigeonhole statement and proof into your book: $n$ items into $m$ boxes with $n > m$ → at least one box has $\ge 2$ items; proof by contradiction: if every box had $\le 1$, total items $\le m < n$.

Quick check: Among any 13 people, the Pigeonhole Principle guarantees that at least two were born in the same month. Here, what are the "pigeonholes"?

06
The generalised form
core concept

We just saw the basic Pigeonhole Principle: $n$ items into $m$ boxes with $n > m$ guarantees at least one box contains $\ge 2$ items. That raises a question: when there are many more items than containers, can we guarantee more than 2 per box — and how many? This card answers it → the generalised form: at least one box contains $\lceil n/m \rceil$ items (ceiling division).

The basic form only guarantees 2 items in one box. The generalised form tells us the minimum guaranteed quantity when there are many more items than containers.

$$\textbf{Generalised form: } \text{If } n \text{ items go into } m \text{ containers, at least one container holds} \geq \left\lceil \frac{n}{m} \right\rceil \text{ items.}$$

Why the ceiling? Suppose all containers hold at most $\left\lceil \frac{n}{m} \right\rceil - 1$ items. Then the total is at most $m \times \left(\left\lceil \frac{n}{m} \right\rceil - 1\right) < m \times \frac{n}{m} = n$ — contradiction. So at least one container must hold $\geq \left\lceil \frac{n}{m} \right\rceil$ items.

Example: 20 students are grouped into 6 tutorial groups. At least one group has $\lceil 20/6 \rceil = \lceil 3.33\ldots \rceil = 4$ students.

  • If $n$ is divisible by $m$: $\lceil n/m \rceil = n/m$ (equal distribution is the worst case)
  • If $n$ is not divisible by $m$: $\lceil n/m \rceil = \lfloor n/m \rfloor + 1$ (one extra goes somewhere)
Worst-case guarantee problems. These ask "how many must you draw to guarantee at least $k$ of one type?" Strategy: imagine the worst-case scenario where you draw as many as possible without reaching $k$ of any type. Then add 1. If there are $t$ types and you want $k$ of one type, the answer is $t(k-1) + 1$.

Generalised form: n items into m boxes some box has n/m items; x = ceiling = round up to the next integer ( 3.1 = 4, 4.0 = 4)

Pause — copy the generalised Pigeonhole form into your book: $n$ items into $m$ boxes guarantees at least one box has $\lceil n/m \rceil$ items; $\lceil x \rceil$ is the ceiling — always round up (e.g. $\lceil 3.1 \rceil = 4$).

Did you get this? True or false: if 14 people are assigned to 4 groups, the generalised pigeonhole principle guarantees at least one group has 4 or more people.

PROBLEM 1 · BASIC FORM

Show that among any 13 people, at least two were born in the same month.

1
Pigeons = the 13 people.   Pigeonholes = the 12 months of the year.   $n = 13$, $m = 12$.
Identify what is being distributed (people) and what they are being distributed into (months).
PROBLEM 2 · WORST-CASE GUARANTEE

A bag contains red, blue, and green marbles. How many marbles must be drawn (without looking) to guarantee that at least 4 marbles of one colour have been drawn?

1
There are $t = 3$ colours and we want at least $k = 4$ of one colour.
Identify the number of types and the target quantity.
PROBLEM 3 · REMAINDER / NUMBER THEORY

Show that among any 5 integers, at least two have the same remainder when divided by 4.

1
When any integer is divided by 4, the remainder is one of $\{0, 1, 2, 3\}$ — exactly 4 possible remainders. These are the 4 pigeonholes.
Identify the possible categories. Division by 4 produces exactly 4 distinct remainders: 0, 1, 2, 3.

Fill the gap: To guarantee drawing at least 3 cards of the same suit from a standard 52-card deck (4 suits), you must draw at least cards.

Trap 01
Confusing "at least" with "exactly"
The Pigeonhole Principle guarantees "at least one container has $\geq 2$ items" — it does NOT say exactly 2, nor does it say which container. Students lose marks by making stronger claims than the principle allows.
Trap 02
Treating it as a probability statement
The principle is about certainty, not likelihood. It says something must happen, not that it is likely. Among 13 people there is a 100% guarantee two share a birth month — no probability involved.
Trap 03
Off-by-one in worst-case problems
Students often give $t(k-1)$ instead of $t(k-1)+1$. Remember: $t(k-1)$ is the worst case that still fails the condition. You need one more to guarantee success.

Did you get this? True or false: the Pigeonhole Principle can be used to find out exactly which two people in a group of 13 share a birthday month.

Work mode · how are you completing this lesson?
1

A group of 25 students sit a test marked out of 20. Explain why at least two students must achieve the same score.

2

A drawer contains 6 red socks and 4 blue socks. What is the minimum number of socks you must draw (without looking) to guarantee a matching pair? Justify using the Pigeonhole Principle.

3

Use the generalised form to find the guaranteed minimum number of students in at least one group, if 50 students are divided into 7 groups.

4

Show that among any 10 integers, at least two must have the same remainder when divided by 9.

5

A bag contains 5 red, 5 blue, 5 green, and 5 yellow balls. What is the minimum number of balls you must draw to guarantee at least 3 balls of the same colour? Use the formula $t(k-1)+1$.

Odd one out: Which of the following is NOT a valid application of the Pigeonhole Principle?

11
Revisit your thinking

Earlier you were asked: how many socks must you draw from a drawer of red and blue socks to guarantee a matching pair?

Answer: you need only 3 socks. The pigeons are the 3 socks drawn; the pigeonholes are the 2 colours. Since $3 > 2$, at least two socks must share the same colour — a matching pair. Notice the answer does not depend on how many red or blue socks are in the drawer, only on the number of types.

auto-saved
01
Multiple choice
+5 XP per correct · +25 XP all-correct

Pick your answer, then rate your confidence — that tells the system what to drill next. Each retry pulls a fresh mix from the bank.

02
Short answer
ApplyBand 42 marks

Q1. Show that among any 5 integers, at least two have the same remainder when divided by 4. (2 marks)

auto-saved
ApplyBand 42 marks

Q2. How many cards must be drawn from a standard 52-card deck (13 cards per suit, 4 suits) to guarantee at least 3 hearts? (2 marks)

auto-saved
Comprehensive answers (click to reveal)

Activity answers:

1. Pigeons = 25 students; holes = 21 scores (0–20). Since 25 > 21, at least two students share a score. [2]

2. Pigeons = socks drawn; holes = 2 colours. Worst case: 1 red + 1 blue = 2 socks, no pair. Draw 3rd: must match one of the 2 colours. Answer: 3. [2]

3. $\lceil 50/7 \rceil = \lceil 7.14\ldots \rceil = 8$. At least one group has 8 students. [1]

4. When dividing by 9, the possible remainders are $\{0,1,2,\ldots,8\}$ — 9 pigeonholes. Since 10 > 9, at least two of the 10 integers share a remainder mod 9. [2]

5. $t = 4$, $k = 3$: $4(3-1)+1 = 9$ balls. [2]

Q1 (2 marks): Pigeons = 5 integers; holes = 4 possible remainders $\{0,1,2,3\}$ when dividing by 4 [1]. Since $5 > 4$, by the Pigeonhole Principle at least two integers share the same remainder mod 4 [1].

Q2 (2 marks): Worst case: draw all 39 non-heart cards, plus 2 hearts — 41 cards with no 3 hearts [1]. The 42nd card must be the 3rd heart. Answer: 42 cards [1].

01
Boss battle · The Hole Keeper
earn bronze · silver · gold

Five timed questions. Beat the boss to bank a tier — gold (90% + speed), silver (75%), or bronze (50%). Replays welcome.

⚔ Enter the arena
02
Science Jump · platform challenge

Climb platforms by answering combinatorics questions. A lighter alternative to the boss.

Mark lesson as complete

Tick when you've finished the practice and review.

🎓
Want help with The Pigeonhole Principle?

Work through this topic 1-on-1 with an experienced HSC tutor.

Book a free session →