Get started

The pigeonhole principle How many socks must you pull out in the dark to be sure of a pair, or of three the same?

Maths olympiad · 45 minutes

Able students guess how many socks make a pair certain, prove it, find the general rule on a graph, then learn the real skill: choosing the boxes, for remainders, sums and points in a square. It comes with slides, a vote that shows who's stuck, practice that climbs to olympiad proofs, and homework.

You can present and print it without signing in.

Use in my lessons

Free. The whole lesson is copied into your Library for you to change.

x socks are pulled in the dark from a drawer of k colours. Each step is how many socks of one colour you can be sure of. Start at k = 4: where does each new step begin? Move k, and find the rule.

36912

At x = 1, 2, 3 …: 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4

The idea in one minute

If more than n things go into n boxes, some box gets at least two. More generally, if N things go into k boxes, some box gets at least N ÷ k, rounded up: they can't all be below the average. So 5 socks of 4 colours include a pair, and 9 include three of one colour. To be sure of r in one box takes k(r − 1) + 1 things, one more than the worst case of r − 1 in every box.

The principle is easy; the art is choosing the boxes. Remainders on dividing by n are boxes for numbers; pairs that add to the same total are boxes; small squares are boxes for points. The lesson starts with socks, guessed and then proved, finds the general rule on a graph, and spends most of its time choosing boxes in problems of the kind olympiads set, ending in short written proofs that the teacher marks.

By the end, students can

  • state the pigeonhole principle and use it to prove that something must happen
  • use the general form: N things in k boxes put at least N ÷ k, rounded up, in one box
  • find how many things make a result certain, with the worst case that shows one fewer is not enough
  • choose boxes for a problem: remainders, pairs with the same sum, pieces of a shape
  • write a short pigeonhole proof, naming the pigeons and the boxes

Key words

  • pigeonhole principle
  • boxes
  • worst case
  • remainder
  • rounded up
  • proof

Before this lesson

Students should divide with a remainder, round up a division, and know Pythagoras' theorem. It suits able students aged about 12 to 16.

Next: Invariants and colouring.

The lesson, step by step

