On the last day before the Dashain holidays, the maths teacher at a school in Bhaktapur comes into Class 11 with a big jar of toffees. She pairs everyone up and gives each student two cards, one saying Share and one saying Keep. You and your partner each put one card face down on the desk, without talking, and then turn them over together. She reads out the rules:
| You | Your partner | You get | Your partner gets |
|---|---|---|---|
| Share | Share | 3 toffees | 3 toffees |
| Keep | Share | 5 toffees | 0 |
| Share | Keep | 0 | 5 toffees |
| Keep | Keep | 1 toffee | 1 toffee |
Your partner is your friend, but you can’t talk it over, and you play only once.
Guess first. Which card should you put down?
Pick an answer to see why.
One round: why Keep always wins
Suppose your friend shares. Then you are choosing between Share, which gets you 3, and Keep, which gets you 5. Keep is better by 2.
Suppose your friend keeps. Then you are choosing between Share, which gets you 0, and Keep, which gets you 1. Keep is better by 1.
You don’t need to know which case you are in. Keep wins in both, so you should keep. A move that is better for you whatever the other player does is called a dominant strategy. It is your friend’s too, so two clever players both keep and get 1 toffee each. Figure 39.1 shows the whole argument at once.
Yet had both shared, each would have had 3. Nothing is wrong with the logic; each player’s own good and the pair’s good simply point different ways.
The bottom right cell has a special property: once you are there, neither player can do better by changing only their own move. If you switch to Share while your friend still keeps, you drop from 1 to 0, and the same for your friend. A cell like that is a Nash equilibrium, after the mathematician John Nash, who proved in 1950 that every game with a finite number of players and moves has at least one (sometimes only if the players are allowed to choose at random). An equilibrium is where a game settles, not where it is best.
At the top left, both share and get 3 each. Why is that cell not a Nash equilibrium?
Pick an answer to see why.
What makes it a dilemma
The numbers 5, 3, 1 and 0 are not special. Game theorists give the four payoffs letters: T, the temptation (you keep while your partner shares: 5), R, the reward for sharing together (3), P, the punishment for keeping together (1), and S, the sucker’s payoff (you share while your partner keeps: 0). Any game whose payoffs come in the order
is a prisoner’s dilemma. The argument above used only that order: T > R and P > S make keeping dominant, and R > P makes sharing together better. When the game is played again and again, people usually add one more condition, 2R > T + S, so that taking turns at cheating (5, then 0, then 5…) can’t beat steady sharing (3, 3, 3…). Here 2 × 3 = 6 is more than 5 + 0 = 5.
The name comes from a story. Two suspects are held in separate rooms, and each is offered a lighter sentence for giving evidence against the other. Each does better to give evidence whatever the other does, and when both do, both serve longer than if both had kept quiet.
Which of these games, written (T, R, P, S), is not a prisoner’s dilemma?
Pick an answer to see why.
Again and again
The teacher has a second jar. “The same game,” she says, “but now with the same partner, round after round. After each round I roll a die. If it shows a 6, the game is over. Anything else, we play another round.”
Does that change what you should do? Try it. Your partner follows a secret rule, the same all game; watch what it does after you share and after you keep.
Some partners punish you. Keep once against Copycat, and next round Copycat keeps too; keep once against Grudger, and it never shares again. Now the 2 extra toffees from keeping today have a price: the toffees you lose tomorrow. Whether that price is worth paying depends on how likely tomorrow is.
How long does a game last?
With a die, each round is followed by another with chance . Call that chance w. How many rounds should you expect?
A neat trick avoids a long sum. Let N be the expected number of rounds. A game is one round and then, with chance w, a whole new game worth N rounds on average. So
With a die, , and N = 6 rounds. With a coin toss deciding (heads, play again), and N = 2. (The trick needs the sum 1 + w + w² + ⋯ to be a real number, as it is here; What Is a Game Worth on Average? has a sum that isn’t.) The chance of at least 10 rounds is , about 0.19.
Is cheating worth it?
Now suppose your partner is a Grudger. Compare two plans.
Share every round. Your expected total A is 3 now plus, with chance w, a whole new A:
Keep now. You get 5 this round. Then the Grudger keeps for ever, so you keep too, for 1 a round: with chance w, a game worth :
Sharing is at least as good when A ≥ B. Multiply both sides by 1 − w: 3 ≥ 5(1 − w) + w, which is 3 ≥ 5 − 4w, which is
So if there is at least an even chance of meeting again, sharing with a Grudger pays. With the teacher’s die, sharing is worth 18 toffees on average and cheating only 10:
| Chance of another round, w | Rounds expected | Share every round | Keep now |
|---|---|---|---|
| 1/3 | 1.5 | 4.5 | 5.5 |
| 1/2 | 2 | 6 | 6 |
| 2/3 | 3 | 9 | 7 |
| 5/6 (the die) | 6 | 18 | 10 |
| 9/10 | 10 | 30 | 14 |
Keeping still wins any single round; what has changed is that each round now affects the next, and the future can outweigh the present. Strangers who will never meet again have w = 0; neighbors sharing a channel for life have w close to 1. The general rule, for any payoffs, is that sharing beats one betrayal of a Grudger when : the smaller the one-round gain T − R is compared with T − P (that gain plus the R − P lost in every later round), the shorter the future needed.
A tournament of rules
Which rule is best for playing this game again and again? In 1980 the American political scientist Robert Axelrod asked people who had studied the game to send in their best rule as a computer program. Every program played every other for 200 rounds, with exactly our toffee numbers: 5, 3, 1 and 0. Of the 14 entries, the winner was the simplest, sent in by the mathematical psychologist Anatol Rapoport: about four lines of the programming language BASIC. It shared in the first round, and after that did whatever the other player had done in the round before. It is called tit for tat; on this page it is Copycat.
Axelrod then held a second tournament. This time everyone knew tit for tat had won, and the 63 programs were written with that in mind. To stop programs from cheating in a known last round, each round had a small chance, 0.00346 (about 1 in 290), of being the last. Tit for tat won again.
Hold your own tournament below, with seven rules: Always Share; Always Keep; Copycat (tit for tat); Grudger (shares until you keep once, then keeps for ever); Coin Tosser (random, half and half); Stay or Switch (repeats its move after you share, changes it after you keep); and Forgiving Copycat (a Copycat that lets one keep in three go unpunished). Each rule plays every rule taking part, and a copy of itself, for 200 rounds.
With all seven playing and no slips, the order is Grudger 2.72, Copycat 2.60, Stay or Switch 2.54, Forgiving Copycat 2.54, Always Share 2.36, Always Keep 2.34 and Coin Tosser 2.08. The top four have one thing in common: they never keep first. Axelrod called such rules nice (Always Share is nice too, but never hits back). And Always Keep, which never loses a round, comes sixth out of seven: Copycat and Grudger stop sharing with it after the first round, leaving it about 1 toffee a round; it does better against Stay or Switch (3) and Forgiving Copycat (2.34), but not enough.
Here is the strangest thing. Copycat never gets more toffees than its partner in a single match: it keeps only after its partner has, so at best it ties. Yet it comes near the top, because it gets 3 a round with every nice rule and loses only a little to the others. Winning a tournament is not about beating your opponents but about getting a lot, and Copycat helps its partners get a lot too. (Grudger edges it here because it punishes the Coin Tosser harder. Take the Coin Tosser and Always Share out, and the two tie at 2.60.)
From his tournaments Axelrod drew some advice for a rule that does well: be nice (don’t keep first), retaliate (punish a keep at once, or you will be exploited), forgive (go back to sharing once your partner does), and don’t be envious (care about your own total, not about beating the other player).
Copycat plays Always Keep for 10 rounds. How many toffees does each get?
Pick an answer to see why.
When moves go wrong
Real life has slips: a message misread. Suppose two Copycats are playing and one keeps by mistake in round 4. Round 5: the other copies the keep. Round 6: the first copies that. The two take turns to punish each other for ever:
| Round | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Copycat 1 | Share | Share | Share | Share | Keep | Share | Keep | Share | Keep | Share |
| Copycat 2 | Share | Share | Share | Keep (slip) | Share | Keep | Share | Keep | Share | Keep |
Over 10 rounds they get 24 and 29 instead of 30 each, and the echo never stops. Two Stay or Switch players recover from the same slip in two rounds (both keep once, then both switch back to sharing), getting 25 and 30. Press “Slips” in the tournament (one move in 20 goes wrong) and every nice rule loses toffees to echoes like this. Grudger, which after the first slip keeps for ever, comes first, and Always Keep rises to second: among this many easy partners, rules that never forgive gain. Over generations, below, it ends differently. Martin Nowak and Karl Sigmund’s 1993 paper is titled “A strategy of win-stay, lose-shift that outperforms tit-for-tat in the Prisoner’s Dilemma game”: with mistakes, Stay or Switch (also called Pavlov) can beat Copycat. It has its own weakness: against Always Keep it goes back to sharing every other round, and is cheated each time.
Generations
Axelrod also asked a second question: what if the rules that do well become more common? Think of inherited behavior in animals, or people copying what works for their neighbors. Each generation, every rule plays the current mix, and its share of the next generation is its share now × its average toffees against the mix ÷ the whole population’s average. A rule that beats the average grows; one below it shrinks. Biologists use this arithmetic as a model of natural selection; for us it is just multiplication and division, repeated.
Sharers and cheats. 90% Always Share, 10% Always Keep. Cheats get 5 from most partners while sharers get 3, so cheats spread: 52% by generation 4, almost everyone by generation 10. And then the whole population gets 1 toffee a round. Cheating has won, and the winners are poorer than the losers were.
Add Copycats. 60% sharers, 30% cheats, 10% Copycats. At first the cheats grow fast, feeding on the sharers, and reach 89.5% by generation 7. But the sharers run out, and a cheat meeting a cheat gets only 1, while two Copycats get 3. By generation 15 Copycats are 61%, and by generation 20 they are 99.5%. The cheats destroyed the very partners they lived on.
All seven. With no slips, Always Keep and Coin Tosser die out within about 15 generations, and the population settles with the nice rules: Grudger 27%, Copycat 22%, Stay or Switch and Forgiving Copycat 19% each, and Always Share 13%. Always Share survives because nobody is left to exploit it. With slips, cheats first rise to about a quarter, then Grudger and Copycat take over, and then, as their echoes of punishment cost them, Forgiving Copycat overtakes both: 87% by generation 100.
In “Add Copycats”, why does Always Keep first grow and then disappear?
Pick an answer to see why.
Other games, other answers
Not every game with two choices is a prisoner’s dilemma. Change the order of the four numbers and the answer changes. Two famous examples:
The stag hunt. Two hunters can together catch a stag (4 each), or each catch a hare alone (3 each, whatever the other does); a hunter who waits for a stag alone gets nothing. There is no temptation: if your partner hunts stag, so should you. Both hunting stag is a Nash equilibrium, and so is both hunting hare. Which one happens depends only on trust: do you believe your partner will come? In a prisoner’s dilemma you are tempted even when you trust your partner completely; in a stag hunt trust is enough.
The one-lane road. Two trucks meet on a narrow mountain road where only one can pass. If both give way, both lose a little time (3 each). If one pushes on while the other backs up, the one who pushes on does best (4) and the other is fine (2). If both push on, they are stuck nose to nose (0 each). Now there is no dominant strategy: if the other driver pushes on, you should give way; if the other gives way, you should push on. The two equilibria are where exactly one gives way. Game theorists call this game chicken. Its danger: two drivers, each sure the other will back down.
So “the rational thing to do” depends on the order of four numbers, and the first job in modeling a real situation is to find out honestly which game it is.
Where this is used
Nepal’s irrigation channels. In 1988 Elinor Ostrom visited Nepal and found many written studies of irrigation systems that farmers had built and kept up themselves. With Ganesh Shivakoti and Paul Benjamin she started the Nepal Irrigation and Institutions project to compare them. A channel is a prisoner’s dilemma for many players: each farmer gains by taking extra water and skipping repairs, and if all do, the channel fails. Yet Wai Fung Lam found that systems run by the farmers themselves did significantly better than the government’s on all three of his measures: the channels’ condition, the water reaching the tail end, and the harvest. The farmers meet every year, make their own rules, choose people to watch over the water, and penalize those who break the rules. A later study of 229 systems confirmed it. In 2009 Ostrom became the first woman to win the Nobel Memorial Prize in Economic Sciences, “for her analysis of economic governance, especially the commons”. In her prize lecture she pointed to what the prisoners’ story leaves out: “Public investigators purposely keep prisoners separated so they cannot communicate. The users of a common-pool resource are not so limited.” Talking, rules and watching each other change the game.
Trenches in the First World War. On quiet parts of the Western Front, soldiers facing each other for long periods often held their fire, or fired in set, harmless ways, so long as the other side did the same. Historians call it the live and let live system. Axelrod read it as a repeated prisoner’s dilemma played with tit for tat, though others argue the game doesn’t fit the case. Commanders knew of it and often ordered raids.
Vampire bats. A vampire bat that misses its blood meal two nights running usually dies. Bats that have fed bring blood back up for roost-mates that haven’t, and Gerald Wilkinson’s 1984 study found that bats that helped others before are helped in turn. Whether this is true tit for tat is still argued: bats have not been shown to refuse a bat that never shared.
Climate, doping and advertising. Each country is tempted to let the others cut their emissions; two athletes who both dope cancel out each other’s advantage and keep only the dangers; two rival companies’ advertising mostly cancels out. The farmers’ tools, agreements, checking, penalties and meeting again, are the ones used against each.
Questions
For each game (T, R, P, S), say whether it is a prisoner’s dilemma, and whether it also passes 2R > T + S. i. (4, 3, 1, 0) ii. (6, 5, 2, 1) iii. (3, 4, 1, 0)
Answer
The temptation T changes, with R = 3 and P = 1. Find the smallest chance w of another round for which sharing with a Grudger beats keeping once, for i. T = 4, ii. T = 9. What does the difference mean?
Hint
Answer
The one-lane road: give way and give way 3 each; push on against give way 4 for the one pushing and 2 for the one giving way; both push on 0 each. i. Show that neither driver has a dominant strategy. ii. Find every Nash equilibrium.
Answer
Four students do a group project. Each can work, which costs that student 2 toffees’ worth of free time, or slack. Every student who works adds 6 toffees to the prize, which is shared equally among all four, workers or not. i. How much does a student gain or lose by working, whatever the others do? ii. What does each get if all four work, and if none do? iii. Why is this a prisoner’s dilemma for four players?
Answer
Your partner is Copycat and the chance of another round is w. Instead of keeping for ever, you try a sneakier plan: keep, share, keep, share, … so that Copycat, always one round behind, shares exactly when you keep. i. Show that this gives you 5, 0, 5, 0, … ii. Find your expected total, and the values of w for which steady sharing, worth , is at least as good.
Hint
Answer
Where to go next
- What Is a Game Worth on Average? Expected value, and the same “a game is worth itself again” trick used here for the die.
- Which Voting System Is Fair? Another place where every person’s sensible choice can add up to a strange result for the group.
- How Do You Share an Inheritance Fairly? Dividing things that can’t be cut, among people who value them differently.
- Who Wins the Race to 20? (Grades 6–8) A game where one player can always win, found by working back from the end, as backward induction does here.
- Can You Beat a Computer at Rock-Paper-Scissors? (Computing, Going Further 6–8) A game with no dominant move, and programs that learn your habits.
- Can Matchboxes Learn to Play? (Computing, Going Further 9–12) A strategy that grows by being rewarded, like the generations here.
- Grade 10 Math: Probability The chances behind the die that decides whether there is another round.
Where these facts come from
- The origin (Flood and Dresher at RAND, 1950; Tucker’s name and prison story), the 1950 experiment with Alchian and Williams (a hundred rounds; they often shared), the conditions T > R > P > S and 2R > T + S, Rapoport’s tit for tat as about four lines of BASIC, the four properties, and the climate, doping and advertising examples: Wikipedia, “Prisoner’s dilemma”, read October 2026.
- Flood and Dresher’s experiment of early 1950 (two colleagues, a hundred rounds), the name first in print in Luce and Raiffa (1957), backward induction in a game of fixed length and that people play long fixed games much like games of unknown length except in the final rounds, and the stag hunt’s numbers: Steven Kuhn, “Prisoner’s Dilemma”, Stanford Encyclopedia of Philosophy, read October 2026.
- Axelrod’s first tournament (14 entries, payoffs 5, 3, 1, 0) and second (63 strategies, a chance of .00346 of ending at each move), tit for tat winning both: Vincent Knight, Owen Campbell, Marc Harper, T. J. Gaffney and Nikoleta Glynatsi, “Reviving, reproducing, and revisiting Axelrod’s second tournament”, arXiv:2510.15438 (2025), read October 2026. The 200 rounds, Axelrod’s advice (“be nice”, “be provocable”, “don’t be envious”), that tit for tat cannot score more than its partner, and the 1981 Science paper with Hamilton: Wikipedia, “The Evolution of Cooperation” and “Evolution of cooperation”, read October 2026.
- Axelrod as a political scientist at the University of Michigan: Wikipedia, “Robert Axelrod (political scientist)”; Rapoport as a mathematical psychologist: Wikipedia, “Anatol Rapoport”; both read October 2026.
- Tit for tat’s echo of punishment after one error: Wikipedia, “Tit for tat”, read October 2026. The title and details of M. Nowak and K. Sigmund, Nature 364, 56–58 (1993): Crossref record, doi:10.1038/364056a0, read October 2026 (the paper itself not opened).
- The Nash equilibrium and Nash’s 1950 PNAS paper: Wikipedia, “Nash equilibrium”; Nash’s life, 28-page thesis under Tucker, illness and A Beautiful Mind: Wikipedia, “John Forbes Nash Jr.”; Tucker as Nash’s adviser at Princeton: Wikipedia, “Albert W. Tucker”; all read October 2026.
- The prizes and their wording (1994, 2005, 2009): the Nobel Prize API, 1994, 2005, 2009, read October 2026.
- Nepal’s irrigation systems (the 1988 visit, the NIIS project with Shivakoti and Benjamin, Lam’s three measures and finding, the farmers’ meetings, monitors and fines, the 229 systems) and the quotation on prisoners: Elinor Ostrom, “Beyond Markets and States: Polycentric Governance of Complex Economic Systems”, Prize Lecture, 8 December 2009, read October 2026. That she was the first woman to win the economics prize: the Nobel Prize API above (no woman among the earlier laureates).
- The live-and-let-live system, Axelrod’s reading of it and its critics: Wikipedia, “Live and let live (World War I)”, read October 2026.
- Vampire bats’ blood sharing (death after two nights without a meal, help for past helpers, the doubts): Wikipedia, “Reciprocal altruism”, read October 2026.
- Every number on this page (the one-round comparisons, the expected rounds and totals for each chance w, the thresholds 1/2, 1/3, 3/4 and 2/3, the 10-round matches with and without a slip, the tournaments with and without slips, the generations, the equilibria of the three games, the group project) was computed by a script,
checks/textbooks/math-further-9-12/39/tmp/dilemma.py, whose engine is the same as the widgets’, and recomputed separately by the reviewer’schecks/textbooks/math-further-9-12/39/tmp/review/recheck.py.
