Game theory · strategy, cooperation, equilibrium

Everyone does what’s best for them, and everyone loses.

Game theory is the maths of decisions that depend on other people’s decisions. It explains price wars, arms races, penalty kicks, auctions and why cooperation is both fragile and surprisingly hard to kill. Play the most famous game of all, then watch strategies compete, evolve and settle into equilibrium.

Demo 1 · play

The prisoner’s dilemma

Two suspects are questioned in separate rooms. Each can stay silent (cooperate with the other) or betray them (defect). Here the outcome is in points: more is better. You face a mystery opponent for 10 rounds. Can you work out its strategy?

They cooperate
They defect
You cooperate
3 · 3Reward for both
0 · 5You’re the sucker
You defect
5 · 0Temptation pays
1 · 1Punishment for both
Why it’s a dilemmaWhatever they do, defecting earns you more: 5 instead of 3 if they cooperate, 1 instead of 0 if they defect. They reason the same way, so two rational players both defect and get 1 each, when cooperating would have given them 3 each.
Round 1 of 10Opponent: ???
You
0
Them
0
Your moves
Their moves

Pick a move. Your opponent picks at the same time.

Demo 2 · competition

Axelrod’s tournament

In 1980 the political scientist Robert Axelrod invited experts to submit programs to play the repeated prisoner’s dilemma against each other, 200 rounds a match. The winner was the shortest entry: Tit for Tat, sent in by Anatol Rapoport. Pick the field, add some noise (mistakes), and run it yourself.

Average points per round Evolution: population share over 150 generations
Strategies in the tournament
What winsAxelrod found the successful strategies shared four traits. They were nice (never defect first), retaliatory (punish defection), forgiving (go back to cooperating) and clear (easy for others to read). Turn up the noise and watch unforgiving strategies like Grim Trigger fall apart.
EvolutionIn the lower chart, each strategy’s share of the next generation grows with how well it scored against the current population. Exploiters like Always Defect only thrive while there are naive cooperators to feed on. Remove Grim Trigger and the Tit for Tat family and watch Always Defect take over; add them back and it starves.
Demo 3 · emergence

Cooperation on a grid

In 1992 Martin Nowak and Robert May put the dilemma on a grid. Every cell plays its eight neighbours, then copies whichever neighbour (or itself) scored best. Nobody remembers anything, yet clusters of cooperators can survive, and a single defector can grow into a kaleidoscope.

Cooperator Defector Just switched to cooperate Just switched to defect

A cooperator earns 1 from each cooperating neighbour. A defector earns this much from each cooperating neighbour. Everyone else gets 0.

Generation
0
Cooperators
100%
Try thisStart with one defector between 1.8 and 2.0 for the famous symmetric patterns. Below about 1.8 the defectors stay boxed in; above 2.0 they take over. In random mixes, cooperators survive in clumps because they mostly play each other.
Demo 4 · equilibrium

Find the Nash equilibrium

A Nash equilibrium is a set of choices where nobody can do better by changing only their own move. John Nash proved in 1950 that every finite game has at least one, if players are allowed to randomize. Pick a classic game or type your own payoffs.

Blue is the row player’s payoff, red the column player’s. An outlined number is that player’s best response to the other’s move. Where both are outlined, you have a pure Nash equilibrium.

Best responses, if players can randomize

Across: how often the column player picks its first move. Up: how often the row player picks its first move. The blue line is the row player’s best reply, the red line the column player’s. Every crossing is an equilibrium.

Demo 5 · thinking about thinking

Guess two-thirds of the average

Everyone picks a number from 0 to 100. The winner is whoever is closest to two-thirds of the average. If people guess at random the average is 50, so you’d say 33. But if everyone thinks that, you should say 22… The only Nash equilibrium is 0. Does 0 win against real people?

Crowd average Target (⅔ of average) Your guess
Round
1
Average
–
Target
–

The crowd mixes people who think zero, one, two or three steps ahead, plus a few who go straight to 0. Play several rounds: like real groups, they learn and drift toward 0.

Levels of thinkingLevel 0 guesses at random. Level 1 assumes everyone else is level 0 and says 33. Level 2 says 22, level 3 about 15. In experiments, most people stop after one or two steps, so first-round averages usually land in the 20s or 30s. Being “perfectly rational” and saying 0 loses.
Key ideas

The vocabulary of strategy

In the wild

Where game theory shows up

From Cold War strategy to how doctors are matched to hospitals.