22.0 KB · commit a9602da
← Previous: DM-5 Lower-b: Bases and Proofs | 🏠 Index | Next: DM-6 Lower: Counting, Combination, Binomial →
Section: B (Discrete Mathematics) | Priority: 🔴 | Exam Frequency: 3/3 DM papers (2022 Q.8(c) & (d), 2023 Q.8(a), 2024 Q.8(c)) Sources: Rosen §6.2 (pp. 15–21, Theorems 1–3, Examples 1–13), Fahad Notes Class-20, Raidah Notes §6.5, Shishir Notes §3
The pigeonhole principle is the only discrete math topic that appeared in all three DM papers. It is also the cheapest one to learn. There is no calculation, no formula to remember, and only two sentences to state. But the examiner keeps asking for it in two different shapes: the plain form (2023 Q.8(a)) and the generalized form (2022 Q.8(c) and 2024 Q.8(c)). Learn both and the marks are there.
The third question in 2022 (Q.8(d)) uses the same principle as its engine. A proof about equal remainders is just the pigeonhole principle with k boxes named 0,1,2,…,d−1. Once you see that, the proof writes itself.
Pigeonhole principle (Theorem 1): "If k is a positive integer and k+1 or more objects are placed into k boxes, then there is at least one box containing two or more of the objects." — Rosen, §6.2 (p. 15)
Generalized pigeonhole principle (Theorem 2): "If N objects are placed into k boxes, then there is at least one box containing at least ⌈N/k⌉ objects." — Rosen, §6.2 (p. 17)
The other name: "The pigeonhole principle is also called the Dirichlet drawer principle, after the nineteenth-century German mathematician G. Lejeune Dirichlet, who often used this principle in his work." — Rosen, §6.2 (p. 15)
Function corollary (Corollary 1): "A function f from a set with k+1 or more elements to a set with k elements is not one-to-one." — Rosen, §6.2 (p. 15)

