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).
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.
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.
Run the calculator when you are ready.
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.
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
Player 2
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 | |||
|---|---|---|---|
| Cooperate | Defect | ||
| Player 1 | Cooperate | -1,-1 | -10,0 |
| Defect | 0,-10 | -5,-5 | |
Each cell shows: (Player 1's payoff, Player 2's payoff)
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?
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 | |||
|---|---|---|---|
| Cooperate | Defect | ||
| Player 1 | Cooperate | -1,-1 | -10,0 |
| Defect | 0,-10 | -5,-5 | |
Each cell shows: (Player 1's payoff, Player 2's payoff)
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
- Select Single Round mode using the toggle at the top.
- Choose a strategy for each player: Cooperate (stay silent) or Defect (confess).
- 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)
- Click Calculate to see the results, including payoffs and whether the outcome is a Nash Equilibrium.
- View the payoff matrix for a visual representation of all possible outcomes.
- Show Step-by-Step Solution for a detailed explanation of the game's outcome.
Iterated Game Instructions
- Select Iterated Game mode using the toggle at the top.
- 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
- Set the number of rounds for the iterated game.
- Adjust payoff values if desired.
- Click Calculate to run the simulation.
- Examine the results, including total scores, cooperation rates, and round-by-round breakdowns.
- 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
Related Calculators
Babylonian Numbers Converter
Convert between decimal and Babylonian numbers with this calculator. Learn about the ancient Babylonian number system.
MathematicsCyclomatic Complexity Calculator
Calculate the cyclomatic complexity of code or flowcharts to measure structural complexity and maintainability.
MathematicsGalileo's Paradox of Infinity Calculator
Explore the fascinating Galileo's Paradox which demonstrates that infinite sets can have the same cardinality as their proper subsets, challenging our intuitive understanding of infinity.
MathematicsHilbert's Hotel Paradox Calculator
Explore the fascinating infinite hotel paradox conceived by mathematician David Hilbert. See how an infinite hotel can accommodate new guests even when it's "full".
MathematicsInvolute Function Calculator
Calculate the involute function based on a given pressure angle, essential for gear design and manufacturing.
MathematicsLinear Feedback Shift Register (LFSR) Calculator
Generate and analyze sequences from Linear Feedback Shift Registers with different configurations, visualize the register state, and determine sequence...
Mathematics