MATHEMATICSMathematics Calculator
๐ŸŽฒ

Prisoner's Dilemma โ€” Game Theory & Nash Equilibrium

Two players, cooperate or defect. Dominant strategy: defect. Nash equilibrium: mutual defection. Tit for Tat wins iterated tournaments. Axelrod (1984).

Concept Fundamentals
Temptation
T > R
Reward
R > P
Punishment
P > S
Iteration
2R > T+S

Did our AI summary help? Let us know.

Axelrod tournaments: Tit for Tat won against 14 strategies. Nash equilibrium: no player benefits from unilaterally changing strategy. Evolutionary game theory: cooperation can evolve with reciprocity.

Key quantities
Temptation
T > R
Key relation
Reward
R > P
Key relation
Punishment
P > S
Key relation
Iteration
2R > T+S
Key relation

Ready to run the numbers?

Why: Rational self-interest leads to suboptimal outcome. Defect dominates cooperate; mutual defection is Nash equilibrium. Iteration enables cooperation via reciprocity.

How: Payoff matrix: (R,R) mutual cooperate, (T,S) unilateral defect, (S,T) sucker, (P,P) mutual defect. Tit for Tat: copy opponent's last move.

Axelrod tournaments: Tit for Tat won against 14 strategies.Nash equilibrium: no player benefits from unilaterally changing strategy.

Run the calculator when you are ready.

Explore StrategiesSingle-Round & Iterated
๐ŸŽฒ
GAME THEORYStrategic Decisions

Prisoner's Dilemma โ€” Nash Equilibrium & Cooperation

Single-round and iterated games. Tit for Tat, Axelrod's tournaments. Evolutionary game theory. Real-world applications.

Prisoner's Dilemma Calculator

Calculate the outcome of a single-round Prisoner's Dilemma game.

Sample Examples

Mutual Cooperation

Both players cooperate (stay silent), receiving a mild punishment.

Mutual Defection

Both players defect (confess), receiving a substantial punishment.

Player 1 Betrays

Player 1 defects while Player 2 cooperates. Player 1 gets the best outcome.

Player 2 Betrays

Player 2 defects while Player 1 cooperates. Player 2 gets the best outcome.

prisoners_dilemma.sh
GAME RESULT
$ run_game --mode=single --p1=cooperate --p2=cooperate
Player 1
-1
Player 2
-1
Prisoner's Dilemma
cooperate vs cooperate
(-1, -1)
numbervibe.com/calculators/mathematics/exploratory/prisoners-dilemma-calculator

The Prisoner's Dilemma

Two prisoners are faced with a choice: cooperate (stay silent) or defect (confess). The payoffs represent the negative of prison sentence length (0 = no prison, -10 = maximum sentence).

Payoff Values

Preset Examples

Sample Examples

Mutual Cooperation

Both players cooperate (stay silent), receiving a mild punishment.

Mutual Defection

Both players defect (confess), receiving a substantial punishment.

Player 1 Betrays

Player 1 defects while Player 2 cooperates. Player 1 gets the best outcome.

Player 2 Betrays

Player 2 defects while Player 1 cooperates. Player 2 gets the best outcome.

Game Results

Player 1

Strategy:Cooperate (Silent)
Payoff:-1

Player 2

Strategy:Cooperate (Silent)
Payoff:-1

Pareto Optimal

This is a Pareto optimal outcome. However, it's not stable as each player has an incentive to defect.

Payoff Matrix

Player 2
CooperateDefect
Player 1Cooperate
-1,-1
-10,0
Defect
0,-10
-5,-5

Each cell shows: (Player 1's payoff, Player 2's payoff)

Mutual cooperation
Exploitation (one defects, one cooperates)
Mutual defection

For educational and informational purposes only. Verify with a qualified professional.

๐Ÿงฎ Fascinating Math Facts

๐ŸŽฒ

Classic payoffs: T=5, R=3, P=1, S=0. Defect dominates; (D,D) is Nash

โ€” Game Theory

๐Ÿ”„

Tit for Tat: start cooperate, then copy opponent. Won Axelrod's 1984 tournament

โ€” Iterated Games

