Get started

Invariants and colouring Rub out two numbers, write their difference: why can 1 to 10 never end at 0?

Maths olympiad · 45 minutes

Able students play a game of rubbing out numbers and find they can never reach 0, discover the quantity that never changes, then use colourings to prove tilings impossible and a falling count to prove a process must end. It comes with slides, a vote that shows who's stuck, practice up 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.

The numbers 1 to x are on a board. Each step is the remainder when their total is divided by m. Start at m = 2: which x give an even total? A move rubs out two numbers and writes their difference. Why is m = 2 the one that matters for that move?

36912

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

The idea in one minute

An invariant is something a move never changes. Rubbing out two numbers and writing their difference changes the total by twice the smaller one, so whether the total is odd or even never changes. 1 to 10 add to 55, which is odd, so the last number is odd: it can't be 0. A colouring is an invariant drawn on a board: a domino always covers one black and one white square, so a board with more of one colour can't be tiled. A monovariant only ever goes one way; a whole number that keeps falling and can't go below 0 proves a process must stop.

The lesson is problem first. Students play the game before anyone explains, then find what stays the same. An invariant proves something impossible; it never proves something possible, which needs an example. Practice climbs from finding an invariant to colouring proofs and a process that must end, written up for the teacher to mark.

By the end, students can

  • find a quantity a move never changes, such as the parity of a total
  • use an invariant to prove that an end state can never be reached
  • colour a board to prove that a tiling is impossible
  • use a monovariant to prove that a process must end
  • tell 'impossible, by an invariant' from 'possible, by an example'

Key words

  • invariant
  • parity
  • colouring
  • tiling
  • monovariant
  • proof of impossibility

Before this lesson

Students should know odd and even, add 1 + 2 + … + n as n(n + 1) ÷ 2, and colour a chessboard. It suits able students aged about 12 to 16.

Taught in The pigeonhole principle.

The lesson, step by step

