On this page
The invariant method is one of the most powerful heuristics in competitive mathematics. It is based on a surprisingly simple idea: if you are given a starting state and a set of allowed moves, look for a property that those moves cannot change.
If your target state has a different value for that property than your starting state, you have instantly proved that the target is unreachable. According to a 2018 study in the International Journal of Mathematical Education in Science and Technology, while this concept is vital for developing logical reasoning, it is rarely taught in standard school curricula.
What is the invariant method?
An invariant is a quantity or property that remains constant throughout a series of operations. The most famous visual example is the mutilated chessboard problem: can you cover an 8 × 8 chessboard missing two opposite corners using 31 dominoes, given that each domino covers exactly two squares?
If you try to solve this by testing arrangements, you will be checking combinations forever. The invariant method asks you to look at the colours. A standard chessboard has 32 white squares and 32 black squares. The two opposite corners of a chessboard always share the same colour. If you remove them, you are left with 32 squares of one colour and 30 of the other.
Because every domino must cover exactly one white square and one black square, any arrangement of 31 dominoes will always cover exactly 31 white squares and 31 black squares. The colour balance is your invariant. Since the mutilated board has a 30–32 split, a complete tiling is impossible.
Why do students struggle with olympiad maths?
School mathematics often focuses on applying known formulas to standard questions, like solving equations and inequalities with modulus. Olympiad mathematics, such as the JEE Advanced or the International Mathematical Olympiad, tests your ability to invent a path through an unfamiliar system.
Arthur Engel's 1998 textbook Problem-Solving Strategies is considered the definitive guide to these skills. Engel dedicated his entire first chapter solely to the invariance principle, providing 60 practice problems to train students to spot what stays the same when everything else is moving.
The struggle is not in understanding the invariant, but in knowing which one to look for. When students face a wall, they often resort to brute force. If you are stuck on these kinds of problems, the Fermi Problem Library is built for exactly this gap. Fermi's AI tutor does not just print the final answer; it holds a line of reasoning across a whole session, notices where you are stuck, and decides whether to explain, ask, or show the next step—like suggesting you check parity or modular arithmetic.
The three most common invariants
If a problem asks whether a state can be reached by a sequence of moves, check these three properties first:
Parity (Even/Odd): Does the sum or difference of the numbers always remain even or odd?
Colouring: Can you impose a grid or pattern on the problem space to restrict movement, just as you can use a grid to find roots by curve intersections?
Modular arithmetic: Does the remainder when divided by a small integer stay constant? For instance, the sum of a number's digits always has the same remainder modulo 9 as the number itself.
A worked example: The blackboard problem
Let's apply the method to a classic number puzzle.
The Problem: The numbers 1, 2, 3, ... up to 2025 are written on a blackboard. At every step, you erase any two numbers, a and b, and replace them with their absolute difference, |a − b|. You repeat this until only one number remains. Can the final number be 0?
The Solution: First, think about how the sum of the numbers on the board changes. When you erase a and b and write |a − b|, you are removing a + b from the total sum and adding |a − b|. The change to the total sum is |a − b| − (a + b).
If you test small numbers (like 5 and 3), the sum 5 + 3 = 8 is replaced by 5 − 3 = 2. The sum dropped by 6, which is an even number. Mathematically, |a − b| − (a + b) always equals −2 × min(a,b). Because the sum always decreases by an even number, its parity (whether it is even or odd) never changes. Parity is our invariant.
Next, calculate the starting state. The initial sum of the numbers from 1 to 2025 is calculated using the formula n(n+1)/2. For n = 2025, the sum is 2025 × 2026 / 2 = 2025 × 1013. Because you are multiplying two odd numbers, the initial sum is odd.
Finally, compare this with the target state. If the final number on the board is 0, the sum of the board is 0, which is an even number. Since the parity of the sum must remain odd, and 0 is even, it is impossible for the last number to be 0.
If you want to practice identifying these hidden patterns in other mathematical areas, the Fermi Concept Library contains every concept in mathematics and physics, each with its own lesson and its place in the map. Once you learn to spot invariants, seemingly impossible puzzles break open in seconds.