๐Ÿ“‹ Key Takeaways

  • โ€ข Nash equilibrium: Mutual defection is the stable outcomeโ€”neither player can improve by changing alone
  • โ€ข Axelrod's tournaments: Tit for Tat wonโ€”nice, retaliatory, forgiving, clear
  • โ€ข Evolutionary game theory: Cooperation can evolve when games are repeated
  • โ€ข Real-world: Arms races, climate, business, public goodsโ€”same structure

๐Ÿ’ก Did You Know?

๐ŸŽฒFlood & Dresher (1950) formalized it. Tucker named it "Prisoner's Dilemma" with the jail storySource: History
๐Ÿ†Tit for Tat won Axelrod's 1980s tournaments. Simple: cooperate first, then copy opponentSource: Axelrod
๐ŸงฌEvolutionary game theory: strategies with higher payoffs spread. Cooperation can be evolutionarily stableSource: Biology
๐ŸŒClimate change, arms races, overfishingโ€”all Prisoner's Dilemmas. Individual incentive to defectSource: Real World
๐Ÿ“ŠPayoff order: T > R > P > S. Temptation > Reward > Punishment > Sucker. Creates the dilemmaSource: Game Theory
๐Ÿ”„Iterated vs one-shot: Repeated play allows reciprocity. Grim Trigger punishes defection foreverSource: Strategies

What is the Prisoner's Dilemma?

The Prisoner's Dilemma is a classic scenario in game theory that demonstrates why two rational individuals might not cooperate, even when it appears in their best interest to do so. This paradox, first formalized by mathematicians Merrill Flood and Melvin Dresher in 1950, has profound implications across economics, psychology, sociology, and political science.