30 minutes in total. Each step says what changes for this length.

  1. 1 · Think3 min

    The difference game

    Write the numbers 1 to 10.

    A move: rub out any two, and write their difference.

    Keep going until one number is left.

    Can you make the last number 0?

    Play three games. Write down how each ends.

    Write here

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

    The difference game

    Students play a game that never ends at 0, before anyone explains why.

    For this length: One game each, then collect the endings

    Say

    “Write 1 to 10. A move: rub out any two numbers and write their difference. Keep going until one number is left. Can you make it 0? Play three games.”

    Ask
    • What did your games end on? What do the endings have in common?
    • Is there a way you haven't tried?
    Watch for

    Students who conclude 'we couldn't, so it's impossible' after a few games: ask how many ways there are to play, and whether they tried them all.

    For the teacher

    Three minutes of play in pairs. Each pair writes down where each game ended.

    Collect the endings on the board: 1, 3, 5, 7… never an even number. Ask: why? And would 1 to 8 behave the same way?

    Collect the last numbers: they are all odd. Take a vote with Ask the class: can 0 ever be reached? Many say 'probably not'. The lesson turns 'probably' into a proof.

    Shorter: One game each, then collect the endings (−2 min).

  2. 2 · Watch8 min

    Look at the total

    a and b (a ≥ b) become a − b.

    The total falls by a + b − (a − b) = 2b: even.

    So an odd total stays odd, an even one stays even.

    1 + 2 + … + 10 = 55: odd. The last number is odd.

    It can never be 0, in any game.

    An invariant: what a move can never change.

    2 · Watch

    Colour the board

    Corners cut off: 14 squares

    Colour it like a chessboard.

    The corners were the same colour:

    6 of theirs left (shaded), 8 white.

    A domino covers one of each.

    So can 7 dominoes cover it?

    2 · Watch

    A count that only falls

    Swap two neighbours that are out of order.

    5 4 3 2 1: count the pairs out of order: 10.

    Each swap fixes exactly one pair, and spoils none.

    A whole number that falls can't fall for ever:

    the swapping must stop, with the row in order.

    A monovariant: it only ever goes one way.

    2 · Watch

    Impossible, or possible?

    An invariant proves something impossible.

    It never proves something possible.

    For possible, show it: a game, a tiling.

    Balanced colours only say 'not ruled out'.

    Which one have you shown?

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

    Find what never changes

    The parity of the total, then a chessboard colouring, then a count that only falls.

    For this length: Leave out the monovariant slide; it comes in the practice

    Say

    “Don't look at the numbers: look at the total. What does one move do to it?”

    Ask
    • a and b become a − b. By how much does the total fall?
    • A domino on a chessboard: what colours does it cover?
    • Each swap fixes one out-of-order pair. Can it make a new one?
    Watch for

    Students who think the total stays the same: it falls by 2b, so only its parity stays the same.

    The total's parity

    a and b, with a ≥ b, become a − b

    The total falls by a + b − (a − b) = 2b: even

    1 to 10 add to 55, odd: the last number is odd

    The cut chessboard

    8 by 8, two opposite corners cut off: 62 squares

    The corners are the same colour: 30 of it, 32 of the other

    A domino covers one of each: 31 need 31 and 31

    A count that falls

    Swap two neighbours that are out of order

    5 4 3 2 1 has 10 out-of-order pairs

    Each swap fixes exactly one: 10 swaps, then it stops

    For the teacher

    First slide: the total. Replacing a and b by a − b takes away a + b and adds a − b: the total falls by 2b, an even number. So odd stays odd and even stays even. 1 + 2 + … + 10 = 55 is odd, so the last number is odd and can't be 0. That is a proof for every possible game, at once.

    Second slide: colouring. Cut two opposite corners off a chessboard. Students first count squares: 62, even, so 31 dominoes might fit. Colour it: both corners were the same colour, leaving 30 of one and 32 of the other. Every domino covers one of each, so 31 dominoes cover 31 and 31. Impossible. Draw the 4 by 4 version on the slide and count: 6 and 8.

    Third slide: a monovariant. In a row of numbers, swap two neighbours that are out of order. Count the out-of-order pairs: each swap fixes exactly that pair and changes no other, so the count falls by 1. It can't go below 0, so swapping must stop, and when it stops the row is in order.

    End with the warning: an invariant proves impossible. Possible needs an example.

    Three ideas, one slide each: an invariant (parity of the total), a colouring (an invariant drawn on a board), a monovariant (a whole number that only falls). The first check is the total falling by 2b, here with b = 3.

    Shorter: Leave out the monovariant slide; it comes in the practice (−4 min).

  3. 3 · Your turn5 min

    A worked example, then yours

    I do: 1 to 6: total 21, odd, so never 0

    You do: 1 to 8, difference game: can it end at 0?

    I do: 6 by 6, opposite corners off: 16 and 18. No.

    You do: 6 by 6, the two top corners off: dominoes?

    Impossible: give the invariant. Possible: show it.

    Write here

    3 · Your turn

    A count that falls

    I do: 4 3 2 1: 6 pairs out of order, so 6 swaps

    You do: 3 1 4 2 5: how many swaps put it in order?

    List the pairs that are out of order.

    Write here

    The answers slide comes with your copy.

    5 min 3 · Your turn · students write

    A worked example, then yours

    Each worked example beside a twin that students solve themselves.

    For this length: Do the first two pairs only

    Say

    “Watch me find what a move can't change. Then you do the twin, and say whether you have proved impossible, or need an example.”

    Ask
    • What does one move do to your quantity?
    • Impossible, or possible? Which have you shown?
    Watch for

    The twins where the invariant allows it: students who stop at 'the colours balance' without giving a tiling or a game.

    Parity of a total

    1 to 6, difference game: can it end at 0?

    1 + … + 6 = 21, odd; each move keeps it odd

    So the last number is odd: never 0

    Then their turn

    1 to 8, difference game: can it end at 0?

    Colouring

    6 by 6, two opposite corners cut off: dominoes?

    Corners the same colour: 16 of it, 18 of the other

    A domino covers one of each: impossible

    Then their turn

    6 by 6, the two top corners cut off: dominoes?

    A count that falls

    Neighbour swaps on 4 3 2 1: how many?

    Out-of-order pairs: 6; each swap fixes one

    Exactly 6 swaps, in any order

    Then their turn

    Neighbour swaps on 3 1 4 2 5: how many?

    For the teacher

    The first two pairs are built so the worked one is impossible and its twin is not: the same invariant, a different answer. Students must then show it can be done: pair 1 and 2, 3 and 4, 5 and 6, 7 and 8 to get four 1s, then 0, 0, then 0. Row 1 of the board has four squares left for two dominoes, and the other five rows take three each.

    The third pair is counting out-of-order pairs: in 3 1 4 2 5 they are (3, 1), (3, 2) and (4, 2).

    Open the answers slide once most have finished. Two twins are 'possible': 1 to 8 (total 36, even) and the top corners cut off (17 and 17). The invariant doesn't forbid them, and an example settles it.

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

  4. 4 · Vote and practise9 min

    Vote first

    5 by 5, one corner cut off: 24 squares. 12 dominoes?

    A: No: rows of 5 can't be filled

    B: Yes: 24 is even, so it always works

    C: No: the colours are 13 and 11

    D: Yes: 12 and 12, and a tiling can be drawn

    E: Yes: 12 and 12, and that proves it

    Choose on your own, then say why.

    4 · Vote and practise

    Climb: find what never changes

    1. 1 to 9: the total? The last number: odd or even?

    2. A knight on white makes 7 moves. Which colour now?

    3. Chessboard, opposite corners off: corner colour left?

    4. 1 to 10, write a + b + 1: the last number?

    5. 6 5 4 3 2 1 by neighbour swaps: how many?

    Stuck? What does one move change, and what can't it?

    Write here

    4 · Vote and practise

    Reason, then prove

    6. Why must the swapping in 5 stop?

    7. 1 to 2026, sum or difference: the last is odd.

    8. Chameleons 10, 14, 21: ever all one colour?

    9. Chessboard less a corner: 21 straight 1 by 3 tiles?

    The invariant, why every move keeps it, start and end.

    Write here

    9 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 invariants to olympiad proofs.

    For this length: After the vote, questions 1–5 only

    Say

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

    Ask
    • What does the colouring prove, and what doesn't it?
    • Could you draw the tiling?
    Watch for

    'The colours balance, so it works': the colouring only says it isn't ruled out.

    Show your working. For 'impossible', give the invariant and why every move keeps it. For 'possible', give an example.

    The question that shows who's stuck

    1. A 5 by 5 board has one corner square cut off, leaving 24 squares. Can 12 dominoes cover it exactly?
      1. No: each row has 5 squares, an odd number, so no row can be filled
      2. Yes: 24 is even, and an even number of squares can always be tiled
      3. No: coloured like a chessboard, it has 13 of one colour and 11 of the other
      4. Yes: the colouring leaves 12 and 12, and a tiling can be drawn
      5. Yes: the colouring leaves 12 and 12, and that proves a tiling exists
    An example of what your Classroom shows as they answer
    • A4
    • B6
    • C5
    • D9
    • E8

    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. The numbers 1 to 9 add to ___. In the difference game, the last number left is always ___.
    2. A knight starts on a white square of a chessboard and makes 7 moves. Where is it now?
      1. On a white square
      2. On a black square
      3. Either: it depends on the moves
    3. A chessboard has two opposite corners cut off. How many squares of the corners' colour are left?
    4. Write 1 to 10. A move: rub out two numbers a and b, and write a + b + 1. After 9 moves one number is left. What is it?
    5. The row 6 5 4 3 2 1 is put in order by swapping neighbours that are out of order. How many swaps does it take?
    6. Why must the swapping in question 5 stop, whichever swaps you choose?
      1. Each swap lowers the number of out-of-order pairs by 1, and it can't go below 0
      2. There are only 720 orders of six numbers, so it runs out of them
      3. Each swap puts a number in its final place
    7. The numbers 1 to 2026 are on a board. A move: rub out two numbers and write either their sum or their difference. Prove that the last number left is odd.
    8. Stretch: an island has 10 red, 14 green and 21 blue chameleons. When two of different colours meet, both turn the third colour. Can they ever all be one colour? Prove it.
    9. Stretch: a chessboard has one corner square cut off. Can the 63 squares be covered by 21 straight 1 by 3 tiles? Prove your answer.

    Support · For each problem: write what one move changes, then look for what it can't change: a total, its parity or remainder, a count of colours. For 'must it stop': find a whole number that falls each time.

    For the teacher

    Everyone chooses before anyone explains. Then ask for each answer's reason: rows of 5, even counts and balanced colours all show here.

    Questions 1–3 find and use an invariant; 4–6 are a new look and a monovariant; 7 is a first written proof. 8 and 9 are olympiad level: remainders on dividing by 3, and three colours.

    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, draw the 5 by 5 board without its corner and ask a volunteer to tile it on the board. Long answers (7, 8, 9) are marked by you: a mark for the invariant, one for showing a move keeps it, one for the start and the end compared. 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

    1 to 12

    Write 1 to 12. A move: rub out two numbers,

    and write their difference.

    Can the last number left be 1? Prove your answer.

    What never changes, why, and what it says about the end.

    Write here

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

    1 to 12

    One invariant proof shows who has the whole idea.

    Say

    “A few lines: what never changes, why, and what that says about the end.”

    Watch for

    'I tried and couldn't get 1' is not a proof.

    A few lines: what never changes, why, and what it says about the end.

    1. Write 1 to 12. A move: rub out two numbers and write their difference. Can the last number left be 1? Prove your answer.
    For the teacher

    Write 1 to 12. A move: rub out two numbers and write their difference.

    Can the last number left be 1? Prove your answer.

    Answers that find the total 78 but don't say why each move keeps its parity have the trick but not the proof: start next time there. Set the homework.

    Longer: Then ask: which last numbers can 1 to 12 end on? Find a game for one of them. (+5 min).

