Chapter

Invariants II and Monovariants

The module develops invariants beyond the basic level: parity, residues, gcd, product of signs, board colourings, weighted sums, and monovariants for proving termination of processes.
Log in to track solved progress and bookmarks.

Theory

Key Idea

An invariant is a quantity or property that does not change under the allowed moves. If the initial and final states have different invariant values, the transition is impossible.

A monovariant is a quantity that strictly increases or strictly decreases after each move. If it is integer-valued and bounded, the process must terminate.

Basic Facts

  • Common invariants are parity, residues modulo an integer, sums, products of signs, gcd, and colouring sums.
  • For boards, useful colourings include chessboard colouring, diagonal colouring, coordinate residues, and weights \(+1\) and \(-1\).
  • For processes, look for a quantity moving in one direction: number of inversions, sum of squares, weighted sum, or maximum height.
  • An invariant usually proves impossibility, while a monovariant usually proves termination or absence of an infinite game.

When to Use This Method

  • The problem contains allowed operations, moves, recolourings, swaps, or transfers of stones.
  • You need to prove that a state is unreachable.
  • You need to prove that a process must eventually stop.
  • The statement contains a board, colours, residues, signs, gcd, or repeated local changes.

How to Recognise the Method

First compare the initial and desired states: how do they differ in parity, sum, colours, or residues? Then check what one move does to that quantity.

If a direct invariant is not visible, try assigning weights to cells or objects. A good weight function gives zero contribution for every allowed move but nonzero contribution for the target state.

Typical Mistakes

  • Checking the invariant only on one sample move, not on an arbitrary move.
  • Showing that a quantity does not increase, but not that it changes strictly; termination then does not follow.
  • Using an invariant that is too weak: the initial and final states agree under it.
  • Forgetting to prove sufficiency when the problem asks for a full reachability criterion, not only impossibility.

Mini-Checklist

  • Write what one move changes.
  • Check parity, residues, sum, gcd, and product of signs.
  • For a board, choose a colouring or weights.
  • For a process, find an integer-valued bounded quantity with strict change.
  • Compare the initial and final states using the found quantity.

Examples

Example 1. Parity of Black Coins

The simplest invariant is parity.

Problem. Some coins on a table show their black side. In one move exactly two coins are flipped. Can a position with one black coin be turned into a position with no black coins?

Solution.

When two coins are flipped, the number of black coins changes by \(-2\), \(0\), or \(2\). In all cases its parity is preserved.

Initially the number of black coins is odd, while in the position with no black coins it is \(0\), which is even. Therefore such a position cannot be obtained.

Example 2. Chessboard Colouring

Colouring turns a geometric tiling problem into counting.

Problem. From an \(8\times 8\) chessboard, two corner squares of the same colour are removed. Can the remaining board be tiled by \(1\times2\) dominoes?

Solution.

Each domino covers one black and one white square. If two squares of the same colour are removed, then the remaining board has unequal numbers of black and white squares.

A domino tiling would require these numbers to be equal. Hence such a tiling is impossible.

Example 3. Residues Modulo an Integer

Sometimes a residue, not the quantity itself, is preserved.

Problem. A token is at point \(0\) on a number line. In one move it may be shifted \(6\) units to the right or \(9\) units to the left. Can it reach point \(100\)?

Solution.

Both allowed shifts are multiples of \(3\). Therefore the coordinate modulo \(3\) does not change.

The initial coordinate has residue \(0\), while \(100\equiv 1\pmod 3\). Therefore point \(100\) cannot be reached.

Example 4. GCD as an Invariant

For operations with differences, the gcd often remains unchanged.

Problem. There are two positive numbers \(a\) and \(b\). In one move, the larger number may be replaced by the difference of the larger and the smaller. Prove that the gcd of the two numbers is unchanged.

Solution.

