Cooperation

The prisoner's dilemma, played many times. 25 strategies meet in a round robin, as in Robert Axelrod's famous tournaments. Who wins: the nice, the nasty, the forgiving or the grudge holders?

← all systems
–won the tournament
–Tit for Tat's place. It never wins a single match.
–Always defect's place. It never loses a single match.
–nice strategies in the top half

Ranking: average points per round

3 = always cooperating together, 1 = always defecting together. ⚔ = nasty (will defect first). W/L: matches scored higher / lower than the opponent. Click a strategy to read about it.

Who scores what against whom

Each square: the points per round that the strategy on the left got against the one on top (red 0, yellow 2.5, green 3, bright 5). Click a square to watch that match.

Click a strategy in the ranking to see what it does.

Watch a match

against
cooperate defect a mistake (noise flipped the move)

Evolution: good scores have more children

Each generation, every strategy's share grows or shrinks with its average score against the current population (Axelrod's "ecological tournament"). Below 1 in a million it dies out.

Play it yourself

What Axelrod found, and what this page finds

In 1980 the political scientist Robert Axelrod invited game theorists to send in computer programs for the repeated prisoner's dilemma. 14 programs (and a coin flipper) played everyone, 200 rounds each. The shortest one, Tit for Tat (four lines of Fortran), won. In a second tournament 62 entrants knew that result and tried to beat it; it won again.

The dilemma
other cooperatesother defects
you cooperate3 eachyou 0, other 5
you defectyou 5, other 01 each

Whatever the other does, defecting gives you more (5 > 3, 1 > 0). So two clever players both defect and get 1 each, when they could have had 3. In a single game nothing beats defecting: try "Just one round".

Winning without beating anyone

Tit for Tat never scores more than the player it is facing: it can only tie or lose by one sucker's payoff. Always defect never scores less. Yet Always defect comes near the bottom and Tit for Tat near the top. The tournament is not about beating your opponent; it is about how many points you make together. Look at the W and L columns.

Axelrod's four rules

Nice: never be the first to defect. Retaliate: hit back at once, or you get exploited (Always cooperate). Forgive: go back to cooperating once the other does, or one slip means war forever (Grudger). Clear: be simple enough that the other can figure you out. In every setting with long enough games, the top of the ranking is full of nice strategies.

The shadow of the future

Cooperation only pays if you will meet again. If both players know which round is the last, defecting in it costs nothing, so the Last-round traitor quietly takes over (try "Everyone knows the end"). Then the round before becomes the last real one, and so on: in theory it unravels to the start. With a secret or random end there is no last round to betray, and nice strategies win, as long as another round is likely enough.

Mistakes need forgiveness

With a little noise, two Tit for Tats fall into an echo: one slip, then they take turns punishing each other. Strategies that forgive (Soft majority, Tit for Two Tats, Generous Tit for Tat) move to the top and Tit for Tat drops to the middle; Hard Tit for Tat and Two Tits for Tat fall to the bottom, Grudger into the bottom third. This is the point of the Veritasium video about the tournaments: in a noisy world, be a bit more forgiving than tit for tat.

Tit for Tat is not unbeatable

Which strategy comes first depends on who else is playing. Among these 25, Gradual (punish harder for each new defection, then make peace) edges out Tit for Tat, as it did in Beaufils, Delahaye and Mathieu's 1996 tournaments. But the winners always share the four rules above, and nasty strategies never win once the games are long.

Go further: The Evolution of Trust by Nicky Case. A beautiful 30-minute interactive explainer of the same game theory. It shows why trust grows when the game is non-zero-sum (both can win) and repeated, why it collapses when people play only once or the game turns zero-sum, and how a little noise (misunderstandings) changes which strategy wins. A great companion to this page.

Play it at ncase.me/trust ↗