Figure 1 — There Are More Pigeons Than Pigeonholes. Rosen §6.2, p. 15.
Look at panel (b). Twelve pigeons sit in twelve holes with one to each. Move a single pigeon from one hole to another and you get panel (a) or (c). You cannot put thirteen pigeons in twelve holes with one each. That is the whole principle, drawn.
The plain principle and the generalized principle are different statements. Getting this wrong is the single most common error in this topic.
| Plain form (Theorem 1) | Generalized form (Theorem 2) | |
|---|---|---|
| Statement | k+1 objects into k boxes gives one box with ≥2 | N objects into k boxes gives one box with ≥⌈N/k⌉ |
| Condition on N | N>k | N>k(r−1), that is N≥k(r−1)+1 |
| Guarantee | a pair | a whole group of r |
| Recovered from | generalized by setting r=2 | the plain form is the case r=2 |
The plain form is the generalized form with r=2. So when r≥3 you must use the stronger threshold k(r−1)+1, not k+1.
Rosen states the generalized version with a ceiling. Write the guarantee as "at least r objects in one box". Then the condition is
⌈kN⌉≥rThe smallest integer N that satisfies this is
N=k(r−1)+1Set r=2 and you get N=k+1, which is exactly Theorem 1. Set m=r−1 and the condition reads N>mk, which is the form used in the 2022 and 2024 papers.
In every application the story hands you k directly. Count the categories.
Then r is the size of the group you want to force, and you solve N=k(r−1)+1 for the smallest N that guarantees it.
Suppose, for contradiction, that every box holds at most one object. With k boxes that gives at most 1+1+⋯+1=k objects in total. But we were given k+1 or more objects. Since k+1>k, this is impossible. So at least one box holds two or more.
Rosen writes the same argument as a proof by contraposition: suppose none of the k boxes contains more than one object, then the total number of objects would be at most k, contradicting the hypothesis that there are at least k+1 objects. (§6.2, p. 15)
Suppose every box holds fewer than ⌈N/k⌉ objects. Then each box holds at most ⌈N/k⌉−1 objects, so the total is at most
k(⌈kN⌉−1)<k((kN+1)−1)=NThe strict inequality uses ⌈N/k⌉<N/k+1. So the total would be less than N, but there are exactly N objects. Contradiction. Therefore some box holds at least ⌈N/k⌉. (Rosen, §6.2, p. 17)
The pigeonhole principle is deterministic. It says a collision must happen. No randomness, no probability, no assumptions about how objects are distributed.
The birthday paradox is a different result. It says that under a random model of birthdays, a shared birthday becomes likely around 23 people. That is probability, not pigeonhole.
Both get called "pigeonhole" by students, and the numbers get swapped. Get the pigeonhole figure right:
| Setting | Boxes k | Plain principle guarantees a pair at | Probabilistic "50% chance" figure |
|---|---|---|---|
| Birth day in a non-leap year | 366 | 367 people | 23 people (probability) |
| Birth month | 12 | 13 people | not the same question |
| Exam score on a 0 to 100 scale | 101 | 102 students | not applicable |
| English words, first letter | 26 | 27 words | not applicable |
Socks are certain. Birthdays are only probable. If you write "23 people share a birthday by the pigeonhole principle" in the exam, it is wrong. The correct pigeonhole figure is 367, and adding one sentence that separates the two ideas earns the mark that the swap would have cost you.
These are not exam questions, but each one trains a move that a real exam question can ask for.
Grades. How many students are needed to guarantee six with the same grade, given five grades A, B, C, D, F? We need ⌈N/5⌉≥6, so N=5(6−1)+1=26. With 25 students, five can hold exactly five each, so 26 is genuinely the minimum. (Rosen §6.2 Example 6, p. 18)
Cards. How many cards from a 52-card deck guarantee three of one suit? k=4 suits, want three of a suit, so N=4(3−1)+1=9. Eight cards could be two of each suit, so nine is the minimum. (Rosen §6.2 Example 7a, p. 18)
Area codes. A state has 25 million phones and 8 million numbers of the form NXX-XXXX. By the generalized principle, at least ⌈25000000/8000000⌉=4 phones must share a number, so at least four area codes are needed. (Rosen §6.2 Example 8, p. 18)
These are the ones where the objects or boxes have to be chosen cleverly. That is the part students miss.
A multiple with only 0s and 1s. For every positive integer n, some multiple of n has only 0s and 1s in its decimal expansion. Take the n+1 numbers 1,11,111,…,11…1 with n+1 ones. There are only n remainders on division by n, so two of these n+1 numbers share a remainder. The larger minus the smaller is a multiple of n made only of 0s and 1s. (Rosen §6.2 Example 4, p. 16)
A dividing pair. Among any n+1 positive integers not exceeding 2n, one divides another. Write each as aj=2kjqj with qj odd. Only n odd numbers lie below 2n, so two of the qj coincide by pigeonhole. The two corresponding a's then differ only in their power of 2, so one divides the other. (Rosen §6.2 Example 11, p. 19)
Points in a triangle. Shishir notes p. 615 give the same shape on geometry. Divide a unit equilateral triangle into 4 congruent triangles by joining the side midpoints. Each small triangle has side 0.5. Five points, four small triangles, so two points share a triangle and their distance is at most 0.5.
This is the part that makes the topic worth marks in an ECE course.
Storing n keys in m buckets forces a collision once n>m. That is the plain principle with the keys as pigeons and the buckets as boxes. More precisely, the generalized form says some bucket holds at least ⌈n/m⌉ keys.
This is why the load factor α=n/m is kept below 1.0, typically near 0.75. The load factor is not a tuning knob, it is a direct reading of the principle. A table that guaranteed zero collisions would need one bucket per key, which defeats the purpose of hashing entirely.
The same count explains why a map with m buckets cannot hold m+1 distinct keys without a collision, and why the birthday-paradox-style argument for collisions is not the pigeonhole principle but a probability estimate on top of it.
A router buffer with m slots receiving a burst of more than m packets must drop or block one. Same shape: buffers are boxes, packets are pigeons. The generalized form gives the guaranteed depth of the worst queue, at least ⌈n/m⌉, which is the bound an engineer writes into a queueing analysis.
Rosen's Corollary 1 (p. 15) is the pigeonhole principle wearing a function's clothes. A function from a set with k+1 or more elements to a set with k elements cannot be one-to-one. Put x in the box labelled f(x). This is the formal reason a hash function from more keys than buckets cannot be injective, and it is the line to cite if an exam question asks you to connect the principle to data structures.
| Year | Question | What is asked | Key answer |
|---|---|---|---|
| 2022 Q.8(c) | Give a real-world example of generalized pigeonhole principle. | Generalized form plus an instance | More than mk objects in k boxes forces some box to hold m+1 |
| 2024 Q.8(c) | Give a real-world example of generalized pigeonhole principle. | Verbatim repeat of 2022 Q.8(c) | same box, character for character |
| 2022 Q.8(d) | Show that among any d+1 integers two share a remainder mod d. | Four-step proof by pigeonhole | Any d+1 integers include two congruent modulo d |
| 2023 Q.8(a) | Briefly describe the pigeonhole principle with a real world example. | Plain form, contradiction proof, example | More objects than boxes forces at least one box to hold two or more |
Note the pattern. 2022 Q.8(c) and 2024 Q.8(c) are the same question with the same marks. Learn that one answer and you have covered two of the three papers. 2023 Q.8(a) is the plain form and is even easier.
Appeared: 2022 Q.8(c), 2024 Q.8(c) — (02 marks)
Full Answer:
The principle. If N objects are placed into k boxes and N>k, then at least one box holds at least two objects. The generalized form: if N>mk, then some box holds at least m+1 objects.
Real-world examples.
Appeared: 2022 Q.8(d) — (02 marks)
Full Answer:
Proof.
Step 1. Count the possible remainders. For any integer a, the division algorithm gives
a=qd+r,0≤r<dEvery integer therefore has exactly one of the residues 0,1,2,…,d−1. There are exactly d possible remainders.
Step 2. Identify the boxes. Take the d+1 integers and let each box be one of the d possible remainders, 0 through d−1. Place each integer in the box named by its remainder.
Step 3. Apply the pigeonhole principle. There are d+1 integers placed into d boxes, and d+1>d. By the pigeonhole principle, at least one box contains two or more integers.
Step 4. Conclude. Two integers a1,a2 share a box, so they share a remainder. Writing a1=q1d+r and a2=q2d+r and subtracting gives
a1−a2=(q1−q2)dhence d divides a1−a2, which is exactly the statement that the two have the same remainder on division by d.
Any d+1 integers include two congruent modulo dAppeared: 2023 Q.8(a) — (02 marks)
Full Answer:
The principle. If N objects are placed into k boxes and N>k, then at least one box holds at least two objects.
Proof. Suppose every box held at most one object. Then the boxes would hold at most k objects in total. But N>k, a contradiction.
Real-world examples.
PYQ coverage for DM-6.3: 4 manifest rows (2022 Q.8(c), 2022 Q.8(d), 2023 Q.8(a), 2024 Q.8(c)) across 3 unique questions, 3 blocks, 0 missing.
← Previous: DM-5 Lower-b: Bases and Proofs | 🏠 Index | Next: DM-6 Lower: Counting, Combination, Binomial →