HomeArticlesPrisoner's Dilemma

Prisoner's Dilemma: Cooperation and the Evolution of Trust

Both players gain by defecting, yet both do worse if both defect. Repeat the game across a population and cooperation can still win.

mysimulator teamUpdated June 2026≈ 7 min read▶ Open the simulation

A payoff table that traps both rational players

Two suspects are interrogated separately. Each can stay silent (cooperate with the other) or betray their partner (defect). If both stay silent, both get a light sentence. If both betray, both get a moderate sentence. But if one betrays while the other stays silent, the betrayer goes free and the silent one gets the harshest sentence. The payoff structure — not the crime-drama framing — is the whole point: it is a single, deceptively simple table of numbers.

                  opponent cooperates   opponent defects
you cooperate     both get R (reward)   you get S (sucker), they get T (temptation)
you defect        you get T, they get S both get P (punishment)

requires:  T > R > P > S     (and 2R > T + S for the repeated game)

Look at it from one player's side, for either choice the other player makes: defecting always pays more than cooperating (T beats R, P beats S). That makes defection a dominant strategy — the rational choice regardless of what the other player does. Both players reasoning this way land on mutual defection, worth P each, even though mutual cooperation was available and worth the strictly better R each. That gap between individually rational and collectively better outcomes is the dilemma, and it is a Nash equilibrium: neither player can improve by switching alone.

live demo · a population of strategies competing and adapting● LIVE

Repeating the game changes everything

A single round leaves no room for retaliation, so defection wins outright. Play the same two players against each other for many rounds, and each round's outcome becomes visible to both sides before the next round — suddenly defecting today can cost you cooperation tomorrow. This is the iterated prisoner's dilemma, and it opens the door to strategies more sophisticated than pure cooperation or pure defection.

Axelrod's tournaments and tit-for-tat

In the early 1980s, political scientist Robert Axelrod ran computer tournaments where researchers submitted strategy programs to play the iterated game against every other submission, round-robin, and totalled the scores. The winner, submitted by Anatol Rapoport, was strikingly simple: tit-for-tat — cooperate on the first move, then on every later move just copy whatever the opponent did last time. Against a huge field of far more elaborate strategies, tit-for-tat won on the strength of four properties Axelrod identified: it is nice (never defects first), retaliatory (punishes defection immediately), forgiving (returns to cooperation the instant the opponent does), and clear (simple enough for opponents to recognize and adapt to).

Evolving cooperation in a population

Move from one pair of players to a whole population, where individuals are paired repeatedly, scores accumulate, and strategies that score well reproduce more (or simply get copied more, imitated by less successful neighbours). This turns game theory into evolutionary dynamics: a population of pure defectors is stable against a lone cooperator, who gets exploited every time, but a population of tit-for-tat players resists invasion by defectors, since a defector meets retaliation almost immediately and loses the long-run payoff race. Whether cooperation can get a foothold at all typically depends on players interacting repeatedly with the same partners, or within networks where reputation and clustering let cooperators find and support each other rather than being scattered evenly among defectors.

Where the dilemma shows up outside the lab

The same structure recurs anywhere individual short-term incentive conflicts with collective long-term benefit: countries deciding whether to cut carbon emissions unilaterally, firms deciding whether to undercut a price-fixing agreement, animals deciding whether to groom a neighbour who might not groom back, or two companies deciding whether to keep advertising against each other even though both would be better off spending less. In every case, the theoretical result carries over directly: a single encounter favours defection, but repetition, reputation, and the prospect of future interaction are what make cooperation a rational, self-sustaining strategy rather than a naive one.

Frequently asked questions

Why is mutual cooperation not the Nash equilibrium of a single-shot game?

A Nash equilibrium is a pair of strategies where neither player can improve their own payoff by switching alone. Whatever the other player does, defecting always pays more than cooperating for the deciding player, so the only strategy pair where neither wants to switch is mutual defection, even though mutual cooperation would have given both players a better outcome.

Why did tit-for-tat do so well in Axelrod's tournaments?

Tit-for-tat is nice (it never defects first), retaliatory (it punishes defection immediately, so exploitation does not pay), forgiving (it returns to cooperation the moment the opponent does), and simple enough for other strategies to read and adapt to. That combination let it out-score far more complicated and aggressive submitted strategies once matches were played repeatedly, not just once.

Why does the shadow of the future matter for whether cooperation evolves?

If players expect many more rounds together, or interact within a population where reputations persist, the future cost of retaliation can outweigh today's gain from defecting, which makes conditional cooperation individually rational. If the game is known to end soon, or interactions are one-off and anonymous, that deterrent disappears and defection tends to dominate again.

Try it live

Everything above runs in your browser — open Prisoner's Dilemma and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Prisoner's Dilemma simulation

What did you find?

Add reproduction steps (optional)