The Pigeonhole Principle

Textbook
Rosen 8e, Section 6.2
Study day
Sunday, Nov 8
Homework
Written HW 8: 1–21 odd, 33–47 odd
Progress
Notes not read 0 / 21 problems graded

If you put more objects into boxes than there are boxes, some box must hold at least two. The hard part is choosing what the objects (pigeons) and boxes (holes) are.

The pigeonhole principle

Pigeonhole principle

Let . If or more objects are placed into boxes, then at least one box contains two or more objects.

Corollary

A function with cannot be one-to-one.

Quick examples from class
  • 367 people: two share a birthday (366 possible birthdays).
  • 27 English words: two end in the same letter (26 letters).
  • Scores 0–50 (51 possible scores): 52 students guarantee two with the same score.

The generalized pigeonhole principle

Generalized pigeonhole principle

If objects are placed into boxes, then some box contains at least objects.

Why: if every box had at most objects, the total would be at most , using . Contradiction.

The two formulas you'll actually use
  1. Guaranteed amount: objects in boxes means some box has .
  2. Minimum number needed: to guarantee some box has at least objects, you need

    Reason: objects can be spread with exactly in every box. One more forces a box to reach .
From class: minimum class size so 5 students get the same grade (10 grades: A, A−, B+, B, B−, C+, C, C−, D, F)

, : .

From class: 37 people, months

, so at least 4 were born in the same month.

"Specific box" questions: think worst case

Worst-case reasoning

When you need objects of a specific kind, pigeonhole isn't the right tool. Imagine the worst luck: you draw every other kind first, then of the kind you want.

From class: cards
  • At least 3 cards of the same suit (any suit): 4 suits, , so cards.
  • At least 3 clubs: in the worst case you draw all 39 non-clubs first, so you need cards.

Writing a pigeonhole proof

Template
  1. Name the pigeons (the objects) and count them: .
  2. Name the holes (the categories) and count them: , with .
  3. Say why each pigeon lands in exactly one hole.
  4. Conclude: by the pigeonhole principle, two pigeons share a hole, which means … (translate back into the problem).
Classic hole choices
Problem type Holes
Two integers with the same remainder mod the remainders
Pairs adding to a target (e.g. sum 9 from ) the pairs
Integer midpoint of lattice points parity patterns: (even, odd), … ( of them)
Degrees in a network of computers possible degrees, of which only can occur
One integer divides another (from class) odd parts: write with odd
From class: among any positive integers not exceeding , one divides another
Proof

Write each chosen integer as with odd. Each odd part is in , which has only values. With integers, two have the same odd part: and . If then . ∎

From class: every has a multiple whose decimal digits are only 0s and 1s
Proof

Consider the numbers . There are only possible remainders mod , so two of them, say with ones, have the same remainder. Their difference is divisible by and uses only 0s and 1s. ∎

Computing ceilings without a calculator

: divide, and if there's any remainder, round up.

  • : , so it is .
  • (because ).
Common mistakes
  • Using instead of . To guarantee 2 in a box you need , not .
  • Forgetting that "at least 3 blue" is a worst-case question, not .
  • In proofs, not saying what the boxes are, or not translating the conclusion back.
Fix to your class notes

"There is a box containing at least ___ objects": the missing word is two.

Exam checklist

  • Find the minimum that guarantees in some box: .
  • Find the guaranteed amount .
  • Use worst-case reasoning for a specific category.
  • Write a clean pigeonhole proof with explicit pigeons and holes (remainders, pairs, parities, degrees).
Go to problems