Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Competitions › IOQM › unit 14 of 14

Pigeonhole principle and invariants

IOQM · All sections · about 6 minutes

If n + 1 objects go into n boxes, some box gets two. Invariants are quantities that never change under the allowed moves, proving that some states are unreachable.

Both turn “show that…” arguments into numbers.

In this lesson

  1. Pigeonhole
  2. Invariants
  3. Worked examples
  4. Where marks are lost
  5. Check yourself

1Pigeonhole

Pick boxes so that two objects in one box gives what you want. Among any 5 integers, two have the same remainder mod 4, so their difference is divisible by 4.

2Invariants

Find something the moves cannot change. A chessboard with two opposite corners removed cannot be tiled by dominoes, because every domino covers one black and one white square but the corners have the same colour.

Worked examples

  1. Example 1Among any 11 integers, show two have a difference divisible by 10. How many remainders mod 10 are there?

    1. There are 10 remainders and 11 numbers.

    Answer: 10, so two share a remainder

See it move

Where marks are lost

  • Choosing boxes that do not give the conclusion.
  • Missing that an invariant must hold for every allowed move.

Exam tips

  • To guarantee k in one box with n boxes, you need n(k − 1) + 1 objects.
  • Common invariants: parity, sum, colouring.
  • Choose the boxes cleverly: remainders, pairs adding to a total.

Practice questions

  1. How many socks must you take from a drawer of 5 colours to be sure of a matching pair?

  2. Minimum people needed to be sure that 3 share a birth month?

  3. Numbers 1 to 10 are on a board. Replace any two by their difference repeatedly until one is left. Its parity is…

More worked examples

Try each one first, then open the working.

  1. How many triangles of all sizes are in the figure?

    Show the working

    Start: A triangle is fixed by choosing two lines from the top corner and one base line.

    Each strip between parallel lines gives C(4, 2) = 6 triangles (choose 2 of the 4 lines from the top corner), and there are 1 such levels: 6.

    Answer: 6

  2. Moving only right or up, how many shortest routes from A to B pass through P?

    ABP
    Show the working

    Start: Routes to P times routes from P.

    A→P: C(2, 1) = 2; P→B: C(6, 3) = 20. Multiply: 40.

    Answer: 40

  3. How many different arrangements can be made of all the letters of the word BANANA?

    Show the working

    Start: n! ÷ (p! q! …) for repeated letters.

    6! divided by the factorials of the repeated letters = 60.

    Answer: 60

  4. How many triangles of all sizes are in the figure?

    Show the working

    Start: A triangle is fixed by choosing two lines from the top corner and one base line.

    Each strip between parallel lines gives C(6, 2) = 15 triangles (choose 2 of the 6 lines from the top corner), and there are 3 such levels: 45.

    Answer: 45

Practise more

New questions every time, at exam level

How many triangles of all sizes are in the figure?

Sit a timed IOQM mock test

Inclusion–exclusion and complementsAll competitions