Prisoner Dilemma Calculator

Model both prisoners with custom payoff assumptions. Test expected values, best responses, and equilibrium stability. Reveal better choices through transparent calculations and practical guidance.

Calculated Strategy Report

This summary appears after submission and stays above the form for quick comparison.

Awaiting calculation No equilibrium checked yet
Expected payoff for Prisoner A
-
Per stage, using entered cooperation probabilities.
Expected payoff for Prisoner B
-
Per stage, using entered cooperation probabilities.
Discounted total for Prisoner A
-
Across the chosen number of rounds.
Discounted total for Prisoner B
-
Across the chosen number of rounds.
Best-response snapshot
No best-response summary yet.
Repeated-game cooperation check
No repeated-game threshold yet.
Outcome probability table
Outcome Probability Payoff A Payoff B Weighted A Weighted B Pure Nash?
Submit the calculator to generate this table.
Efficiency and equilibrium notes
No strategy notes yet.
Validation and matrix diagnosis
No matrix diagnosis yet.

Calculator Inputs

Enter a payoff matrix, cooperation assumptions, and repeated-game settings. The tool evaluates expectations, dominant actions, pure Nash equilibria, and long-run cooperation thresholds.

Payoff when you defect while the other cooperates.
Payoff for each player when both cooperate.
Payoff for each player when both defect.
Payoff when you cooperate while the other defects.
Used to compute outcome probabilities and B's best response.
Used to compute outcome probabilities and A's best response.
Represents how much future payoffs still matter.
Applies to discounted totals under unchanged strategy probabilities.
Choose how detailed the calculated report should appear.

Example Data Table

This example uses a classic prisoner dilemma setup where temptation exceeds reward, reward exceeds punishment, and punishment exceeds the sucker payoff.

Scenario A action B action A payoff B payoff Example probability
Mutual cooperation Cooperate Cooperate 3 3 24%
A exploited Cooperate Defect 0 5 36%
B exploited Defect Cooperate 5 0 16%
Mutual defection Defect Defect 1 1 24%

The example probabilities above come from A cooperating 60% of the time and B cooperating 40% of the time.

Formula Used

The calculator applies core game-theory formulas for expected value, best response, pure-strategy equilibrium, and repeated-game sustainability.

1) Outcome probabilities

Pr(CC) = pA × pB

Pr(CD) = pA × (1 - pB)

Pr(DC) = (1 - pA) × pB

Pr(DD) = (1 - pA) × (1 - pB)

2) Expected stage payoff

E[A] = Pr(CC)R + Pr(CD)S + Pr(DC)T + Pr(DD)P

E[B] = Pr(CC)R + Pr(CD)T + Pr(DC)S + Pr(DD)P

3) Best response against an opponent's cooperation chance q

U(Cooperate | q) = qR + (1 - q)S

U(Defect | q) = qT + (1 - q)P

The larger value indicates the best response. Equal values mean the player is indifferent.

4) Discounted repeated value over n rounds

G = (1 - δ^n) / (1 - δ), for δ ≠ 1

Discounted total = Expected stage payoff × G

5) Infinite repeated cooperation threshold with grim trigger

δ* = (T - R) / (T - P)

If the chosen discount factor is at least this threshold, sustained cooperation can be incentive-compatible under a grim-trigger style punishment rule.

How to Use This Calculator

  1. Enter the four payoffs: temptation, reward, punishment, and sucker payoff.
  2. Set the estimated cooperation percentages for Prisoner A and Prisoner B.
  3. Choose a discount factor and number of rounds for repeated-game analysis.
  4. Press Calculate Strategy to generate the report above the form.
  5. Review expected payoffs, best responses, pure Nash equilibria, and social efficiency.
  6. Use Download CSV for a spreadsheet-friendly summary and Download PDF for a portable report.
Tip: A classic prisoner dilemma usually satisfies T > R > P > S and 2R > T + S. The calculator checks these conditions automatically.

FAQs

1) What does this calculator measure?

It measures expected payoffs, best responses, pure Nash equilibria, social efficiency, and repeated-game cooperation thresholds from a custom prisoner dilemma payoff matrix.

2) Why are cooperation percentages included?

They convert the payoff matrix into outcome probabilities, allowing the calculator to estimate expected payoffs instead of only listing theoretical outcomes.

3) What makes a matrix a classic prisoner dilemma?

A classic case usually needs temptation greater than reward, reward greater than punishment, punishment greater than the sucker payoff, and mutual cooperation socially preferred.

4) What is a pure Nash equilibrium here?

It is an outcome where neither prisoner can improve their payoff by changing their action alone while the other prisoner's action stays fixed.

5) What does the discount factor mean?

It shows how strongly future payoffs matter. Higher values make long-run cooperation more attractive because future consequences carry more weight.

6) Why can defection still dominate?

In the standard prisoner dilemma, defecting gives a higher payoff whether the other player cooperates or defects, so it becomes the dominant action.

7) What is the social optimum?

It is the outcome with the highest combined payoff for both prisoners, even if each individual may still face an incentive to defect.

8) Can this tool analyze nonstandard matrices?

Yes. You can enter any numeric payoffs, and the calculator will diagnose whether the matrix behaves like a classic prisoner dilemma or another game.

Related Calculators

2×2 Normal-Form Nash Equilibrium Finder Calculatornash equilibrium solverdominant strategy findermixed strategy calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.