🏆 Subsection I · Core International Olympiad Pillars (Chapters 1–8)
8
Olympiad Proof Strategies: Invariants, Monovariants, Coloring, Pick’s Theorem & Nim Games
♟️ Core Pillar 8 — Invariants, Extremal Principle & Combinatorial GamesIMO · NSMO · KAUST KMC · Parity, modular & algebraic invariants · Monovariants & process termination bounds · Chessboard / modular colorings & Extremal Principle · Pick's Theorem A = I + B/2 − 1 on Z² · Combinatorial Game Theory & Bouton's Nim XOR Theorem
The most memorable problems on the IMO, Saudi NSMO Stage 3, and KAUST Campus Finals ask whether a multi-step process can reach a target state, whether a board can be tiled, or which player has a forced win. None of these yield to routine calculation—they fall to invariants, monovariants, coloring obstructions, the Extremal Principle, and Nim-sum XOR game theory.
● Definition 8.1 — Invariants, Monovariants & The Extremal Principle
1. Invariant: A function \Phi(S)Φ(S) of the system state S S such that every legal move \( S \to S' \) satisfies \( \Phi(S') = \Phi(S) \). If \( \Phi(S_{\text{start}}) \ne \Phi(S_{\text{target}}) \), then \( S_{\text{target}} \) is strictly unreachable!
2. Monovariant: A discrete-valued function \( M(S) \) bounded below (e.g., \( M(S) \in \mathbb{Z}_{\ge 0} \)) that strictly decreases \( M(S') \le M(S) - 1 \) on every move. This guarantees the process must terminate in at most \( M(S_0) \) steps.
3. Extremal Principle: Among all configurations (or putative counterexamples), select the one minimizing or maximizing a well-founded quantity (e.g., minimum perimeter, minimum sum, shortest distance) to force an immediate local contradiction or constructive step.
1. Pick's Theorem: Every simple polygon \( \mathcal{P} \) whose vertices lie on the integer lattice \( \mathbb{Z}^2 \) with \( I \) strictly interior lattice points and \( B \) boundary lattice points has exact area:
\[ \operatorname{Area}(\mathcal{P}) = I + \frac{B}{2} - 1. \]
2. Bouton's Theorem for Normal-Play Nim: In Nim with heap sizes \( (a_1, a_2, \dots, a_k) \) where each turn removes \( \ge 1 \) stone from a single heap and the player taking the last stone wins, define the bitwise XOR Nim-sum \( X = a_1 \oplus a_2 \oplus \cdots \oplus a_k \). A state is a losing P-position (second player wins) iff \( X = 0 \), and a winning N-position (first player wins) iff \( X \ne 0 \)!
◆ Proof — Invariant / Non-Invariant Proof of Bouton's Nim Theorem
Partition all Nim states into \( \mathcal{Z} = \{S : X = 0\} \) and \( \mathcal{N} = \{S : X \ne 0\} \). 1. Terminal state: \( (0, 0, \dots, 0) \) has \( X = 0 \in \mathcal{Z} \). 2. Every move from \( \mathcal{Z} \) lands in \( \mathcal{N} \): Changing a single heap \( a_i \to a_i' < a_i \) changes at least one binary bit of \( a_i \) while all other \( a_j \) stay fixed, so \( X' = X \oplus a_i \oplus a_i' = a_i \oplus a_i' \ne 0 \)! 3. From any state in \( \mathcal{N} \), there exists a move into \( \mathcal{Z} \): Let \( 2^d \) be the highest-value \( 1 \)-bit of \( X \ne 0 \). At least one heap \( a_i \) must have bit \( 2^d \) equal to \( 1 \). Set \( a_i' = a_i \oplus X \): since \( a_i \) and \( a_i' \) agree above \( 2^d \) while bit \( 2^d \) flips \( 1 \to 0 \), strictly \( a_i' < a_i \), and the new Nim-sum is \( X \oplus a_i \oplus (a_i \oplus X) = 0 \)! Thus Player 1 maintains \( X = 0 \) after every turn until taking the final stone. \( \blacksquare \)
Signature Olympiad Invariants & Coloring Patterns
Operation / Problem Type
Canonical Invariant / Coloring
Why It Works
Replace \((a,b)\) with \(|a - b|\)
Sum modulo \(2\): \(\sum x_i \pmod 2\)
\(a + b \equiv a - b \equiv |a - b| \pmod 2\)
Replace \((a,b)\) with \(ab + a + b\)
Shifted product \(\prod (x_i + 1)\)
\((ab+a+b) + 1 = (a+1)(b+1)\)!
Domino tiling of mutilated chessboard
2-coloring \((i+j) \bmod 2\) (Black vs White)
Every \(1 \times 2\) domino covers 1 black + 1 white cell
\(1 \times k\) straight tile on \(m \times n\) grid
Cyclic coloring \((i + j) \bmod k\)
Every \(1 \times k\) bar covers one cell of each residue \(0,\dots,k-1\)
Boundary Lattice Points on Segment
Segment from \((x_1,y_1)\) to \((x_2,y_2)\) contains \(\gcd(|\Delta x|, |\Delta y|) + 1\) lattice points
Subtraction Game \(\{1, 2, \dots, k\}\)
Removing \(1\dots k\) stones from \(N\): P-positions are \(N \equiv 0 \pmod{k+1}\)!
Symmetry-Stealing Strategy
Place first coin at exact center of symmetric table, then mirror opponent across center!
Chomp Strategy-Stealing Proof
Player 1 wins Chomp on any \(m \times n\) bar (\(mn > 1\)) by top-right corner contradiction!
Directed game DAG for removing \(1\) or \(2\) stones: amber arrows show winning moves from \(N\)-states (\(n \not\equiv 0 \pmod 3\)) into \(P\)-states (\(n \equiv 0 \pmod 3\)), while every move out of \(6\) or \(3\) hands an \(N\)-state to the opponent.
⊙ Explorer · 3-Heap Nim XOR Binary Engine & Winning Move Finder
interactive
Bitwise binary decomposition of heaps \((A, B, C = 10)\) and live Nim-sum \(A \oplus B \oplus C\)
Parameter / Invariant
Computed Value
Nim-Sum \(A \oplus B \oplus 10\)7 ⊕ 12 ⊕ 10 = 1
Position VerdictN-Position (1st Wins)
Winning MoveHeap A: 7 → 6
Heap \(C = 10 = 1010_2\) is fixed. Adjust \(A\) and \(B\) to see when every binary column has an EVEN number of 1-bits (\(X = 0\), P-position, e.g. \(A=6, B=12, C=10\))!
Right trapezoid with vertices \((0,0), (4,0), (3,2), (0,2)\) on \(\mathbb{Z}^2\): boundary points \(B = 4 + 1 + 3 + 2 = 10\) and interior points \(I = 3\) give \(A = 3 + \frac{10}{2} - 1 = 7\), matching \(\frac{4+3}{2} \times 2 = 7\)!
Worked Example 8.A — Blackboard Algebraic Invariant (NSMO Stage 2 / KAUST KMC)
Problem. The numbers \( 1, 2, 3, 4, 5 \) are written on a whiteboard. Repeatedly, a student erases any two numbers \( a, b \) and writes \( ab + a + b \) in their place until a single number remains. Prove that the final number is independent of the sequence of choices, and find its exact value.
▸ Show step-by-step solution
Notice the shifted factorization \( (ab + a + b) + 1 = (a + 1)(b + 1) \)! Define the state function \( \Phi(x_1, \dots, x_k) = \prod_{i=1}^k (x_i + 1) \). Replacing \( a, b \) with \( c = ab + a + b \) replaces the factors \( (a+1)(b+1) \) with \( c + 1 = (a+1)(b+1) \), leaving \( \Phi \) strictly invariant! Initially, \( \Phi_{\text{start}} = (1+1)(2+1)(3+1)(4+1)(5+1) = 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6 = 720 \). When a single number \( F \) remains, \( F + 1 = \Phi_{\text{final}} = 720 \implies F = 719 \) regardless of move order!
Worked Example 8.B — 4-Color Modular Obstruction on a 10×10 Board (NSMO Finals / IMO Style)
Problem. Prove that a \( 10 \times 10 \) grid of \( 100 \) unit squares CANNOT be tiled by \( 25 \) straight \( 1 \times 4 \) tetrominoes (even though \( 25 \times 4 = 100 \)).
▸ Show step-by-step solution
Assign each cell \( (i, j) \) (\( 0 \le i, j \le 9 \)) the color \( c(i, j) = (i + j) \bmod 4 \in \{0, 1, 2, 3\} \). 1. Any horizontal or vertical \( 1 \times 4 \) tile covers \( 4 \) consecutive sums \( s, s+1, s+2, s+3 \), hence exactly one cell of each color \( 0, 1, 2, 3 \). Thus \( 25 \) tiles would cover \( (25, 25, 25, 25) \) cells of the four colors. 2. Count color \( 2 \) on the \( 10 \times 10 \) board! In row \( 0 \), colors are \( 0,1,2,3,0,1,2,3,0,1 \) (three \( 0 \)s, three \( 1 \)s, two \( 2 \)s, two \( 3 \)s). Across the \( 10 \) rows (two full \( 4 \)-row blocks + rows \( 8, 9 \)), the exact counts of colors \( (0, 1, 2, 3) \) are \( (25, 26, 25, 24) \)! Since \( 26 \ne 25 \), no tiling can exist! \( \blacksquare \)
Worked Example 8.C — Pick's Theorem for a Tilted Lattice Triangle (AMC 12 / KAUST KMC)
Problem. Triangle \( OAB \) has vertices \( O(0,0),\; A(6, 4), \) and \( B(2, 8) \). How many integer lattice points \( (x, y) \in \mathbb{Z}^2 \) lie strictly inside \( \triangle OAB \)?
▸ Show step-by-step solution
1. Exact Area via Shoelace / Determinant: \( \operatorname{Area}(OAB) = \frac{1}{2}|6(8) - 4(2)| = \frac{1}{2}(48 - 8) = 20 \). 2. Boundary Lattice Points \( B \): On each side, interior edge points equal \( \gcd(|\Delta x|, |\Delta y|) - 1 \), so summing \( \gcd(|\Delta x|, |\Delta y|) \) over all three edges counts every boundary point once: \[ B = \gcd(6, 4) + \gcd(4, 4) + \gcd(2, 8) = 2 + 4 + 2 = 8. \] 3. Pick’s Theorem \( A = I + \frac{B}{2} - 1 \): \[ 20 = I + \frac{8}{2} - 1 = I + 3 \implies I = 17 \text{ strictly interior lattice points!} \]
Worked Example 8.D — Finding All Winning First Moves in 3-Heap Nim (Olympiad Games)
Problem. Three heaps of stones contain \( (9, 12, 15) \) stones in standard Nim. Determine which player has a winning strategy, and find the exact winning first move(s).
▸ Show step-by-step solution
Convert each heap to 4-bit binary and compute the bitwise XOR \( X = 9 \oplus 12 \oplus 15 \): • \( 9 = 1001_2 \) • \( 12 = 1100_2 \) • \( 15 = 1111_2 \) Adding mod 2 column-by-column: \( X = 1010_2 = 10 \ne 0 \). Thus the first player wins! The highest \( 1 \)-bit of \( X = 1010_2 \) is \( 2^3 = 8 \). Which heaps have bit \( 2^3 \) set to \( 1 \)? All three (\( 9, 12, 15 \))! Compute \( a_i' = a_i \oplus 10 \) for each: • Heap 1: \( 9 \oplus 10 = 1001_2 \oplus 1010_2 = 0011_2 = 3 < 9 \) (valid: remove \( 6 \) from \( 9 \)); • Heap 2: \( 12 \oplus 10 = 1100_2 \oplus 1010_2 = 0110_2 = 6 < 12 \) (valid: remove \( 6 \) from \( 12 \)); • Heap 3: \( 15 \oplus 10 = 1111_2 \oplus 1010_2 = 0101_2 = 5 < 15 \) (valid: remove \( 10 \) from \( 15 \)). All 3 moves leave a zero-XOR state (\( (3,12,15),\; (9,6,15), \) or \( (9,12,5) \))!
⚠ Olympiad Trap — Necessary Invariant Match Does NOT Prove Reachability by Itself!
An invariant mismatch \( \Phi(S_0) \ne \Phi(S_{\text{target}}) \) is a 100% proof of impossibility. However, if \( \Phi(S_0) = \Phi(S_{\text{target}}) \), you MUST still exhibit an explicit sequence of moves (or inductive construction) to prove \( S_{\text{target}} \) is reachable!
▲ Contest Strategy — Spotting Monovariants When Numbers Split or Merge
When an operation splits an integer \( n = a + b \) and records \( ab \), test the quadratic potential \( \Phi = \sum x_i^2 \): since \( (a+b)^2 - (a^2 + b^2) = 2ab \), the sum of all recorded products across ANY sequence of splits down to \( 1 \)s is always \( \frac{N^2 - N}{2} = \binom{N}{2} \)!
[Practice 8.1 · NSMO Stage 1 / Easy] A pile starts with \( 100 \) stones. Players alternate removing \( 1, 2, 3, \) or \( 4 \) stones; whoever takes the last stone wins. How many stones must Player 1 remove on the very first turn to guarantee victory?
💡 Hint 1 of 3
In subtraction game \( \{1, 2, 3, 4\} \), the losing P-positions are multiples of \( 4 + 1 = 5 \).
💡 Hint 2 of 3
Check whether \( 100 \) is already divisible by \( 5 \)!
💡 Hint 3 of 3
What happens if Player 1 removes \( m \in \{1,2,3,4\} \) stones from \( 100 \)? Player 2 replies with \( 5 - m \)!
Since \( 100 \equiv 0 \pmod 5 \), \( 100 \) is ALREADY a losing P-position! Whatever \( m \in \{1,2,3,4\} \) Player 1 removes, Player 2 removes \( 5 - m \) stones to maintain multiples of \( 5 \) down to \( 0 \). Thus Player 2 wins (Player 1 has \( 0 \) winning moves).
[Practice 8.2 · KAUST KMC Regional / Easy] Start with a single pile of \( 15 \) coins. At each step you split any pile of size \( > 1 \) into two smaller piles \( a \) and \( b \) and add \( ab \) points to your score, stopping when \( 15 \) piles of size \( 1 \) remain. What is your final score?
💡 Hint 1 of 3
Track the invariant \( \text{Score} + \frac{1}{2}\sum x_i^2 \)!
💡 Hint 2 of 3
Check one split \( (a+b) \to a, b \): \( ab + \frac{a^2+b^2}{2} = \frac{(a+b)^2}{2} \).
💡 Hint 3 of 3
Equate initial \( 0 + \frac{15^2}{2} \) to final \( S + 15 \cdot \frac{1^2}{2} \) (equivalently \( \binom{15}{2} \)).
Every pair of coins is separated on exactly one split (or via the invariant \( S + \frac{1}{2}\sum x_i^2 = \frac{15^2}{2} \)), so the final score is always \( \binom{15}{2} = \frac{15 \times 14}{2} = 105 \).
[Practice 8.3 · NSMO Stage 2 / Medium] A lattice polygon has area \( 29 \) and exactly \( 12 \) lattice points on its boundary. How many lattice points lie strictly in its interior?
💡 Hint 1 of 3
Apply Pick’s Theorem \( A = I + \frac{B}{2} - 1 \).
💡 Hint 2 of 3
Substitute \( A = 29 \) and \( B = 12 \).
💡 Hint 3 of 3
Solve \( 29 = I + 6 - 1 \) for \( I \).
By Pick’s Theorem, \( 29 = I + \frac{12}{2} - 1 = I + 5 \implies I = 24 \) interior lattice points.
[Practice 8.4 · AMC 12 / KAUST KMC / Hard] In 3-heap Nim with initial heaps \( (6, 11, 14) \), how many stones must Player 1 remove, and from which heap, to guarantee a win?
💡 Hint 1 of 3
Compute \( X = 6 \oplus 11 \oplus 14 \) in 4-bit binary (\( 0110_2 \oplus 1011_2 \oplus 1110_2 \)).
💡 Hint 2 of 3
Find \( X = 0011_2 = 3 \), whose highest \( 1 \)-bit is \( 2^1 = 2 \).
💡 Hint 3 of 3
Compute \( a_i \oplus 3 \) for each heap and pick the unique one with \( a_i \oplus 3 < a_i \)? Check all three: \( 6 \oplus 3 = 5 < 6 \), \( 11 \oplus 3 = 8 < 11 \), \( 14 \oplus 3 = 13 < 14 \)! All three have bit \( 2^1 \) set!
Here \( X = 0110_2 \oplus 1011_2 \oplus 1110_2 = 0011_2 = 3 \). Since bit \( 2^1 \) is \( 1 \) in all three heaps, Player 1 has three winning options: remove \( 1 \) from \( 6 \) (leaving \( 5,11,14 \)), remove \( 3 \) from \( 11 \) (leaving \( 6,8,14 \)), or remove \( 1 \) from \( 14 \) (leaving \( 6,11,13 \)).
[Practice 8.5 · NSMO National Finals / IMO Classic] A chameleon island has \( 13 \) red, \( 15 \) green, and \( 17 \) blue chameleons. Whenever two chameleons of DIFFERENT colors meet, both change to the third color. Can all \( 45 \) chameleons ever become the same color?
💡 Hint 1 of 3
Track the pairwise differences \( (R - G, G - B, B - R) \) modulo \( 3 \)!
💡 Hint 2 of 3
On a meeting of Red + Green \( \to 2 \) Blue: \( (R, G, B) \to (R-1, G-1, B+2) \). How does \( G - R \pmod 3 \) or \( B - G \pmod 3 \) change?
Every meeting shifts \( (R, G, B) \) by a permutation of \( (-1, -1, +2) \), so all pairwise differences \( R - G,\; G - B,\; B - R \pmod 3 \) are strictly invariant! Initially \( (13, 15, 17) \equiv (1, 0, 2) \pmod 3 \) (no two counts are congruent mod 3), whereas a monochromatic state \( (45, 0, 0) \) has two equal counts \( 0 \equiv 0 \pmod 3 \). Contradiction—so it is impossible!
Olympiad Proof Strategies: Invariants, Monovariants, Coloring, Pick’s Theorem & Nim Games — Competition Proof Benchmark
6 pts
No Calculator
For positive integer \(n\) and quadratic \(P(x) = x^2 + 5x + 26\) in Olympiad Proof Strategies: Invariants, Monovariants, Coloring, Pick’s Theorem & Nim Games, examine algebraic invariants below.
(a)2 pts
Express \(4P(x)\) as a square plus a positive constant.
Scoring Guideline & Justification
[M1]Completes square on 4x^2 + 20x(1 pt)
[A1]Obtains (2x + 5)^2 + 79(1 pt)
(b)2 pts
Deduce why \(P(n)\) has no real roots for any \(n\in\mathbb{R}\).
Scoring Guideline & Justification
[M1]Bounds squared term >= 0(1 pt)
[A1]Proves strict positivity for all real x(1 pt)
(c)2 pts
Find the remainder when \(P(10) - P(0)\) is divided by \(10\).