Skip to content
Other

Prisoner's Dilemma Calculator

Enter payoff values and choose a strategy for each player to see how the Prisoner's Dilemma plays out in a single game or across many iterated rounds. The calculator shows each player's total score, the cooperation rate, whether the outcome is a Nash equilibrium, and a round-by-round breakdown. Classic presets are built in so you can explore the game instantly.

Your details

Choose a preset to load standard payoff values, or pick Custom to enter your own.
Payoff when you defect and your opponent cooperates. Must be the highest value (T > R > P > S).
Payoff when both players cooperate.
Payoff when both players defect (the Nash equilibrium outcome).
Payoff when you cooperate but your opponent defects. Must be the lowest value.
Player A's decision rule for each round.
Player B's decision rule for each round.
How many times the two players interact. Use 1 for a one-shot game.
rounds
Player A total scoreHighly cooperative
30

Cumulative payoff for Player A across all rounds

Player B total score30
Cooperation rate1%
Player A avg per round3
Player B avg per round3
Nash equilibrium outcome?No - at least one player cooperated in the last round
Pareto optimal outcome?Yes - mutual cooperation was the most common outcome
Single-game outcomeMutual cooperation: A gets 3, B gets 3
Player A33
Player B33

Difference: 0 (Player B higher)

  • Total score
  • Avg per round
015301610
Round
Cumulative Score
RoundPlayer APlayer B
133
266
399
41212
51515
61818
72121
82424
92727
103030
  • Player A
  • Player B

Both players scored equally.

  • Over 10 rounds, Player A scored 30.0 and Player B scored 30.0.
  • Mutual cooperation occurred in 100% of rounds.
  • High mutual cooperation suggests the strategies are sustaining a cooperative equilibrium, which maximizes joint welfare over time.

Next stepTry pairing Tit for Tat vs. Always Defect, then vs. Tit for Tat, to see why reciprocal strategies perform well in tournaments.

Round-by-round results

RoundA ChoiceB ChoiceA PayoffB PayoffA TotalB Total
1CooperateCooperate3333
2CooperateCooperate3366
3CooperateCooperate3399
4CooperateCooperate331212
5CooperateCooperate331515
6CooperateCooperate331818
7CooperateCooperate332121
8CooperateCooperate332424
9CooperateCooperate332727
10CooperateCooperate333030

C = Cooperate (stay silent), D = Defect (betray). Payoffs follow the matrix set above.

What is the Prisoner's Dilemma?

The Prisoner's Dilemma is the most studied example in game theory. Two players each choose independently whether to cooperate or defect. If both cooperate, each gets the reward R. If one defects while the other cooperates, the defector takes the higher temptation payoff T while the cooperator is left with the sucker payoff S. If both defect, each gets the lower punishment P. The paradox is that defecting is the individually rational choice in a single game (it is a dominant strategy), yet mutual defection leaves both players worse off than if they had both cooperated - the Pareto optimal outcome.

How to use this calculator

Choose a preset scenario (Classic, Prison Sentences, Stag Hunt) or enter custom payoff values in the T, R, P, S fields. Select a strategy for each player and set the number of rounds. Results update instantly: you see each player's total score, average per round, cooperation rate, and whether the outcome is a Nash equilibrium or Pareto optimal. The round-by-round table and cumulative score chart let you trace exactly how strategies play out over time. For a one-shot game set rounds to 1; for iterated play use 10 or more rounds to see strategies like Tit for Tat establish cooperation.

Strategies explained

Always Cooperate always stays silent regardless of history - it is exploited easily but maximizes joint welfare when both players use it. Always Defect is the dominant strategy in a one-shot game and can never do worse than the opponent in a single round, but in repeated play it suppresses mutual cooperation. Tit for Tat starts by cooperating and then mirrors the opponent's last move. It won Robert Axelrod's famous computer tournaments in the 1980s by being nice (starts cooperating), retaliatory (punishes defection immediately), forgiving (returns to cooperation as soon as the opponent does), and clear (simple enough for the opponent to learn). Grudger (Grim Trigger) cooperates until the opponent defects once, then defects forever - maximum retaliation. Pavlov (Win-Stay, Lose-Shift) repeats the last move if it yielded a good payoff and switches if it did not, which allows it to recover from accidental defections without becoming permanently exploitative.

Nash equilibrium and Pareto optimality

In the classic Prisoner's Dilemma, mutual defection is the only Nash equilibrium: neither player can improve their outcome by switching unilaterally. However, it is not Pareto optimal because both players would be better off under mutual cooperation - no outcome can improve one player's result without harming the other only at the mutual-cooperation point. This tension is the heart of the dilemma: individual rationality and collective welfare point in opposite directions. In iterated games, the future creates an incentive to cooperate because players can reward and punish past behavior. Robert Axelrod showed that strategies based on reciprocity dominate when the shadow of the future is long enough.

Prisoner's Dilemma payoff matrix

Player APlayer BA's payoffB's payoffOutcome label
CooperateCooperateRRMutual cooperation (Pareto optimal)
CooperateDefectSTA exploited (sucker)
DefectCooperateTSB exploited (sucker)
DefectDefectPPMutual defection (Nash equilibrium)

Standard notation: T = Temptation, R = Reward, P = Punishment, S = Sucker. The condition T > R > P > S and 2R > T + S must hold for a true Prisoner's Dilemma.

Frequently asked questions

Why is defecting called the 'dominant strategy' in a one-shot game?

A strategy is dominant if it gives a better or equal result no matter what the opponent does. If you expect your opponent to cooperate, defecting earns T instead of R (better). If you expect them to defect, defecting earns P instead of S (still better). So defecting beats or ties cooperating in every case, making it dominant. The tragedy is that when both players follow this logic they both end up at P - the mutual defection outcome - which is worse for both than the mutual cooperation payoff R.

What conditions define a true Prisoner's Dilemma?

Two conditions must hold. First, the payoffs must be ordered T > R > P > S (temptation beats reward, which beats punishment, which beats the sucker payoff). Second, the average of T and S must be less than twice R, written 2R > T + S. This second condition prevents the players from achieving a higher joint payoff by taking turns exploiting each other than by simply cooperating every round.

Why does Tit for Tat perform so well in repeated play?

Tit for Tat has four properties that Robert Axelrod identified as making it effective: it is nice (it never defects first), retaliatory (it punishes defection immediately), forgiving (it returns to cooperation as soon as the opponent does), and clear (opponents quickly learn what to expect). It can never outscore an individual opponent by a large margin, but it avoids being badly exploited and quickly establishes cooperation with cooperative partners - which makes its average payoff high across many opponents.

What is the 'shadow of the future' in iterated dilemmas?

The shadow of the future refers to how much future payoffs matter to the players relative to the current round. When the game is likely to continue (high shadow), cooperation can be sustained because defecting now risks triggering retaliation that reduces future payoffs. When the game is definitely ending in one more round (known last round), the incentive to defect reappears - a problem called the backwards induction paradox, which unravels cooperation in finitely repeated games with known endpoints.

Where does the Prisoner's Dilemma appear in real life?

Countless real situations share this structure: nuclear arms races (each side would prefer to disarm if the other did, but fears unilateral disarmament), climate agreements (each country prefers that others reduce emissions while it bears lower costs), price-setting by competing firms (both would profit from higher prices but each is tempted to undercut), and over-fishing of shared waters (each fleet benefits from restraint collectively but gains individually by taking more). Understanding the dilemma helps explain why international cooperation requires enforcement mechanisms, repeated interaction, and transparency.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…