Method stop · When and why do we use it?

Operations and Games

In the Chinese book: 操作与游戏

Look for what never changes or only goes down; solve games from the end.

Before this stop, visit:Coloring (Method)

One idea, one pictureThe grid has just one minus sign. Each move flips the signs of a whole row or a whole column. Can you make it all +? Play a few moves, then guess a “quantity that never changes” in the tracker.

Loading figure…

In one sentence

When everything keeps changing, look for the quantity that does not. If that quantity is different at the start and at the goal, you can never get there, however many moves you make and however you make them.

What doesn't change in the sign grid

Step 1 / 5
Loading figure…
  1. Start: 1 minus sign

    There is just one , and the goal is . It looks so close.

This chapter has three tools: invariants (to prove you can never get there), quantities that only go down (monovariants, to prove the process must stop) and working backwards (to find the winning moves in a game).

Stop 1 · You choose the invariant

Change the grid to , with the minus sign in the center.

Predict first

A grid with only in the center. Flipping whole rows or columns, can you make it all ? Is “the parity of the number of minus signs” still an invariant here?

Choose an answer first; then you can see the result.

When a row or column passes through the top-left block, it passes through exactly of its squares; two numbers change sign together, so the product stays the same. The product of the four numbers in this block starts at (the center square is in it), but it is when everything is . Invariants don't come ready-made: you design them by looking at the moves.

Stop 2 · Numbers on the blackboard

The blackboard shows . Each move erases two numbers and writes their difference.

Predict first

Keep going until only one number is left. Could that number be ?

Choose an answer first; then you can see the result.

Change the rule: erase , and write . This time an invariant pins down even the last number.

Loading figure…
Play twice, in different orders. Is the last number the same? Find the quantity that never changes in the tracker. Hint: .

Stop 3 · Flipping cups

Loading figure…
Try five or six moves first. Then look in the tracker for a quantity that never changes.

Each move flips cups. If of them were facing up, the number facing up changes by , which is even. The number facing up starts at , so it is always odd and can never reach .

Break it

Counterexample lab: remove one condition

Conclusion: The parity of the number facing up never changes, so cups can never all be turned down

Each move flips cups. Track “Up count odd or even”: however you flip, it stays “odd”.

Loading figure…

Stop 4 · It has to stop

Some problems don't ask “can you get there?” but “could this go on forever?”. Then you look for a whole number that gets strictly smaller at every move but can never go below .

Loading figure…
An “inversion” is a pair of people where the taller one stands to the left of the shorter one. Swap in any order first, then go back to the start and swap in a different order. Did the total number of swaps change?

Swap a neighboring pair where the left one is taller: that pair is no longer an inversion, and no other pair of people changes which of them is on the left. So the number of inversions goes down by exactly . It is a non-negative whole number, so it cannot go down forever: the process must stop, and it takes exactly as many moves as there were inversions at the start, whatever order you swap in.

Stop 5 · Games: work backwards from the end

stones. Two players take turns, taking , or stones each time, and whoever takes the last stone wins. First play a game against the computer. It never makes a mistake.

Loading figure…
Don't worry if you lose. Turn on “Show winning / losing positions” and play again.

How the losing positions are worked out

Step 1 / 5
Loading figure…
  1. 0 stones left

    It is your turn, but there are no stones left: your opponent took the last one. With stones left, the player to move loses. Mark it “L”.

When the rules change, the losing positions change too, but the method stays the same.

Predict first

Now each turn you may take only , or stones (not ), and there are stones. Do you want to go first or second?

Choose an answer first; then you can see the result.

Some games need no table at all: symmetry wins them.

Loading figure…
Each turn take coin or coins side by side; whoever takes the last coin wins. You go first. Where should your first move be so that the two sides left are exactly the same?

The first player takes the coin in the very middle (with an even number of coins, the middle two), leaving two equal runs on the left and right. After that, whatever your opponent takes on one side, you take the mirror image on the other side. As long as your opponent has a move, so do you, so the last coin is always yours.

Practice

Exercise 1Basic

The blackboard shows . Each move erases two numbers and writes their difference. Is the one number left at the end odd or even?

Exercise 2Basic

cups all face up, and each move must flip exactly of them. What is the smallest number of moves that turns them all face down?

Exercise 3Advanced

A pile has stones. Two players take turns, taking to stones each time, and whoever takes the last stone wins. You go first. How many stones should you take on your first move to be sure of winning?

Exercise 4Advanced

Five people stand in a row; their heights, numbered from left to right, are . Each move swaps two neighbors where the left one is taller. To line them up from shortest to tallest, exactly how many swaps are needed?

Exercise 5Challenge

A pile has stones. Two players take turns, taking only , or stones each time, and whoever takes the last stone wins. Do you want to go first or second?

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

“The invariant matches, so it must be possible”

The wrong step: A grid has two minus signs, at row 1, column 1 and row 2, column 2. The number of minus signs is even, the same parity as the goal (), so it can definitely be flipped to all plus.
What went wrong? Think first, then open

Diagnosis A matching invariant only means “this invariant does not object”. Try another invariant: the product of the four corners. Every flip changes exactly or corners, so it never changes either. Right now it is , and the goal has .

The right step: An invariant can only prove that something cannot be done. To prove that it can be done, you have to actually give a sequence of moves.

“An invariant is a veto, not a permit”

Exhibit

“Take the most each time and you will get the last stone fastest”

The wrong step: stones, take to each turn, and whoever takes the last stone wins. I go first and always take , the fastest way, so I am sure to win.
What went wrong? Think first, then open

Diagnosis You take , leaving ; your opponent takes , leaving . From then on, whenever you take , your opponent takes , so each round removes : , and the last stone goes to your opponent.

The right step: Work backwards from the end: with stones left, the player to move loses. The first player should take stone, leaving .

“Games are not won by taking the most, but by leaving your opponent in a losing position”

Exhibit

“Copy your opponent and you can't lose”

The wrong step: A row of coins; each turn take coin or neighboring coins. I go second: if my opponent takes the th coin from the left, I take the th from the right, so I always have a move.
What went wrong? Think first, then open

Diagnosis Your opponent's first move takes the th coin, right in the middle. Its mirror image is itself, so you cannot copy it. Now there are coins on each side, and it is your opponent who gets to copy you.

The right step: The symmetry strategy belongs to whoever makes the position symmetric first. In this game that is the first player: take the middle, then mirror.

“Before using symmetry, check whether something sits on the mirror line”