Prisoner's dilemma game
Play 10 rounds against a mystery opponent. Both cooperate: 3 points each. Both defect: 1 each. Betray a cooperator: you get 5, they get 0. At the end we reveal which classic strategy you were up against.
| Round | You | Them | Points |
|---|
The payoff table
| They cooperate | They defect | |
|---|---|---|
| You cooperate | 3 for you, 3 for them | 0 for you, 5 for them |
| You defect | 5 for you, 0 for them | 1 for you, 1 for them |
Look down each column: whatever they do, defecting gets you more (5 instead of 3, or 1 instead of 0). That's why two "rational" players who meet once both defect and get 1 point each, when cooperating would have given them 3. Play repeatedly, though, and your opponent can reward or punish you next round, which changes everything.
The 8 strategies you might face
- Tit for tat: Cooperates first, then copies your last move.
- Grudger: Cooperates until you defect once, then defects forever.
- Always defect: Never cooperates.
- Always cooperate: Never defects, whatever you do.
- Coin flip: Cooperates or defects at random.
- Tit for two tats: Only defects after you defect twice in a row.
- Win-stay, lose-shift: Repeats its last move if it scored well (3 or 5), switches if it scored badly (0 or 1).
- Prober: Opens C, D, C, C. If you never hit back, it exploits you; if you did, it plays tit for tat.
Which strategy wins a tournament?
In 1980 political scientist Robert Axelrod invited experts to submit strategies and played them all against each other. The winner, both times he ran it, was the shortest program entered: tit for tat. He described why in The Evolution of Cooperation (1984): it is nice (never defects first), retaliates immediately, forgives as soon as you cooperate again, and is clear enough that opponents learn to cooperate with it.
Here's our own round robin of the 8 strategies above, every pair playing 200 rounds (each strategy also plays a copy of itself):
| Place | Strategy | Total points |
|---|---|---|
| 1 | Tit for tat | 4,241 |
| 2 | Grudger | 4,039 |
| 3 | Win-stay, lose-shift | 3,952 |
| 4 | Tit for two tats | 3,769 |
| 5 | Prober | 3,659 |
| 6 | Coin flip | 3,469 |
| 7 | Always cooperate | 3,333 |
| 8 | Always defect | 3,172 |
Results depend on who's in the field: add more exploiters and the forgiving strategies drop; add more cooperators and always defect does better. "Coin flip" uses a fixed random seed so the table is the same each time the site is built.
Common questions
What is the prisoner's dilemma?
Two players each choose to cooperate or defect without knowing what the other will do. Defecting always pays more for you whatever the other player does, but if both defect, both end up worse off than if both had cooperated. It's the classic model of why cooperation is hard even when it helps everyone.
What is the best strategy in the prisoner's dilemma?
In a single game, defecting pays more whatever the other player does. In a repeated game there is no single best strategy, because it depends on who you are playing. In Robert Axelrod's computer tournaments around 1980, the simple strategy tit for tat (cooperate first, then copy your opponent's last move), submitted by Anatol Rapoport, scored highest in both rounds.
Who invented the prisoner's dilemma?
Merrill Flood and Melvin Dresher at the RAND Corporation set up the game in 1950. Mathematician Albert W. Tucker gave it the prison story and the name.
What are the points?
Both cooperate: 3 each. Both defect: 1 each. One defects while the other cooperates: 5 for the defector, 0 for the cooperator. These are the values Axelrod used. A game here is 10 rounds.
Should I defect in the last round?
If you know which round is last, defecting then can't be punished, which is why the game here tells you the number of rounds: try it and see how the different strategies react.
More games
- Daily nonogramA picture logic puzzle: fill the grid from the number clues.
- Daily code breakerCrack a 4-peg color code in 10 guesses or fewer.
- Rock paper scissorsPlay a bot that learns your habits as you go.
- Monty Hall problemPick a door, then stay or switch. Plus a million-game simulator.
- NimTake sticks, take the last one, beat a bot that knows the math.