Discrete MathematicsMathematical Induction5 of 5
Mathematical Induction · 5

Invariants and Monovariants

When a step-by-step process branches into millions of possible paths, we need a way to tell what outcomes can happen and whether the process ever has to stop.

1

What Is an Invariant?

An invariant is a quantity or property of a system that stays unchanged across every valid move.

Suppose the numbers 1,2,3,…,101, 2, 3, \dots, 10 are written on a board. On each turn, we pick any two numbers a\before{a} and b\before{b} (with a≥b\before{a} \ge \before{b}), erase them, and write their difference a−b\before{a} - \before{b} in their place. After 99 turns, only one number is left on the board. Can we choose our moves so that the final number is 0\target{0}?

What Is an Invariant?
pick two  →  bigger−smaller\text{pick two} \;\to\; \text{bigger} - \text{smaller}
11
22
33
44
55
66
77
88
99
1010
last number=0 ?\text{last number} = \htmlClass{lc-pink}{0\,?}
Text solution
Compare the board's sum before and after one moveErasing a\before{a} and b\before{b} and writing a−b\before{a} - \before{b} reduces the total sum of the board by 2b\change{2b}, which is always an even number for any whole number b\before{b}.
(sum of other numbers)+a+b−2b\displaystyle (\text{sum of other numbers}) + \before{a} + \before{b} \change{- 2b} =(sum of other numbers)+(a−b)\displaystyle = (\text{sum of other numbers}) + (\before{a} - \before{b})
Add the starting numbersBefore any moves are made, the sum of the ten numbers on the board is odd.
1+2+3+⋯+10\displaystyle 1 + 2 + 3 + \dots + 10 =55(odd)\displaystyle = \before{55} \quad (\invariant{\text{odd}})
Track the parity to the last numberBecause subtracting an even amount 2b\change{2b} from an odd sum always leaves an odd sum, induction on the number of moves guarantees that the single number remaining after 99 turns is odd and cannot be 0\target{0}.
odd−2b\displaystyle \invariant{\text{odd}} \change{- 2b} =odd≠0\displaystyle = \invariant{\text{odd}} \neq \target{0}

Different choices of pairs lead to different final numbers, but the parity of the sum never changes.

Every pair you combine takes an even amount off the total sum, so the last number left on the board is always odd.
2

Three Ways Invariants Hide

Parity works when every move changes a count by a multiple of 22, but what if a move jumps by a different step size, places tiles on a grid, or combines numbers with multiplication? We find the invariant by checking a single step to see what that specific rule leaves unchanged.

Let's test three situations where parity alone isn't enough:

Three Ways Invariants Hide
1 sheet\htmlClass{lc-blue}{1} \text{ sheet}
tear 1 piece into 4 or 7\text{tear } 1 \text{ piece into } 4 \text{ or } 7
200 pieces?\htmlClass{lc-pink}{200} \text{ pieces?}
62 squares62 \text{ squares}
31 dominoes31 \text{ dominoes}
tile it?\text{tile it?}
1,2,…,101, 2, \ldots, 10
a,b  →  ab+a+b\htmlClass{lc-blue}{a}, \htmlClass{lc-blue}{b} \;\to\; \htmlClass{lc-blue}{a}\htmlClass{lc-blue}{b} + \htmlClass{lc-blue}{a} + \htmlClass{lc-blue}{b}
last number=  ?\text{last number} = \;?

1. Paper tearing (11 sheet to 200200 pieces)

Text solution
Find the net change of one tearTearing 11 piece into 44 or 77 pieces removes 11 piece and adds 44 or 77, which always changes the total count by a multiple of 33.
−1+4=+3−1+7=+6\displaystyle \begin{aligned} -1 + 4 &= \change{+3} \\ -1 + 7 &= \change{+6} \end{aligned}
Compare remainders when dividing by 33Adding a multiple of 33 keeps the remainder when divided by 33 fixed at its starting value of 1\invariant{1}, so the piece count can never land on 200\target{200}.
1=3×0+1(remainder 1)200=3×66+2(remainder 2≠1)\displaystyle \begin{aligned} \before{1} &= 3 \times 0 \invariant{+ 1} \\ &\quad (\text{remainder } \invariant{1}) \\ \target{200} &= 3 \times 66 \fails{+ 2} \\ &\quad (\text{remainder } \fails{2} \neq \invariant{1}) \end{aligned}

