Two prisoners are each offered a deal, and the best choice for each seems to be betraying the other, yet both would be better off staying silent. This prisoner’s dilemma calculator takes the four payoffs, each player’s chance of cooperating and the number of rounds to give your expected payoff per round, the other player’s payoff, your expected total, the value of always cooperating or always defecting, and whether the payoffs are a true dilemma.
How the calculation works
- Your expected payoff = P(both cooperate) × R + P(you cooperate, the other defects) × S + P(you defect, the other cooperates) × T + P(both defect) × P, with each probability the product of the two players’ chances.
- The other player’s payoff swaps the roles of S and T: they receive T when you cooperate and they defect, and S when you defect while they cooperate.
- Always cooperate = q × R + (1 − q) × S, and always defect = q × T + (1 − q) × P, where q is the chance that the other player cooperates.
- A true prisoner’s dilemma needs T > R > P > S, so that defecting is the best reply to anything, and 2R > T + S, so that cooperating is better than taking turns.
Example
With payoffs T = 5, R = 3, P = 1, S = 0, you cooperate 70% of the time and the other player 40%. Your expected payoff per round is 0.28 × 3 + 0.42 × 0 + 0.12 × 5 + 0.18 × 1 = 1.62, and the other player’s is 0.28 × 3 + 0.42 × 5 + 0.12 × 0 + 0.18 × 1 = 3.12. Over 10 rounds you expect 16.2. Against a player who cooperates 40% of the time, always cooperating is worth 0.4 × 3 = 1.2 per round and always defecting is worth 0.4 × 5 + 0.6 × 1 = 2.6. The payoffs form a true dilemma.
Why it matters
The dilemma is the basic model of cooperation in game theory, economics, politics and biology, from price wars to arms races and shared resources. Computing expected payoffs with mixed strategies shows why defecting is tempting and how much a group loses when everyone follows it.
Good to know
The model assumes that players choose independently and that each round is the same, and it ignores memory, reputation and learning, which are central to strategies such as tit for tat in repeated games. Payoffs are treated as utility, and in real life people also care about fairness and the future. The result is an expected value, and actual outcomes vary from round to round.
Related tools
The expected value calculator weighs outcomes by their probability, and the probability calculator handles the chances that feed into the model.