45 minutes in total. The stretch is optional.

  1. 1 · Think5 min

    Socks in the dark

    A drawer holds red, blue, green and black socks.

    The light is off. You take socks out one by one.

    How many make you sure of a matching pair?

    How many make you sure of three of one colour?

    Guess first. Then find the unluckiest draw.

    Write here

    5 min 1 · Hook · students think · the slides say “Think”

    Socks in the dark

    Students guess how many socks make a pair, then three the same, certain.

    Say

    “A drawer holds red, blue, green and black socks, lots of each. The light is off. How many must you take to be sure of a pair? To be sure of three of one colour?”

    Ask
    • Could you get a pair with two socks? Could you be sure of one?
    • What is the unluckiest draw you can think of?
    Watch for

    Students who answer 2 are giving the luckiest case: ask what happens if the drawer is against you.

    For the teacher

    Two minutes of silent thinking, then a vote. The word to draw out is 'sure': not 'can', but 'must'.

    Ask for the unluckiest draw of 4 socks: one of each colour. A fifth sock has to match one of them. That is the whole principle; the rest of the lesson is using it well.

    Take a vote with Ask the class on the pair: 2, 4, 5 and 8 all come up. Ask someone who said 5 to play the drawer against someone who said 4. Leave three the same open: that is the lesson.

    Shorter: Ask for the pair only, vote and settle it at once (−2 min).

  2. 2 · Watch12 min

    One more pigeon than boxes

    4 socks can be one of each colour: no pair.

    Take 5. If each colour had at most one,

    there would be at most 4 socks.

    So some colour has two.

    More than n things in n boxes: a box holds two.

    Name the pigeons and the boxes.

    2 · Watch

    The fullest box

    x socks, k colours

    Fullest colour: at least x ÷ k,

    rounded up

    k = 4: 9 socks give 3 of a colour

    Sure of r: k(r − 1) + 1 socks

    Move k. Where does each step start?

    2 · Watch

    Choose the boxes

    Any 6 whole numbers: two differ by a multiple of 5.

    Boxes: remainders on dividing by 5: 0, 1, 2, 3, 4

    6 numbers, 5 boxes: two share a remainder,

    so their difference divides by 5.

    The skill is choosing the boxes.

    Try it: 3, 11, 20, 24, 37, 50. Which two?

    2 · Watch

    Five points in a square

    A square of side 2 holds 5 points.

    Boxes: four 1 by 1 squares.

    Two points share a small square,

    so they are at most √2 apart:

    its diagonal.

    Why must the boxes cover it all?

    12 min 2 · Explain · you explain · the slides say “Watch”

    Prove it, then choose the boxes

    The principle and its general form, then boxes chosen for numbers and for points.

    Say

    “If every colour had at most one sock, there would be at most four socks. We have five, so some colour has two. That argument is the pigeonhole principle.”

    Ask
    • With 9 socks and 4 colours, why can't every colour have 2 or fewer?
    • Six whole numbers: what boxes would make two of them land together?
    • Why must the four small squares cover the whole big square?
    Watch for

    Rounding N ÷ k down: 9 socks in 4 colours give at least 3 of one, not 2. If every colour had at most 2, there would be at most 8.

    Three of one colour

    Worst case: two of each of 4 colours, 8 socks

    One more sock makes three of a colour

    So 4 × 2 + 1 = 9 socks, and 8 are not enough

    Five points in a square

    A square of side 2, cut into four 1 by 1 squares

    5 points, 4 small squares: two share one

    Two points in a 1 by 1 square: at most √2 apart

    For the teacher

    First slide: 5 socks, 4 colours. If each colour had at most one, there would be at most 4 socks. So some colour has two. In general: more than n things in n boxes, some box has two.

    Second slide: the graph. x socks in k colours: the fullest colour has at least x ÷ k, rounded up, because if every box had fewer than the average, the total would be less than x. To be sure of r of one colour you need k(r − 1) + 1: one more than r − 1 in every box. Move k and read off where each step starts.

    Third slide: choose the boxes. Any six whole numbers include two whose difference divides by 5: the boxes are the five remainders 0, 1, 2, 3, 4. Two numbers in one box have the same remainder, so their difference is a multiple of 5.

    Fourth slide: points. Five points in a square of side 2: cut it into four 1 by 1 squares (the boxes), two points share one, and no two points in a 1 by 1 square are more than its diagonal, √2, apart. The boxes must cover the whole square, or a point could escape them.

    Say it every time: what are the pigeons, what are the boxes, how many of each?

    The graph's steps are the general form: x things in k boxes put at least x ÷ k, rounded up, in one box. Students should see each step starts one after a multiple of k. The diagonal check is the distance √2 (the negative root is the other side of the equation).

    Shorter: Leave out the points slide; keep it for the practice (−4 min).

  3. 3 · Your turn8 min

    A worked example, then yours

    I do: 5 colours of sweets. How many for 3 of one?

    Worst case 2 of each: 10. So 11.

    You do: 6 colours of beads. How many for 4 of one?

    I do: 50 pupils: 50 ÷ 7 rounded up, 8 share a weekday

    You do: 100 marbles in 9 bags: at least how many in one?

    Worst case first, then one more.

    Write here

    3 · Your turn

    Choose the boxes

    I do: any 8 numbers: two differ by a multiple of 7.

    Boxes: the remainders 0 to 6. 8 numbers, 7 boxes.

    You do: 6 numbers are chosen from 1 to 10.

    Show that two of them add up to 11.

    What could the boxes be? Each must hold pairs adding to 11.

    Write here

    The answers slide comes with your copy.

    8 min 3 · Your turn · students write

    A worked example, then yours

    Each worked example beside a twin that students solve themselves.

    Say

    “Watch me name the pigeons and the boxes, then count. Then you do the twin. Finish with the worst case: why one fewer is not enough.”

    Ask
    • What are the boxes here?
    • What is the worst case with one fewer?
    Watch for

    Answers of 4 × 3 = 12 for three the same: students counting enough to have three of every colour.

    How many to be sure

    5 colours of sweets: how many for 3 of one colour?

    Worst case: 2 of each, 5 × 2 = 10 sweets

    So 11 make it certain

    Then their turn

    6 colours of beads: how many for 4 of one colour?

    The fullest box

    50 pupils: at least how many share a weekday birthday?

    50 ÷ 7 = 7.14…, rounded up: 8

    If every day had 7 or fewer, at most 49 pupils

    Then their turn

    100 marbles in 9 bags: at least how many in one bag?

    Choose the boxes

    Any 8 whole numbers: two differ by a multiple of 7

    Boxes: the remainders 0 to 6 on dividing by 7

    8 numbers, 7 boxes: two share a remainder

    Then their turn

    6 numbers chosen from 1 to 10: show two add to 11

    For the teacher

    Work the first example aloud: the worst case first, then one more. Students do the twin and must say why 18 beads are not enough.

    The second pair is the rounded-up average, with the reason in a line. The third pair is the real skill: the boxes are not given, and choosing them is the proof.

    Open the answers slide once most have finished. The third twin's boxes are the five pairs {1, 10}, {2, 9}, {3, 8}, {4, 7}, {5, 6}: each adds to 11, and six numbers put two in one pair.

    Shorter: Do the first and third pairs only (−3 min).

  4. 4 · Vote and practise15 min

    Vote first

    Red, blue, green and yellow sweets, lots of each.

    How many to be sure of three of the same colour?

    A: 3

    B: 8

    C: 9

    D: 12

    E: 13

    Choose on your own, then say why.

    4 · Vote and practise

    Climb: count, then choose

    1. 37 pupils: how many must share a birth month?

    2. How many numbers make sure two end in the same digit?

    3. How many cards make sure of 5 of one suit?

    4. Six numbers from 1 to 10: must two add to 11?

    5. Triangle of side 2: points for two at most 1 apart?

    Stuck? Write 'pigeons:' and 'boxes:' first.

    Write here

    4 · Vote and practise

    Reason, then prove

    6. 10 people: why must two have equal friend counts?

    7. 5 points with whole coordinates: a whole midpoint?

    8. From 1 to 100: how many make two consecutive sure?

    9. Any 7 whole numbers: some add to a multiple of 7.

    A proof names the pigeons, the boxes and the count.

    Write here

    15 min 4 · Who's stuck? · students vote · the slides say “Vote and practise”

    Vote, then climb

    One question shows who's stuck; then practice from counting to olympiad proofs.

    Say

    “Choose an answer on your own. Nobody talks until everyone has chosen.”

    Ask
    • What is the unluckiest handful?
    • What are your pigeons, and what are your boxes?
    Watch for

    The luckiest case given as the answer; the +1 forgotten; three of every colour counted instead of three of one.

    Show your working. For 'how many', give the worst case that shows one fewer is not enough. For proofs, name the pigeons and the boxes.

    The question that shows who's stuck

    1. A bag holds red, blue, green and yellow sweets, lots of each. How many must you take without looking to be sure of three of the same colour?
      1. 3
      2. 8
      3. 9
      4. 12
      5. 13
    An example of what your Classroom shows as they answer
    • A3
    • B6
    • C11
    • D5
    • E4

    Each wrong answer points to a different mistake. As they answer, your Classroom shows who chose what, so you can see in seconds who needs help, and with what.

    1. A class has 37 pupils. At least ___ of them were born in the same month.
    2. How many whole numbers must you choose to be sure that two of them end in the same digit?
    3. A pack of 52 cards has 4 suits of 13. To be sure of 5 cards of one suit you must take ___ cards.
    4. Six different numbers are chosen from 1 to 10. Must two of them add up to 11?
      1. Yes: the pairs {1, 10}, {2, 9}, {3, 8}, {4, 7}, {5, 6} are five boxes, and six numbers put two in one box
      2. No: 1, 2, 3, 4, 5 and 7 have no two adding to 11
      3. Only if 10 is one of them
    5. Points are placed inside an equilateral triangle of side 2. How many points make sure that two of them are at most 1 apart?
    6. In a group of 10 people, each counts their friends in the group. Why must two have the same count?
      1. The counts go from 0 to 9: ten boxes for ten people, so two must share
      2. The counts go from 0 to 9, but 0 and 9 can't both happen, so ten people share nine boxes
      3. Friendship goes both ways, so the counts come in pairs
    7. Five points have whole-number coordinates. Prove that the midpoint of some two of them also has whole-number coordinates.
    8. Stretch: what is the least number of numbers you must choose from 1 to 100 to be sure that two of them are consecutive?
    9. Stretch: prove that among any 7 whole numbers you can choose one or more whose total divides by 7.

    Support · For any pigeonhole question: write 'pigeons:' and 'boxes:' first. For how many: build the worst case, then add one. For a proof: say why every pigeon has a box.

    For the teacher

    Everyone chooses before anyone explains. Then ask for each answer's reasoning: the best case, the forgotten one, the multiplied 4 × 3 all show here.

    Questions 1–3 are counting; 4–6 choose boxes; 7 is a first written proof. 8 and 9 are olympiad level: boxes made of pairs, and boxes made of running totals.

    Students write proofs on paper or the board; the quiz keeps their answers for you to mark and comment on.

    If the class is split, play the worst case: a student pulls sweets, the class tries to avoid three of a colour. Long answers (7, 9) are marked by you: a mark for naming pigeons and boxes, one for the count, one for the conclusion. Model answers are in each question's explanation.

    Shorter: After the vote, questions 1–5 only (−6 min).

    Longer: Swap and mark: pairs mark each other's proof of question 7, then 9 (+10 min).

  5. 5 · Show what you know5 min

    Ten points

    Ten points are placed in a square of side 3.

    Prove that two of them are at most √2 apart.

    Pigeons, boxes, and why two in a box are close.

    Write here

    5 min 5 · Exit · students show · the slides say “Show what you know”

    Ten points

    One proof with boxes students choose themselves shows who has the whole idea.

    Say

    “Prove it in a few lines. Name the pigeons and the boxes.”

    Watch for

    Boxes that are not the right size: three strips of 1 by 3 don't work, as two points in one can be √10 apart.

    A few lines: name the pigeons, the boxes, and why two in one box are close.

    1. Ten points are placed in a square of side 3. Prove that two of them are at most √2 apart.
    For the teacher

    Ten points are placed in a square of side 3.

    Prove that two of them are at most √2 apart.

    Answers that cut the square into nine pieces but don't say why two points in a piece are at most √2 apart have the trick but not the proof: start next time there. Set the homework.

    Longer: Then ask: is √2 the best? Can ten points all be more than 1 apart? (+5 min).

