Game Theory - Prisoner’s Dilemma
Game Theory · 8 min read
A few weeks ago I came across a Veritasium video on the Prisoner's Dilemma, one of those videos that starts as background watching and ends with you staring at the ceiling at midnight, turning an idea over and over. If you haven't seen it, I'd strongly recommend it before reading further. Derek does what he does best: takes a deceptively simple thought experiment and reveals a universe of consequence inside it.
But what made me want to go deeper was not just the mathematics. It was the news.
We are living through a period where the US-Iran standoff is once again sharpening: sanctions, nuclear timelines, back-channel signals, rhetorical escalation. Two players, each calculating whether to cooperate or push harder, each aware that the other is doing the same calculation. Neither trusting, neither able to commit credibly. I kept thinking: this is not just geopolitics. This is the Prisoner's Dilemma, played out at the level of nations, with enormously higher stakes.
So I built a simulator to see for myself, to actually watch the strategies play out round by round and understand intuitively why some approaches collapse and others hold. What follows is what I found. The mathematics surprised me, the real-world parallels unsettled me, and I think they will do the same to you.
Imagine you are sitting across from a stranger. Neither of you can speak. A referee slides two cards face-down in front of each of you: one says Cooperate, the other says Defect. You each pick one, simultaneously, and the payoff depends on the combination.
If you both cooperate, you both walk away with a modest reward.
If you both defect, you both walk away with almost nothing.
But if you defect while the other cooperates? You walk away with everything. They walk away with nothing.
Now here is the uncomfortable truth: no matter what the other person does, you are always better off defecting.
If they cooperate and you defect → you win big.
If they defect and you defect → at least you didn't get exploited.
The cold logic of self-interest says: always defect. And yet, societies function. Businesses form lasting partnerships. Evolution produced altruism. Something is wrong with the logic, or rather, something is missing from it.
What is missing is time.
The Setup: Numbers Behind the Dilemma
The Prisoner's Dilemma is usually presented as a one-shot game. But the real world is not one-shot. You interact with the same people repeatedly: colleagues, suppliers, neighbours, nations. The game theorists call this the Iterated Prisoner's Dilemma, and it changes everything.
The payoffs in our simulator follow the classic matrix:
| Opponent Cooperates | Opponent Defects | |
|---|---|---|
| You Cooperate | You: 3, Them: 3 | You: 0, Them: 5 |
| You Defect | You: 5, Them: 0 | You: 1, Them: 1 |
The numbers encode a subtle tension:
- Mutual cooperation (3, 3) is better for both than mutual defection (1, 1)
- But the temptation to defect is always there; you gain 5 instead of 3
- And if you cooperate while the other defects, you get the worst outcome: 0
This is why it is a dilemma. The rational individual move and the collectively optimal move point in opposite directions.
Eight Strategies Walk Into a Room
Over the decades, game theorists have proposed many strategies for playing the iterated game. Here are eight worth knowing, and you can pit them against each other in the simulator below.
Always Cooperate (ALLC)
The eternal optimist. Cooperates every single round, no matter what. Generous to a fault, and fatally exploitable.
Always Defect (ALLD)
The pure opportunist. Defects every round, every time. Seems invincible in a one-on-one fight. We will return to this.
Tit for Tat (TFT)
The famous strategy from Robert Axelrod's 1980 computer tournaments. Simple: cooperate on round one, then do exactly what your opponent did last round. Mirror them perfectly, rewarding cooperation, punishing defection, and forgiving immediately.
Tit for Two Tats (TF2T)
More patient than TFT. Only retaliates after the opponent defects twice in a row. Resistant to noise and accidental defections.
Generous Tit for Tat (GTFT)
Like TFT but with a built-in forgiveness mechanism: it randomly cooperates about 20% of the time even after being betrayed. Prevents death spirals of mutual retaliation.
Grim Trigger
The unforgiving strategist. Cooperates faithfully until the moment you defect once, then defects forever. No second chances. Maximally retaliatory. Surprisingly effective as a deterrent, but brittle.
Pavlov (Win-Stay, Lose-Shift)
Psychologically intuitive: if your last round went well (score ≥ 3), repeat what you did. If it went poorly, switch. Learns to cooperate with cooperators and defect against defectors, without explicitly tracking the opponent.
Random
The coin-flipper. Cooperates or defects with equal probability. Useful as a baseline.
The Duel: Why ALLD Looks Invincible
Fire up the simulator and run a duel: Always Defect vs Tit for Tat, 50 rounds.
Watch what happens in the move tape. Round 1: ALLD defects, TFT cooperates. ALLD earns 5, TFT earns 0. From round 2 onwards, TFT mirrors the defection and both players lock into mutual defection, earning 1 each round for the remaining 49 rounds.
Final score: ALLD wins by exactly 4 points, the spoils of that single round-1 exploitation, carried forever.
Now try ALLD vs Always Cooperate. ALLD earns 5 every single round. ALLC earns 0. The gap compounds mercilessly.
In any duel, ALLD has a brutal property: it either wins or draws. It never loses. Against cooperators it exploits. Against other defectors it ties. It seems like the unbeatable strategy.
This is where most people stop thinking about game theory. And this is exactly where it gets interesting.
The Tournament: Why ALLD Finishes Last
In 1980, political scientist Robert Axelrod invited game theorists, economists, psychologists and computer scientists to submit strategies for a round-robin tournament. Every strategy played every other strategy for 200 rounds. The winner was determined by total score accumulated across all games.
Run the same tournament in the simulator above. Click the Tournament tab and hit Run.
What you will find, consistently, is that Always Defect finishes near the bottom.
The reason is arithmetic. ALLD's strategy poisons every relationship it touches:
- vs Always Cooperate → ALLD earns 5 per round ✓
- vs Tit for Tat → ALLD earns 5 once, then 1 per round for the rest ✗
- vs Grim Trigger → same punishment, permanently ✗
- vs Pavlov → locked into mutual defection quickly ✗
- vs another ALLD → 1 per round, every round ✗
The round-1 theft of 4 extra points is overwhelmed by dozens of rounds of grinding mutual punishment. Meanwhile, TFT playing against the majority of cooperative strategies earns 3 points every single round. That compounds beautifully.
The mathematics is stark: 49 rounds x 3 points = 147 points for TFT vs 1 + 49 x 1 = 50 points for ALLD in a single head-to-head. Multiply that across the whole field and ALLD's total collapses.
The Insight: Cooperation is a Long Game
This is the central revelation of the iterated Prisoner's Dilemma, and it maps onto the real world with almost uncomfortable precision.
Why businesses build reputations: A supplier who cheats you once earns a short-term gain and loses a long-term customer. Repeated interaction makes honesty economically rational.
Why nations sign treaties: Even rivals cooperate when the game is expected to continue indefinitely. The shadow of future interaction disciplines present behaviour.
Why evolution produced altruism: In populations where individuals interact repeatedly, cooperative strategies can invade and dominate even when defection is locally optimal.
Axelrod distilled TFT's success into four properties that any robust strategy should have:
- Nice: never defect first
- Retaliatory: don't let defection go unanswered
- Forgiving: don't hold grudges too long
- Clear: be predictable enough that others can learn to cooperate with you
Grim Trigger fails on forgiveness. Always Cooperate fails on retaliation. Always Defect fails on being nice. Only TFT and its variants satisfy all four, and the tournament confirms it.
Try It Yourself
A few experiments worth running in the simulator above:
Experiment 1: The exploitation trap
Duel ALLD vs ALLC at 30 rounds. Watch the score gap open immediately and never close.
Experiment 2: The mirror effect
Duel TFT vs ALLD. Notice how TFT's score tracks ALLD's almost exactly after round 1. Punishment is immediate and symmetric.
Experiment 3: Forgiveness vs rigidity
Duel Generous TFT vs Grim Trigger. Both start cooperative. GTFT recovers from accidents; Grim Trigger never does.
Experiment 4: The full picture
Tournament at 50 rounds. Notice that every top-ranked strategy is conditionally cooperative; they want to cooperate but will retaliate.
The Cheater's Paradox
In any single encounter, cheating is the rational choice. But in a world of repeated encounters, nice strategies outperform selfish ones.
The lesson is not that people are naturally good, or that selfishness is wrong. The lesson is structural: the length of the shadow cast by the future determines how people behave today. When interactions are one-shot, as in anonymous transactions and disposable relationships, defection flourishes. When interactions are repeated and reputations travel, as in communities, professions and long-term partnerships, cooperation becomes the dominant strategy not by moral instruction but by simple mathematics.
The prisoner's dilemma does not tell us to be nice. It tells us that in the right conditions, being nice wins.
And that, perhaps, is more convincing.
Play with the simulator above and see if you can find a strategy that consistently beats Tit for Tat in the tournament. It is harder than it looks.
Further reading
- Robert Axelrod, The Evolution of Cooperation (1984)
- Martin Nowak, Five Rules for the Evolution of Cooperation, Science (2006)
- William Poundstone, Prisoner's Dilemma (1992)
- This game theory problem will change the way you see the world
Tagged: Game Theory · Mathematics · Decision Science · Complexity

Comments
Post a Comment