Lesson 7 · Part 2. Rivalry
Think from the end
The best move is found from the end of the game back to the start. If the recipe for winning is easy to find, the game dies.

Watch the episode (in Russian) · 2:27
Russian subtitles are on; you can turn them off in the player. The whole video course
Play
There are 15 coins on the table. You and the computer take turns taking 1, 2 or 3 coins. Whoever takes the last one wins. Play a couple of games. If the computer keeps winning, press “Hint from the end”.
Loading the mini-game…
The core
Why does the computer almost always win? It doesn’t go through the whole game forward; it looks from the end. If there are 1, 2 or 3 coins before your move, you take them all and win. And if there are 4? Whatever you take, your opponent is left with 3, 2 or 1, and the last coin is theirs. So 4 is a trap for whoever has to move.
Now one step back. From 5, 6 or 7 coins, you can leave your opponent 4, and that’s a win. From 8 you can’t: whatever you take, your opponent will leave you 4. This is how you find all the traps: 4, 8 and 12. The recipe for winning: leave your opponent a number divisible by 4. With 15 coins, the first player takes 3, leaves 12 and wins, however the second one plays.
The lesson’s lawThe best move is found from the end: first the last step, then the step before it. If the recipe for winning is easy to find, the game dies.
Scientists call this method backward induction: the game is solved from the last move to the first. The economist Ben Polak told his students that this might be the most important thing they would learn at Yale. Five minutes later he ran the “Hungry lions” game, and nobody used the trick. Knowing a trick doesn’t yet mean using it.
Start from the answer
Thinking from the end is useful not only against an opponent. In a maze, it’s sometimes easier to go from the exit to the entrance. A puzzle, too, is handy to build from the answer: take the solved position and make moves backward, scrambling it. Then a solution definitely exists, and it’s no longer than your steps back. Check whether there’s a shorter path.
Who moves first
In “The last coin”, everything is decided before the first move: with 15 coins, the first player wins if they know the recipe. With 16 coins, the second would win. Polak warned that going first doesn’t always pay. In rock, paper, scissors, it’s better when your opponent shows their hand sign first.
Check your game: who wins more often, the first player or the second? If the imbalance is big, even out the game. If you alternate who starts, the series of games becomes fair, but the imbalance stays in each game. So give the second player a head start or a bonus, or run the turns in a “snake”: 1-2-3, then 3-2-1.
A threat people believe
Threats are checked from the end too. A brother says: “Take my game console — and I’m never playing with you again.” But he gets bored on his own. When it comes to it, carrying out the threat doesn’t pay for him, so it’s empty. A threat works only if carrying it out pays.
An empty threat can be made real if you burn your bridges: take a step after which there’s no way back. Polak tells the story of William the Conqueror: after landing in England with his army, he burned his ships. His soldiers have nowhere to run, they will fight to the end, and attacking them is scarier. Polak honestly adds that in the real battle the English attacked anyway. But the point of the trick is clear: it works only if the opponent sees it. In a game, it’s a bet you can’t take back, or a card laid face up on the table.
A recipe kills the game
Once the recipe is found, “The last coin” turns into counting to four: there’s nothing left to choose. It was the same with tic-tac-toe in lesson 1: adults know that correct play ends in a draw, and they’re bored. To keep the recipe from being found, game makers add mystery (hidden cards), randomness (a die) and more options (a big board, different moves).
In real games
- Chess and Go. An answer exists for them, but nobody knows it: there are too many possibilities. The first move gives a small advantage, so chess tournaments alternate colors, and in Go White gets komi — extra points because Black goes first.
- Catan. The first settlements are placed in a “snake”: around the table, then in reverse order. Whoever placed last places their second one right away. This is how the game balances the turn order.
- Backgammon. The dice don’t let you calculate the game to the end. An experienced player wins more often, but a beginner sometimes beats a master too. Randomness hides the recipe and keeps the game alive.
- The fifteen puzzle. If you take the tiles out and put them back any old way, half the time the puzzle can’t be solved. The fair way to scramble it is to slide the tiles starting from the solved position. Then a way back definitely exists.
Common mistakes
The first player almost always wins
If going first pays too much, the second player loses before the first move. Players notice this within a couple of games, and the argument over “who goes first” becomes more important than the game itself.
play ten games and write down who wins. If the first player wins much more often, give the second player compensation: a head start, an extra move, bonus points or the right to choose a side.
Threats nobody believes
A villain threatens to burn down the village and does nothing. A rule promises a punishment that hurts the punisher. Players quickly figure this out and stop fearing any threats.
check the threat from the end: does carrying it out pay when the moment comes? If not, make carrying it out pay or happen automatically, and show it to everyone in advance.
A puzzle not checked from the end
The puzzle was designed move by move, going forward, and never checked. And it has no solution, or there’s a quick shortcut that kills the idea.
build the puzzle backward from the answer, then walk through it from the end, step by step. And let a friend solve it while you watch in silence.
A simple recipe for winning
If a winning method turns up within a few games, from then on everyone plays the same way. There’s no choice, and the game gets put away.
add mystery, randomness or more options. After each change, look for the recipe again: sometimes it just moves somewhere else.
Check yourself
Only you see your answers. Nothing is sent or counted.
A new game: 10 coins, on each turn you take 1 or 2, and whoever takes the last one wins. Which numbers of coins are traps for whoever has to move?
From the end: from 1 or 2, you take everything. From 3, whatever you take, your opponent is left with 1 or 2. After that, every third number is a trap. So the first player should take 1 and leave 9.
Those are the traps of the game where you take up to three coins. Here you can take no more than two, and the pattern is different: a step of 3, not 4.
From 2, you take both coins and win right away. So 2 is not a trap.
By the rules of the game, you can answer your neighbor blow for blow, but striking back costs you more than it costs your neighbor. You threaten: “Attack me — I’ll strike back.” What will a neighbor who thinks from the end do?
A threat is scary when carrying it out pays. Carrying out this one doesn’t pay for the one who makes it, that is, for you.
Your neighbor looks at what will happen when it comes to it. Striking back doesn’t pay for you, so the threat is empty.
Loudness changes nothing. What matters is something else: whether carrying out the threat pays, and whether it can be called off.
In your game, the first player wins 8 games out of 10. What’s the better thing to try?
8 out of 10 isn’t luck, it’s an imbalance in the rules. Players will notice it quickly.
That’s how it’s done in Go: White gets extra points because Black goes first. Then test the new version on a few more games.
Drawing lots decides who gets the advantage, but the advantage itself stays.
You change the rules of “The last coin”: before each move a die is rolled, and it decides how many coins you can take (1–2 — one, 3–4 — up to two, 5–6 — up to three). What happens to the recipe “leave a number divisible by 4”?
The recipe relied on being able to take 1, 2 or 3 from any number. Now the die decides that, and you can’t always leave your opponent 4.
Just the opposite: randomness gets in the way of calculating the game to the end.
Randomness breaks the simple recipe. Good moves remain, but there’s no guarantee of winning, and thinking is interesting again.
Create
Break the recipe for winning. You’ll need 15 coins, buttons or tokens and one friend. If you’d rather make a puzzle, there’s a second option.
- Play three games of “The last coin” with your friend. If your friend doesn’t know the recipe, show it to them after the game.
- Come up with one new rule that breaks the recipe. For example: you can take 1, 2 or 4 coins; the coins lie in two piles; whoever takes the last one loses; a die decides how many to take.
- Find the new traps from the end: start with 1, 2 and 3 coins and work backward. Write down which numbers win and which don’t.
- Found a new simple recipe? Change the rule again or add mystery: for example, some of the coins lie under a handkerchief.
- Play three to five games of the new version with your friend. Write down who wins and whether your friend thinks long over a move.
Second option. Make up a three-step puzzle, starting from the answer. Draw the solved position, make three moves backward and write them down. Let your friend solve it from the last position, and see whether they find the way.
your friend has played at least three games under the new rules, and neither player knows a move that always wins. Or your friend has solved your puzzle, and you know in advance that a solution exists.
the game theory behind this lessonBackward induction, Zermelo’s theorem, commitments and threats, Polak’s lectures 13–16
Backward induction. The game is solved from the last move to the first, assuming each player will choose what’s best for themselves. In “The last coin”, multiples of 4 are losing positions for the player to move (in combinatorial game theory they’re called P-positions), and the rest are winning ones (N-positions). If you can take from 1 to k coins per turn, the traps are the multiples of k + 1.
Zermelo’s theorem (1913). In a finite two-player game where each player sees all past moves and there’s no chance, either the first player can force a win, or the second can, or both can force a draw. Tic-tac-toe is a draw. English checkers was solved in 2007 and is also a draw (this doesn’t apply to Russian checkers). For chess, the answer exists but is unknown. Polak goes through the theorem in lecture 15.
Nim. A game with several piles where, on each turn, you take as many objects as you like from one pile. Charles Bouton solved it completely in 1901. In lecture 14, Polak’s students found the rule for two piles: if the piles are unequal, it pays to go first and make them equal with every move; if they’re equal, it pays to let your opponent go first. “The last coin” is a relative of Nim: one pile and no more than three coins per turn.
First-mover advantage. Polak shows that it doesn’t always exist: in rock, paper, scissors it pays to answer with the second move, and in the “I cut, you choose” split nobody has an advantage. Ways to even out a game: compensation for the second player (komi in Go), the “pie rule” in the game Hex (after the first move, the second player can take that move for themselves), alternating, and the “snake”.
Credible threats and commitment. A threat is credible if carrying it out pays when the moment comes. In lecture 15, Polak analyzes a market-entry game: a monopolist threatens a price war, but waging it doesn’t pay the monopolist itself, and backward induction throws such a threat out. A commitment is a move that cuts off some of your own choices and thereby changes your opponent’s behavior: burned ships (lecture 13), an already built printing plant in a newspaper rivalry (lecture 14), the “doomsday machine” from the film “Dr. Strangelove”, useless because the enemy was never told about it.
Hungry lions (lecture 13). Only the leader can eat the sheep, but then it falls asleep, and the next lion can eat it, and so on down the chain. Working back from the end of the chain shows: with an odd number of lions, the leader should eat; with an even number, it shouldn’t.
The duel (lecture 16). Students took turns stepping toward each other with wet sponges, and in both pairs the first throw missed. Backward induction finds the exact moment: you should throw when your chance of hitting now plus your opponent’s chance of hitting on the next move becomes at least one for the first time. Before that, waiting pays more.
Moral hazard (lecture 13). In the “Cash in a hat” game, the second player can grab the money that was put in, so the first player puts in little, even though a big investment pays more for both. The first player’s decision depends on what the second will do — the same “think from the end” logic.
Sources:
- Ben Polak, lecture 13 “Sequential Games: Moral Hazard, Incentives, and Hungry Lions”: video, transcript.
- Lecture 14 “Backward Induction: Commitment, Spies, and First-Mover Advantages”: video, transcript.
- Lecture 15 “Backward Induction: Chess, Strategies, and Credible Threats”: video, transcript.
- Lecture 16 “Backward Induction: Reputation and Duels”: video, transcript.
- Charles L. Bouton. “Nim, a Game with a Complete Mathematical Theory”. Annals of Mathematics, 1901–1902 — the first complete solution of Nim.
- Thomas Schelling. “The Strategy of Conflict” (1960) — a classic on commitments and threats.
- Notes on the lectures for this course are in “Lectures and sources”.
how to run the lesson with a group45 minutes, 2 to 30 people, coins or buttons
- 10 minGame. Pairs, each with 15 coins or buttons. They take turns taking 1, 2 or 3; whoever takes the last one wins. Three games, switching who starts. Have them write down who started and who won.
- 10 minDebrief. Write the numbers from 15 down to 0 on the board in four columns, as in the mini-game. Ask: what do you do if there are 2 coins before your move? And 4? And 5? Color in the numbers together with the group, working from the end. Don’t hint at the recipe: let the group find it on its own.
- 5 minLaw. Write on the board: “The best move is found from the end. A simple recipe for winning kills the game.” Ask which games the group got tired of precisely because the recipe is known.
- 15 minCreating. Pairs come up with one rule that breaks the recipe. Then they swap rules with the next pair and try to find the new recipe from the end.
- 5 minWrap-up. Each pair says which rule broke the recipe best. No grades: “what worked” and “what else to try”.
With children, it’s better to play for candy or stickers and go through the numbers only up to 8. With adults, you can add “Hungry lions” from lecture 13 or look at the threats in board games they know.