One-to-one: let the student guess the socks first and play the worst case against you: you pull the socks, they try to avoid a pair. Ask for every proof 'what are the pigeons, what are the boxes?' before a word is written.

Homework: how many, and proofs

For each 'how many', give the worst case that shows one fewer is not enough. For each proof, say what the pigeons and the boxes are.

  1. A drawer has socks of 7 colours. How many must you take in the dark to be sure of a pair?
  2. A school has 200 pupils. At least how many were born in the same month? Explain.
  3. How many cards must you take from a pack of 52 to be sure of 4 of one suit?
  4. Prove that among any 12 whole numbers, two have a difference that divides by 11.
  5. Eleven different numbers are chosen from 1 to 20. Prove that two of them add up to 21.
  6. Seventeen points are placed in a square of side 4. Prove that two are at most √2 apart.
  7. Challenge: 51 numbers are chosen from 1 to 100. Prove that one of them divides another. (Hint: every number is an odd number times a power of 2. Make a box for each odd number.)

Print the worksheet, with space for working and the homework. The answers come with your copy in the Library.

The pigeonhole principle: common questions

What is the pigeonhole principle, in one line?

If more things than boxes go into the boxes, some box gets at least two. In general, N things in k boxes put at least N ÷ k, rounded up, in one box. It proves that something must happen without saying where.

Which competitions is this lesson useful for?

It suits able students aged about 12 to 16 preparing for maths challenges and olympiads, such as the UKMT Intermediate and Senior Mathematical Challenges and their follow-on rounds. The problems are our own, written in the style of such competitions, not taken from past papers.

My students get the socks but not the proofs. What helps?

Make them write two words before anything else: 'pigeons:' and 'boxes:'. Most stuck proofs are boxes not yet chosen. Then ask why every pigeon has a box, and why two in one box give the result. The long questions are marked by you in Quizzes, with a comment.

Why does the lesson keep asking for the worst case?

A 'how many to be sure' answer has two halves: that number is enough, and one fewer is not. The worst case shows the second half, and it is how students find the number in the first place.

Can I use the lesson without creating an account?

Yes. You can read the lesson, print the worksheet and open its slides without signing in. Anything you draw on the slides isn't saved. With a free teacher account, you can keep the whole lesson in your Library to change and teach, including the quizzes, the answers and the answer slides.

Teach this lesson tomorrow

Keep the whole lesson, change what you like, and use it with a group. Present its slides step by step while each student works on their own copy.

Use in my lessons

Free. The whole lesson is copied into your Library for you to change.

Written in our own words and free to use with your students. Not endorsed by any exam board.