If \(a\ge b\), the new pair is \(a-b\) and \(b\). The common divisors of \(a\) and \(b\) are exactly the common divisors of \(a-b\) and \(b\): divisibility of \(a\) and \(b\) gives divisibility of \(a-b\), and divisibility of \(a-b\) and \(b\) gives divisibility of \(a\).

Thus \(\gcd(a,b)=\gcd(a-b,b)\). The gcd is preserved.

Example 5. Sum of Squares as a Monovariant

For balancing processes, the sum of squares often works.

Problem. Two piles contain \(a\) and \(b\) stones, where \(a\ge b+2\). One stone is moved from the first pile to the second. Prove that the sum of squares of pile sizes decreases.

Solution.

Compare the old and new sums:

\[(a^2+b^2)-((a-1)^2+(b+1)^2)=2(a-b-1).\]

Since \(a\ge b+2\), we get \(a-b-1\ge 1\). The difference is positive, so the sum of squares strictly decreases.

Example 6. Product of Signs

When two signs are changed, the product of all signs remains unchanged.

Problem. Signs \(+\) and \(-\) are written at the vertices of a connected graph. In one move, choose an edge and change the signs at both its endpoints. Prove that the product of all signs does not change.

Solution.

One move changes the signs at exactly two vertices. Therefore the product of all signs is multiplied by \((-1)^2=1\).

Thus the product of signs is an invariant.

Example 7. Row and Column Parity

Sometimes one move preserves many parities at once.

Problem. On an \(8\times8\) board, all cells are white. In one move, choose a contiguous \(2\times2\) block and change the colours of all four cells. Prove that a position with exactly one black cell cannot be obtained.

Solution.

One move changes two cells in each of two rows and two cells in each of two columns. Therefore the parity of the number of black cells in every row and every column is preserved.

Initially all these parities are \(0\). If there is exactly one black cell, its row and its column have odd parity. Contradiction.

Example 8. A Weighted Sum for Termination

When stones move only in one direction, a weighted coordinate sum is useful.

Problem. Stones lie in several cells of a strip. In one move, one stone may be moved one cell to the right, but not beyond the \(n\)-th cell. Prove that an infinite sequence of moves is impossible.

Solution.

Consider the sum of the indices of the cells containing the stones, counting each stone separately. Each move increases this sum by \(1\).

The sum cannot exceed \(n\) times the number of stones. Thus it strictly increases but is bounded above. Infinitely many moves are impossible.

Problems

Problems

#5.1
#5.1

Two Coins per Move

Parity Grade 8 Grade 9 ★★☆☆☆

There are \(25\) coins on a table. Initially exactly one coin shows its black side. In one move exactly two coins must be flipped. Prove that it is impossible to reach a position in which all coins show their white side.

Details
Problem: COM-B2-M05-P001
Difficulty: Level 2 of 5
Tag: Parity
Grade: Grade 8, Grade 9
#5.2
#5.2

Two Same-Coloured Corner Squares

Coloring Grade 8 Grade 9 ★★☆☆☆

From an \(8\times8\) board, two corner squares of the same colour are removed. Prove that the remaining board cannot be tiled by \(1\times2\) dominoes.

Details
Problem: COM-B2-M05-P002
Difficulty: Level 2 of 5
Tag: Coloring
Grade: Grade 8, Grade 9
#5.3
#5.3

Three Negative Signs

Invariant Grade 8 Grade 9 ★★☆☆☆

Three signs \(+,+,+\) are written on a board. In one move, choose two signs and replace each by the opposite sign. Prove that \(-,-,-\) cannot be obtained.

Details
Problem: COM-B2-M05-P003
Difficulty: Level 2 of 5
Tag: Invariant
Grade: Grade 8, Grade 9
#5.4
#5.4

Steps on a Line

Modular Arithmetic Grade 8 Grade 9 ★★☆☆☆

A token starts at point \(0\). In one move it may be shifted \(10\) units to the right or \(15\) units to the left. Prove that it will never reach point \(2026\).

