How the Prisoner's Dilemma works
The Prisoner's Dilemma is the canonical two-player game in game theory. Each player independently chooses to Cooperate or Defect, and the payoff each receives depends on both choices. The game is defined by four payoffs — Temptation (T), Reward (R), Punishment (P), and Sucker's payoff (S) — that must satisfy T > R > P > S. This calculator checks that ordering, works out the Nash equilibrium and the cooperative (Pareto-optimal) outcome, and — for the repeated version of the game — calculates the minimum patience (discount factor) needed to sustain cooperation.
Formula and method
For a single round, compare each player's payoff from Defecting versus Cooperating against every possible opponent move. Since T > R (defecting against a cooperator beats mutual cooperation) and P > S (defecting against a defector beats being the sucker), Defect strictly dominates Cooperate for both players — so (Defect, Defect) is the unique Nash equilibrium, with each player earning P. Yet (Cooperate, Cooperate) pays each player R > P, so the equilibrium is Pareto-inefficient; the efficiency loss per player is R − P. For the infinitely repeated game, a grim-trigger strategy (cooperate until the opponent ever defects, then defect forever) sustains mutual cooperation as a subgame-perfect equilibrium whenever the discount factor satisfies δ ≥ δ* = (T − R) / (T − P). This calculator also checks the standard iterated condition 2R > T + S, which ensures alternating cooperation and defection between the two players is never better than steady mutual cooperation.
Common sources of error
- Wrong payoff ordering: if T > R > P > S does not hold, the game is not actually a Prisoner's Dilemma — it may reduce to a different game (such as Chicken or Stag Hunt) where the analysis below does not apply.
- Confusing δ with a probability of cooperating: δ is the discount factor (or probability the game continues another round), not the chance either player cooperates — set it to a value strictly between 0 and 1.
- Ignoring the iterated condition: even when T > R > P > S holds, if 2R ≤ T + S then alternating "you defect, I defect" rounds can pay as well as or better than steady cooperation, weakening the case for grim-trigger cooperation.
Checking your result
With the classic textbook payoffs T=5, R=3, P=1, S=0, the Nash equilibrium payoff is 1 (both defect), the cooperative payoff is 3 (both cooperate), the efficiency loss is 2 per player, and the grim-trigger threshold is δ* = (5−3)/(5−1) = 0.5 — so cooperation is sustainable in the repeated game whenever players value future rounds at least half as much as the present one. Use these numbers to sanity-check your own inputs: if you shrink the gap between T and R, δ* should fall (cooperation gets easier to sustain), and if you shrink the gap between T and P, δ* should rise.
Applications
The Prisoner's Dilemma models any situation where individually rational choices lead to a worse collective outcome: price wars between firms, arms races, common-resource overuse, and doping in sports all share this structure. The repeated-game threshold δ* is used in economics and evolutionary biology to explain when cooperation, reciprocity, or cartel discipline can emerge and persist without external enforcement — the more the players value the future (higher δ), the easier cooperation is to sustain.