2. Domino tiling (8×88 \times 8 grid missing opposite corners)

32 black32 \text{ black}
30 white30 \text{ white}
1 black1 \text{ black}
1 white1 \text{ white}
Text solution
Color the grid like a checkerboard and check one dominoBecause any two adjacent squares have opposite colors, each domino you place covers 11 black square and 11 white square, keeping the difference between covered black and covered white squares at 00.
covered black−covered white\displaystyle \invariant{\text{covered black} - \text{covered white}} =0\displaystyle = 0
Count the remaining squares of each colorOpposite corners of an 8×88 \times 8 checkerboard have the same color (both white), so the 3131 dominoes cannot match the remaining board.
32 black−30 white\displaystyle 32 \text{ black} - 30 \text{ white} =2≠0\displaystyle = \fails{2} \neq 0

3. Replacing aa and bb with ab+a+bab + a + b

Text solution
Add 11 to factor the replacement valueAdding 11 to the new number ab+a+b\before{a}\before{b} + \before{a} + \before{b} turns it into the product of (a+1)\invariant{(a + 1)} and (b+1)\invariant{(b + 1)}.
(ab+a+b)+1\displaystyle (\before{a}\before{b} + \before{a} + \before{b}) + 1 =(a+1)(b+1)\displaystyle = \invariant{(a + 1)}\invariant{(b + 1)}
Multiply the values x+1\invariant{x + 1} across the boardBecause each move replaces (a+1)\invariant{(a + 1)} and (b+1)\invariant{(b + 1)} with their product (a+1)(b+1)\invariant{(a + 1)}\invariant{(b + 1)}, the product of (x+1)\invariant{(x + 1)} over all numbers on the board stays constant from the ten starting numbers down to the single final number xfinalx_{\text{final}}.
xfinal+1=(1+1)(2+1)⋯(10+1)=11!xfinal=11!−1\displaystyle \begin{aligned} &\invariant{x_{\text{final}} + 1} \\ &\quad = \invariant{(1 + 1)}\invariant{(2 + 1)}\cdots\invariant{(10 + 1)} \\ &\quad = 11! \\ &x_{\text{final}} = 11! - 1 \end{aligned}
3

Monovariants: Proving a Process Stops

An invariant can prove that a target state is impossible, but because it stays constant, it cannot tell us whether a process eventually stops or loops forever. A monovariant is a quantity that moves in only one direction: it never decreases on any move, or it never increases on any move.

Suppose a 5×55 \times 5 grid is filled with positive and negative numbers. Whenever a row or column has a negative sum, you may flip the sign of every number in that row or column. Flipping a row can turn crossing columns negative again. Must this process eventually stop with every row and column having a nonnegative sum?

Monovariants: Proving a Process Stops
3322−2-2−6-6−3-3
−6\htmlClass{lc-orange}{-6}
77−8-8558822
1414
3355−5-577−4-4
66
337755−4-477
1818
44−3-311−4-466
44
202033441188
a sum<0  ⇒  flip every sign\text{a sum} \htmlClass{lc-orange}{< 0} \;\Rightarrow\; \htmlClass{lc-pink}{\text{flip every sign}}
Does it ever stop?\text{Does it ever stop?}
Text solution
Find the change in the grand total across one flipFlipping a row or column whose sum is −S\fails{-S} (with S>0S > 0) changes that row or column's sum to +S+S while leaving all other entries unchanged, so the grand total of all 2525 numbers strictly increases.
new grand total−old grand total\displaystyle \monovariant{\text{new grand total}} - \monovariant{\text{old grand total}} =S−(−S)\displaystyle = S - (\fails{-S}) =+2S>0\displaystyle = \change{+2S} > 0
Count the possible sign patternsEach of the 2525 entries only ever takes its starting value or its opposite, so there are finitely many states the grid can visit; because the grand total strictly increases, no state repeats, and the process must eventually stop.
possible grid states\displaystyle \text{possible grid states} ≤225\displaystyle \le 2^{25}