Details
Problem: COM-B2-M05-P004
Difficulty: Level 2 of 5
Tag: Modular Arithmetic
Grade: Grade 8, Grade 9
#5.5
#5.5

Balancing Two Piles

Process Grade 8 Grade 9 ★★☆☆☆

Two piles contain \(a\) and \(b\) stones, with \(a\ge b+2\). In one move, one stone is moved from the larger pile to the smaller pile. Prove that the sum of squares of pile sizes decreases.

Details
Problem: COM-B2-M05-P005
Difficulty: Level 2 of 5
Tag: Process
Grade: Grade 8, Grade 9
#5.6
#5.6

Three Colours of Stones

Modular Arithmetic Grade 9 Grade 10 ★★★☆☆

There are \(20\) red, \(21\) blue, and \(22\) green stones. In one move, choose two stones of different colours, remove them, and add two stones of the third colour. Prove that it is impossible to reach a state in which all stones have one colour.

Details
Problem: COM-B2-M05-P006
Difficulty: Level 3 of 5
Tag: Modular Arithmetic
Grade: Grade 9, Grade 10
#5.7
#5.7

The Difference Algorithm

GCD Grade 9 Grade 10 ★★★☆☆

Positive integers \(84\) and \(30\) are given. In one move, the larger number is replaced by the difference of the larger and the smaller. Prove that the pair \(7,7\) cannot be obtained.

Details
Problem: COM-B2-M05-P007
Difficulty: Level 3 of 5
Tag: GCD
Grade: Grade 9, Grade 10
#5.8
#5.8

Signs on a Cycle

Invariant Grade 9 Grade 10 ★★★☆☆

Signs are written at the vertices of a cycle with \(9\) vertices. In one move, choose an edge of the cycle and change the signs at both its endpoints. Initially exactly one vertex has sign \(-\). Prove that it is impossible to make all signs positive.

Details
Problem: COM-B2-M05-P008
Difficulty: Level 3 of 5
Tag: Invariant
Grade: Grade 9, Grade 10
#5.9
#5.9

Knight Moves and Colours

Coloring Grade 9 Grade 10 ★★★☆☆

A knight is to visit all squares of a \(5\times5\) board exactly once. Prove that such a path cannot be closed, meaning the last move cannot return the knight to the starting square.

Details
Problem: COM-B2-M05-P009
Difficulty: Level 3 of 5
Tag: Coloring
Grade: Grade 9, Grade 10
#5.10
#5.10

Corners of a Rectangle

Parity Grade 9 Grade 10 ★★★☆☆

On a \(6\times6\) board, all cells are white. In one move, choose a rectangle with sides along grid lines and change the colours of its four corner cells. Prove that a position with exactly one black cell cannot be obtained.

Details
Problem: COM-B2-M05-P010
Difficulty: Level 3 of 5
Tag: Parity
Grade: Grade 9, Grade 10
#5.11
#5.11

Sorting by Adjacent Swaps

Invariant Grade 9 Grade 10 ★★★☆☆

The numbers \(1,2,\ldots,n\) are arranged in an arbitrary order. If two neighbouring numbers are in the wrong order, they may be swapped. Prove that the process cannot continue forever.

Details
Problem: COM-B2-M05-P011
Difficulty: Level 3 of 5
Tag: Invariant
Grade: Grade 9, Grade 10
#5.12
#5.12

Stones Move to the Right

Process Grade 9 Grade 10 ★★★☆☆

Several stones lie on a strip of \(n\) cells. In one move, one stone may be moved one cell to the right if it is not in the \(n\)-th cell. Prove that an infinite sequence of moves is impossible.

Details
Problem: COM-B2-M05-P012
Difficulty: Level 3 of 5
Tag: Process
Grade: Grade 9, Grade 10
#5.13
#5.13

A Criterion for Signs on a Connected Graph