In the standard scenario, two suspects are arrested and separated. Each prisoner must choose to either cooperate with their accomplice by staying silent or defect by betraying them. The outcomes depend on the combination of choices:

  • If both stay silent (cooperate), they each receive a reduced sentence (reward for cooperation, R)
  • If one betrays while the other stays silent, the betrayer goes free (temptation payoff, T) while the silent prisoner receives the maximum sentence (sucker's payoff, S)
  • If both betray each other, they both receive a moderate sentence (punishment for mutual defection, P)

For a true Prisoner's Dilemma, the payoffs must satisfy the inequality: T > R > P > S. This structure creates the paradox where individual rationality leads to a collectively suboptimal outcome.

Key Concepts:

  • Game Theory: A mathematical framework for analyzing strategic interactions
  • Nash Equilibrium: A stable state where no player can benefit by changing only their own strategy
  • Payoff Matrix: A grid showing outcomes for all possible strategy combinations
  • Dominant Strategy: A strategy that provides better payoffs regardless of opponent's choice

Standard Prisoner's Dilemma Payoff Matrix

Player 2
CooperateDefect
Player 1Cooperate
-1,-1
-10,0
Defect
0,-10
-5,-5

Each cell shows: (Player 1's payoff, Player 2's payoff)

Mutual cooperation
Exploitation (one defects, one cooperates)
Mutual defection

Typical values: R=-1, T=0, P=-5, S=-10

Game Theory Foundations

Game theory provides the mathematical framework for understanding strategic interactions like the Prisoner's Dilemma. Developed primarily in the 20th century by pioneers like John von Neumann, John Nash, and Thomas Schelling, game theory has become fundamental to fields ranging from economics to evolutionary biology.

Elements of a Game

  • Players: The decision-makers (two prisoners in our case)
  • Strategies: The possible actions each player can take (cooperate or defect)
  • Payoffs: The outcomes or utilities associated with each combination of strategies
  • Information: What players know when making their decisions

Types of Games

  • Zero-sum vs. Non-zero-sum: The Prisoner's Dilemma is non-zero-sum, meaning players can both gain or lose
  • Simultaneous vs. Sequential: In the classic version, decisions are made simultaneously
  • Perfect vs. Imperfect Information: Players typically have perfect information about the payoff structure
  • Single-shot vs. Iterated: The game can be played once or repeatedly

Nash Equilibrium Explained

A Nash equilibrium, named after mathematician John Nash, is a solution concept in game theory where no player can benefit by changing only their own strategy while the other players keep theirs unchanged. In the context of the Prisoner's Dilemma, this leads to a fascinating paradox.

The Prisoner's Dilemma Paradox

In the standard Prisoner's Dilemma, the Nash equilibrium occurs when both players defect (confess), even though they would both be better off if they cooperated (stayed silent).

This creates a paradox: rational self-interest leads both players to defect, resulting in a worse outcome for both compared to mutual cooperation. This demonstrates how individually rational decisions can lead to collectively suboptimal outcomes.

Finding the Nash Equilibrium

To find the Nash equilibrium in the Prisoner's Dilemma, we analyze each player's best response to the other's strategy:

  • If Player 2 cooperates, Player 1's best response is to defect (gain T instead of R)
  • If Player 2 defects, Player 1's best response is to defect (gain P instead of S)
  • Similarly for Player 2, defection is always the best response
  • Therefore, mutual defection is the Nash equilibrium

Real-world Applications: The Prisoner's Dilemma helps explain various social and economic phenomena, including arms races, environmental protection, business competition, and public goods problems. In each case, individual incentives may lead to collectively harmful outcomes.

Iterated Prisoner's Dilemma

While a single round of the Prisoner's Dilemma leads to mutual defection, the dynamics change dramatically when the game is played repeatedly. This repeated version, called the Iterated Prisoner's Dilemma, allows for the emergence of cooperation through strategies that respond to the opponent's previous moves.

Key Strategies

Tit for Tat

Starts with cooperation, then mimics the opponent's previous move. This simple strategy has proven remarkably effective in promoting cooperation.

Always Defect

Defects in every round regardless of the opponent's actions. Performs well in single encounters but typically fails in the long run.

Grudger (Grim Trigger)

Cooperates until the opponent defects, then defects forever. This unforgiving strategy enforces cooperation through the threat of permanent punishment.

Emergence of Cooperation

In the 1980s, political scientist Robert Axelrod organized tournaments where various strategies competed in iterated Prisoner's Dilemma games. Surprisingly, the simple Tit for Tat strategy, submitted by Anatol Rapoport, won both tournaments.

Successful strategies in iterated games tend to have four characteristics:

  • Nice: Begin with cooperation
  • Retaliatory: Respond to defection with defection
  • Forgiving: Return to cooperation after punishment
  • Clear: Have a simple, understandable pattern

Evolution of Cooperation

The iterated Prisoner's Dilemma has profound implications for understanding how cooperation can evolve in competitive environments. It helps explain cooperative behaviors in nature, business partnerships, international relations, and other scenarios where repeated interactions occur. This contrasts with the pessimistic outcome of the single-round game, suggesting that long-term relationships can foster cooperation even among self-interested parties.

How to Use This Prisoner's Dilemma Calculator

Our calculator allows you to explore both single-round and iterated Prisoner's Dilemma games, helping you understand strategic interactions and equilibrium concepts.

Single-Round Game Instructions

  1. Select Single Round mode using the toggle at the top.
  2. Choose a strategy for each player: Cooperate (stay silent) or Defect (confess).
  3. Adjust payoff values if desired, or use the default values:
    • R: Reward for mutual cooperation (default: -1)
    • S: Sucker's payoff for unilateral cooperation (default: -10)
    • T: Temptation to defect (default: 0)
    • P: Punishment for mutual defection (default: -5)
  4. Click Calculate to see the results, including payoffs and whether the outcome is a Nash Equilibrium.
  5. View the payoff matrix for a visual representation of all possible outcomes.
  6. Show Step-by-Step Solution for a detailed explanation of the game's outcome.

Iterated Game Instructions

  1. Select Iterated Game mode using the toggle at the top.
  2. Choose a strategy for each player:
    • Always Cooperate: Always stays silent regardless of opponent's moves
    • Always Defect: Always betrays regardless of opponent's moves
    • Tit for Tat: Starts with cooperation, then copies opponent's previous move
    • Grudger: Cooperates until opponent defects, then always defects
    • Random: Makes random decisions
  3. Set the number of rounds for the iterated game.
  4. Adjust payoff values if desired.
  5. Click Calculate to run the simulation.
  6. Examine the results, including total scores, cooperation rates, and round-by-round breakdowns.
  7. Switch between Per Round and Cumulative views of the score graph.

๐Ÿ” Tips for Insightful Analysis

  • Try different strategy combinations to see which performs best in the long run
  • Observe how the Nash Equilibrium in single-round games differs from optimal strategies in iterated games
  • Experiment with different payoff values to see how they affect decision-making
  • Use the preset examples to quickly explore common scenarios
๐Ÿ‘ˆ START HERE
โฌ…๏ธJump in and explore the concept!
AI

Related Calculators