Flipping a row or column can undo progress in the crossing ones, but the grand total of the whole board goes up on every move.

Flipping a negative row or column can turn a crossing sum negative, yet every flip raises the grand total until all the sums are positive.
4

Building Monovariants from Positions and Pairs

In the grid puzzle, the grand total went up on every move. What if a move only rearranges pieces, so the total count of each piece stays the same? Then we build a monovariant from where the pieces sit or how pairs of pieces are ordered.

Ten people stand in a single-file line, each facing either left (LL) or right (RR). Whenever two neighbors are facing each other (RR on the left, LL on the right), both turn 180∘180^\circ around (LL on the left, RR on the right). Must all this turning eventually stop?

Building Monovariants from Positions and Pairs
RR
RR
LL
RR
LL
LL
RR
RR
LL
LL
…R L…  ⟶  …L R…\ldots R\,L \ldots \;\longrightarrow\; \ldots L\,R \ldots
Must the turning stop?\text{Must the turning stop?}
Text solution
View one turn as two neighbors walking past each otherTurning an adjacent facing pair R LR\,L into L RL\,R moves the RR one spot to the right and the LL one spot to the left.
R L⟶L R\displaystyle R\,L \longrightarrow L\,R
Method 1: Add the floor numbers under the RR'sNumbering the floor spots 11 through 1010 from left to right, each move shifts one RR from spot k\before{k} to spot k+1\change{k + 1}, increasing the sum of the RR floor positions by 1\change{1} toward a fixed maximum.
(k+1)−k\displaystyle (\change{k + 1}) - \before{k} =+1\displaystyle = \change{+1}
Method 2: Count facing pairs anywhere in the lineTurning an adjacent R LR\,L into L RL\,R resolves that facing pair without changing how either person faces anyone else in the line, so the nonnegative whole number of facing pairs drops by 1\change{1} each move, and the turning must stop by the well-ordering principle.
new facing pairs\displaystyle \monovariant{\text{new facing pairs}} =old facing pairs−1\displaystyle = \monovariant{\text{old facing pairs}} \change{- 1} ≥0\displaystyle \ge 0

Each turn moves an RR one spot to the right and resolves one facing pair, giving us two ways to see that the turning must stop.

Every turn of an adjacent facing pair steps an RR one floor spot to the right and removes one facing pair, until no move remains.
5

Bounding How Far a Process Can Go

A monovariant doesn't just prove that a process stops. If a quantity can never increase, its starting value puts a ceiling on every state the process can ever reach.

On a 10×1010 \times 10 grid, 9\before{9} squares start infected. At each step, any healthy square that shares at least 22 edges with already-infected squares becomes infected too. Can you place the 9\before{9} starting squares so that the infection spreads to all 100\target{100} squares?