Invariant Grade 9 Grade 10 ★★★★☆

Signs \(+\) and \(-\) are written at the vertices of a connected graph. In one move, choose an edge and change the signs at both endpoints. Prove that all signs can be made positive if and only if the initial number of negative signs is even.

Details
Problem: COM-B2-M05-P013
Difficulty: Level 4 of 5
Tag: Invariant
Grade: Grade 9, Grade 10
#5.14
#5.14

Odd Rows and Columns

Parity Grade 9 Grade 10 ★★★★☆

On a \(10\times14\) board coloured like a chessboard, some cells are marked. In every row and every column, an odd number of cells is marked. Prove that the number of marked black cells is even.

Details
Problem: COM-B2-M05-P014
Difficulty: Level 4 of 5
Tag: Parity
Grade: Grade 9, Grade 10
Source: 102-combinatorial-problems (method inspiration)
#5.15
#5.15

Rectangle Corners: A Complete Invariant

Coloring Grade 9 Grade 10 ★★★★☆

On a \(5\times7\) board, all cells are white. In one move, choose a rectangle and change the colours of its four corner cells. Prove that in every reachable colouring, every row and every column contains an even number of black cells.

Details
Problem: COM-B2-M05-P015
Difficulty: Level 4 of 5
Tag: Coloring
Grade: Grade 9, Grade 10
#5.16
#5.16

Piles Become Almost Equal

Process Grade 9 Grade 10 ★★★★☆

Several piles contain stones. If one pile has at least \(2\) more stones than another, one may move one stone from the larger pile to the smaller pile. Prove that the process must terminate, and at the end any two pile sizes differ by at most \(1\).

Details
Problem: COM-B2-M05-P016
Difficulty: Level 4 of 5
Tag: Process
Grade: Grade 9, Grade 10
Source: 102-combinatorial-problems (method inspiration)
#5.17
#5.17

Euclid's Algorithm as a Process

GCD Grade 9 Grade 10 ★★★★☆

Two positive integers \(a\) and \(b\) are given. In one move, the larger number is replaced by the difference of the larger and the smaller. Prove that the process must reach the pair \(d,d\), where \(d=\gcd(a,b)\).

Details
Problem: COM-B2-M05-P017
Difficulty: Level 4 of 5
Tag: GCD
Grade: Grade 9, Grade 10
#5.18
#5.18

A Criterion for \(2\times2\) Blocks

Parity Grade 10 Grade 11 ★★★★★

On an \(m\times n\) board, where \(m,n\ge2\), all cells are white. In one move, choose a contiguous \(2\times2\) block and change the colours of all four of its cells. Prove that a colouring is reachable if and only if every row and every column contains an even number of black cells.

Details
Problem: COM-B2-M05-P018
Difficulty: Level 5 of 5
Tag: Parity
Grade: Grade 10, Grade 11
#5.19
#5.19

Parity on a Chessboard

Parity Grade 10 Grade 11 ★★★★★

On a \(14\times18\) board coloured like a chessboard, some cells are marked. In every row and every column, an odd number of cells is marked. Prove that the number of marked white cells is even.

Details
Problem: COM-B2-M05-P019
Difficulty: Level 5 of 5
Tag: Parity
Grade: Grade 10, Grade 11
Source: 102-combinatorial-problems (method inspiration)
#5.20
#5.20

Switching Rows and Columns

Parity Grade 10 Grade 11 ★★★★★

On an \(m\times n\) board, all cells are white. In one move, choose a row or a column and change the colours of all cells in it. Prove that every reachable colouring has the property that the corners of any rectangle contain an even number of black cells. Also prove the converse: if a colouring has this property, then it can be obtained by such moves.

Details
Problem: COM-B2-M05-P020
Difficulty: Level 5 of 5
Tag: Parity
Grade: Grade 10, Grade 11

Ladders

No published ladders were found.
Previous Chapter
Next Chapter