One-to-one: play the number game together on paper, then ask what is the same every time it ends. For each problem ask 'what does a move change, and what can't it change?' before any writing.

Homework: proofs

For 'impossible', give the invariant and why every move keeps it. For 'possible', give an example.

  1. Write 1 to 20 and play the difference game. Can the last number be 0? If so, show a game that does it.
  2. A knight starts in one corner of a chessboard. Can it reach the opposite corner in exactly 7 moves? Why?
  3. A 4 by 4 board has two opposite corners cut off. Prove that 7 dominoes can't cover it.
  4. The row 4 1 3 2 5 is put in order by swapping neighbours that are out of order. How many swaps does it take? Why always the same?
  5. Write 1 to 5. A move: rub out a and b, write ab + a + b. What is the last number? (Hint: what is ab + a + b + 1?)
  6. Write 1 to 2025 and play the difference game. Prove the last number can't be 2.
  7. Challenge: can a 6 by 6 board be covered by nine straight 1 by 4 tiles? (Hint: colour square (r, c) by the remainder of r + c on dividing by 4.)

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

Invariants and colouring: common questions

What is an invariant, in one line?

Something a move never changes: a total, whether it is odd or even, its remainder on dividing by 3, the number of squares of each colour covered. If the start and the end you want differ in it, no sequence of moves can get there.

What is the difference between an invariant and a monovariant?

An invariant stays the same; a monovariant only ever goes one way. A whole number that falls at every move and can't go below 0 proves that a process must stop, which is how olympiad problems ask 'show that this ends'.

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 find the invariant but write 'so it works'. What helps?

Ask after every answer: have you shown impossible, or possible? An invariant can only show impossible. If it doesn't rule the answer out, they must build the game or draw the tiling. The vote is built around that mistake.

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.