Bounding How Far a Process Can Go
all 100 ?\text{all } \htmlClass{lc-pink}{100}\,?
9 infected\htmlClass{lc-blue}{9} \text{ infected}
a healthy square with≥2\text{a healthy square with} \ge 2
infected neighbors  →  infected\text{infected neighbors} \;\to\; \text{infected}
shares 2 edges\text{shares 2 edges}
−2+2=0-2 + 2 = \htmlClass{lc-pink}{0}
shares 3 edges\text{shares 3 edges}
−3+1=−2-3 + 1 = \htmlClass{lc-pink}{-2}
shares 4 edges\text{shares 4 edges}
−4+0=−4-4 + 0 = \htmlClass{lc-pink}{-4}
Text solution
Track the perimeter of the infected region across one stepA newly infected square has 44 edges and shares 22, 33, or 44 of them with the existing infected region, so erasing the shared internal edges and adding the remaining outer edges never increases the perimeter. Squares infected in the same step can be added one at a time, since each still shares at least 22 edges with squares infected before that step.
Δ(perimeter)={−2+2=0(shares 2 edges)−3+1=−2(shares 3 edges)−4+0=−4(shares 4 edges)\displaystyle \change{\Delta}(\monovariant{\text{perimeter}}) = \begin{cases} -2 + 2 = \change{0} & (\text{shares } 2 \text{ edges}) \\ -3 + 1 = \change{-2} & (\text{shares } 3 \text{ edges}) \\ -4 + 0 = \change{-4} & (\text{shares } 4 \text{ edges}) \end{cases}
Compare the starting perimeter with the full grid's perimeterNine squares have at most 9×4=369 \times 4 = \before{36} boundary edges at the start, and because the perimeter never increases, it can never reach the full 10×1010 \times 10 grid's perimeter of 40\target{40}.
starting perimeter\displaystyle \monovariant{\text{starting perimeter}} ≤9×4\displaystyle \le 9 \times 4 =36<40\displaystyle = \before{36} < \target{40} =10+10+10+10\displaystyle = 10 + 10 + 10 + 10

As the infected area grows, its perimeter never increases, so the starting perimeter caps how far the infection can spread.

Each new square erases at least as many boundary edges as it adds, so the boundary never grows.

Key concepts

When a process has only a couple of steps or no branching choices, you don't need an invariant; just run the steps directly. Use an invariant or monovariant when choices branch out and you need a guarantee that holds across every possible path, starting by writing down the Before and After of a single move.

To prove a target state is impossible (or that every path ends at the same final value), look for an invariant, a quantity whose net change on every move is 0\change{0}:

Constant divisor in the step size

If every move changes a count by a multiple of kk, track the remainder when divided by kk (for a,b→a−b\before{a}, \before{b} \to \before{a} - \before{b}, the sum changes by −2b\change{-2b}, keeping parity fixed; for tearing 11 piece into 44 or 77, the count changes by +3\change{+3} or +6\change{+6}, keeping the remainder when divided by 33 fixed).

Grid tiling

Color the squares so each tile covers a fixed balance of colors (on a checkerboard, a 1×21 \times 2 domino always covers 11 black and 11 white square, so black−white=0\invariant{\text{black} - \text{white}} = 0).

Algebraic combinations

When a move combines a\before{a} and b\before{b} into ab+a+b\before{a}\before{b} + \before{a} + \before{b}, add 11 to factor (ab+a+b)+1=(a+1)(b+1)(\before{a}\before{b} + \before{a} + \before{b}) + 1 = \invariant{(a + 1)}\invariant{(b + 1)}, so the product of (x+1)\invariant{(x + 1)} across the board stays constant.

To prove a process must stop or to bound how far it can go, look for a monovariant, a quantity that moves in only one direction (Δ>0\change{\Delta} > 0, Δ<0\change{\Delta} < 0, or Δ≤0\change{\Delta} \le 0):

Sign or value flips

Track the grand total of the whole board (flipping a row of sum −S\fails{-S} to +S+S changes the grand total by +2S>0\change{+2S} > 0 across at most 2252^{25} states).

Shifts or swaps with an unchanged total count

Weight the positions by 1,2,…,n\monovariant{1, 2, \dots, n} or 2k\monovariant{2^k} (turning R L→L RR\,L \to L\,R adds +1\change{+1} to the RR floor positions), or count out-of-order pairs so each swap drops a nonnegative whole number by 1\change{1} (which must stop by the well-ordering principle).

Growing regions on a grid

Track the perimeter when area grows (infecting a square touching ≥2\ge 2 edges changes the perimeter by 0\change{0}, −2\change{-2}, or −4\change{-4}, keeping perimeter≤36<40\monovariant{\text{perimeter}} \le \before{36} < \target{40}).

6

Practice

1

A bowl starts with 3\before{3} tokens. On each turn, you may either remove 11 token and add 66 tokens, or remove 77 tokens and add 22 tokens (whenever at least 77 tokens are in the bowl). Can you ever reach exactly 1000\target{1000} tokens in the bowl?

Find the net change in the token count for each of the two moves. What number divides both changes?

Find the net change of one moveRemoving 11 and adding 66 changes the count by −1+6=+5-1 + 6 = \change{+5}, and removing 77 and adding 22 changes the count by −7+2=−5-7 + 2 = \change{-5}.
Δ(tokens)\displaystyle \change{\Delta}(\text{tokens}) =+5 or −5\displaystyle = \change{+5} \text{ or } \change{-5}
Compare remainders when dividing by 55Because every move changes the total by a multiple of 55, the remainder when the token count is divided by 55 is an invariant. (Watch out for the slip of seeing that 1000\target{1000} is a multiple of 55 and answering Yes because each turn adds 5\change{5}, which forgets the bowl starts at 3\before{3} rather than 0\fails{0}, or the slip of checking even/odd parity and concluding +5\change{+5} can turn an odd count even.)
3=5×0+3(remainder 3)1000=5×200+0(remainder 0≠3)\displaystyle \begin{aligned} \before{3} &= 5 \times 0 \invariant{+ 3} \\ &\quad (\text{remainder } \invariant{3}) \\ \target{1000} &= 5 \times 200 \fails{+ 0} \\ &\quad (\text{remainder } \fails{0} \neq \invariant{3}) \end{aligned}
No.
2

A jar contains 25\before{25} white marbles and 3030 black marbles. On each turn, you draw two marbles: if they are the same color, you discard both and put 11 black marble into the jar; if they are different colors, you discard both and put 11 white marble into the jar. After 5454 turns, only 11 marble remains. What color must it be?

Write down the net change to the number of white marbles in each of the three draw cases (WWWW, BBBB, and WBWB).

Check the change in white marbles on one turnDrawing two white marbles (WWWW) removes 2\change{2} white marbles; drawing two black marbles (BBBB) removes 0\change{0} white marbles; drawing one of each (WBWB) removes 11 white marble and puts 11 white marble back, changing the white count by −1+1=0-1 + 1 = \change{0}. (Watch out for answering Black just because there are more black marbles at the start (30>2530 > \before{25}); what decides the last marble is the parity of the white count.)
Δ(white)={−2(draw WW)0(draw BB)−1+1=0(draw WB)\displaystyle \change{\Delta}(\text{white}) = \begin{cases} \change{-2} & (\text{draw } WW) \\ \change{0} & (\text{draw } BB) \\ -1 + 1 = \change{0} & (\text{draw } WB) \end{cases}
Track the parity of the white marblesBecause the number of white marbles changes by an even number (−2\change{-2} or 0\change{0}) on every turn, its parity is an invariant; starting at 25\before{25} (odd), the final 11 marble left after 5454 turns must include an odd number of white marbles (11).
25 white (odd)⟶1 white (odd)\displaystyle \before{25} \text{ white } (\invariant{\text{odd}}) \longrightarrow 1 \text{ white } (\invariant{\text{odd}})
White.
3

A T-tetromino is a tile made of 44 squares: one middle square and three squares that each share an edge with that middle square. Can you tile a 6×66 \times 6 grid using 99 T-tetrominoes?

Color the 6×66 \times 6 grid like a checkerboard: if a T-tetromino's middle square lands on one color, what color must its three outer squares land on?

Count the black squares covered by one T-tetrominoOn a checkerboard coloring of the 6×66 \times 6 grid (18\target{18} black and 1818 white squares), the three outer squares of any T-tetromino share an edge with its middle square and therefore all have the color opposite to the middle square, so every T-tetromino covers either 11 black and 33 white squares, or 33 black and 11 white squares.
black squares per tile\displaystyle \text{black squares per tile} =1 or 3(always odd)\displaystyle = 1 \text{ or } 3 \quad (\text{always } \invariant{\text{odd}})
Add the black squares across all 99 tilesPlacing 99 T-tetrominoes covers a sum of 99 odd numbers of black squares, which is always odd and cannot equal the grid's 18\target{18} black squares. (Watch out for the slip of only checking the total area 36÷4=936 \div 4 = 9, or assuming that 33-black and 11-black tiles can balance out to 18\target{18}, which gives the wrong answer Yes; with 99 tiles, the closest you can get is 5(3)+4(1)=195(3) + 4(1) = \fails{19} or 4(3)+5(1)=174(3) + 5(1) = \fails{17} black squares.)
odd+odd+⋯+odd⏟9 tiles\displaystyle \underbrace{\invariant{\text{odd}} + \invariant{\text{odd}} + \dots + \invariant{\text{odd}}}_{9 \text{ tiles}} =odd≠18\displaystyle = \invariant{\text{odd}} \neq \target{18}
No.
4

The numbers 2,3,4,5,62, 3, 4, 5, 6 are written on a board. On each turn, you pick any two numbers a\before{a} and b\before{b}, erase them, and write ab−a−b+2\before{a}\before{b} - \before{a} - \before{b} + 2 in their place. What is the final number left on the board after 44 turns?

Subtract 11 from the replacement formula ab−a−b+2\before{a}\before{b} - \before{a} - \before{b} + 2 and factor the result.

Subtract 11 to factor the replacement valueSubtracting 11 from the new number ab−a−b+2\before{a}\before{b} - \before{a} - \before{b} + 2 gives the product of (a−1)\invariant{(a - 1)} and (b−1)\invariant{(b - 1)}, so the product of (x−1)\invariant{(x - 1)} across all numbers on the board is an invariant.
(ab−a−b+2)−1\displaystyle (\before{a}\before{b} - \before{a} - \before{b} + 2) - 1 =ab−a−b+1\displaystyle = \before{a}\before{b} - \before{a} - \before{b} + 1 =(a−1)(b−1)\displaystyle = \invariant{(a - 1)}\invariant{(b - 1)}
Equate the starting and ending products of (x−1)\invariant{(x - 1)}Subtracting 11 from the starting numbers 2,3,4,5,62, 3, 4, 5, 6 gives 1,2,3,4,5\invariant{1, 2, 3, 4, 5}, whose product equals x−1\invariant{x - 1} for the final number xx. (Watch out for the slip of stopping at the invariant product 120120 without adding 11 back, which gives the wrong answer 120\fails{120}, or subtracting 11 at the end to get 119\fails{119}.)
x−1=(2−1)(3−1)(4−1)(5−1)(6−1)=1×2×3×4×5=120x=120+1=121\displaystyle \begin{aligned} \invariant{x - 1} &= \invariant{(2 - 1)}\invariant{(3 - 1)}\invariant{(4 - 1)}\invariant{(5 - 1)}\invariant{(6 - 1)} = 1 \times 2 \times 3 \times 4 \times 5 = 120 \\ x &= 120 + 1 = 121 \end{aligned}
121121
5

The numbers 8,7,6,5,4,3,2,18, 7, 6, 5, 4, 3, 2, 1 are written in a row. On each move, you may pick any two adjacent numbers where the left number is larger than the right number and swap them. Prove that this process must stop, and find the exact number of moves it takes until no more moves can be made.

Count all out-of-order pairs (a,b)(a, b) anywhere in the row (with a>ba > b and aa to the left of bb), and see how one adjacent swap changes that total.

Track out-of-order pairs across one adjacent swapSwapping two adjacent numbers with a>ba > b puts that one pair into increasing order without changing the relative order of any other pair in the row, so the number of out-of-order pairs drops by 1\change{1} on every move and must reach 0\target{0} by the well-ordering principle.
new out-of-order pairs\displaystyle \monovariant{\text{new out-of-order pairs}} =old out-of-order pairs−1\displaystyle = \monovariant{\text{old out-of-order pairs}} \change{- 1}
Count the starting out-of-order pairsIn 8,7,6,5,4,3,2,18, 7, 6, 5, 4, 3, 2, 1, every pair of distinct numbers is out of order, and the process stops only when the row is completely sorted (0\target{0} out-of-order pairs). (Watch out for the slip of counting only the 77 adjacent out-of-order pairs at the start to get 7\fails{7}, or forgetting to divide 8×78 \times 7 by 22 and getting 56\fails{56}.)
total moves\displaystyle \text{total moves} =8×72−0\displaystyle = \before{\frac{8 \times 7}{2}} - \target{0} =28\displaystyle = 28
2828
6

Ten boxes are lined up in a row, numbered 11 through 1010 from left to right, with some coins distributed among them. On each move, you may take 11 coin from any box kk with k≥3k \ge 3 and replace it with 11 coin in box k−1k - 1 and 11 coin in box k−2k - 2. Although the total number of coins increases by 11 on every move, prove that this process must eventually stop.

Because 11 coin in box kk becomes 22 coins in boxes k−1k - 1 and k−2k - 2, give each coin in box kk a weight of 2k\monovariant{2^k} and check the net change in total weight on one move.

Weight each coin in box kk by 2k\monovariant{2^k} and check one moveRemoving 11 coin of weight 2k\monovariant{2^k} and adding coins of weights 2k−1\monovariant{2^{k-1}} and 2k−2\monovariant{2^{k-2}} decreases the total weight of all coins on every move. (Watch out for the slip of using simple box numbers kk as weights: a move from box kk changes the sum of box numbers by (k−1)+(k−2)−k=k−3(k - 1) + (k - 2) - k = \fails{k - 3}, which equals 0\fails{0} when k=3k = 3 and fails to decrease when coins split out of box 33.)
Δ(weight)\displaystyle \change{\Delta}(\monovariant{\text{weight}}) =2k−1+2k−2−2k\displaystyle = \monovariant{2^{k-1}} + \monovariant{2^{k-2}} - \monovariant{2^k} =(2+1−4)2k−2\displaystyle = (2 + 1 - 4)2^{k-2} =−2k−2\displaystyle = \change{-2^{k-2}} ≤−2\displaystyle \le \change{-2}
Apply the well-ordering principleBecause the total weight is a nonnegative whole number that drops by at least 2\change{2} on every valid move (since k≥3k \ge 3), the process must stop in finitely many moves.
weightafter\displaystyle \monovariant{\text{weight}_{\text{after}}} ≤weightbefore−2(must stop)\displaystyle \le \monovariant{\text{weight}_{\text{before}}} \change{- 2} \quad (\text{must stop})
7

On a 6×66 \times 6 grid, 10\before{10} squares start infected. Each step, a healthy square becomes infected if it shares an edge with at least 33 already-infected squares. Prove that no matter how the 10\before{10} starting squares are placed, the infection can never spread to the entire 6×66 \times 6 grid.

Find how much the perimeter of the infected region changes on a single step when a new square shares 33 or 44 edges with it, and add that change across all 36−10=2636 - 10 = 26 squares that still need to be infected.

Find the perimeter change on one infection stepA newly infected square has 44 edges and must share 33 or 44 of them with the infected region, so the perimeter drops by at least 2\change{2} for every newly infected square (squares infected in the same step can be added one at a time, since each already shares at least 33 edges with squares infected before that step).
Δ(perimeter)={−3+1=−2(shares 3 edges)−4+0=−4(shares 4 edges)≤−2\displaystyle \change{\Delta}(\monovariant{\text{perimeter}}) = \begin{cases} -3 + 1 = \change{-2} & (\text{shares } 3 \text{ edges}) \\ -4 + 0 = \change{-4} & (\text{shares } 4 \text{ edges}) \end{cases} \le \change{-2}
Bound the perimeter after 2626 stepsThe 10\before{10} starting squares have perimeter at most 10×4=4010 \times 4 = \before{40}, and infecting the remaining 36−10=2636 - 10 = 26 squares lowers the perimeter by at least 2×26=522 \times 26 = \change{52}, which can never equal the full 6×66 \times 6 grid's perimeter of 24\target{24}. (Watch out for the slip of only writing that the perimeter never increases and comparing 40\before{40} to 24\target{24}; since 40>24\before{40} > \target{24}, that alone doesn't rule out reaching 24\target{24} unless you subtract the drop of at least 2\change{2} for each of the 2626 newly infected squares.)
final perimeter\displaystyle \monovariant{\text{final perimeter}} ≤40−2(26)\displaystyle \le \before{40} \change{- 2(26)} =−12<24\displaystyle = -12 < \target{24}
Impossible (final perimeter ≤−12<24\le -12 < 24).