Do you want to try MathType?

Get Free Trial

The Prisoner’s Dilemma Explained: How Math Predicts Human Choices

Prisoner's dilema
prisoner's dilema

Why the Prisoner’s Dilemma Still Surprises Us

The prisoner’s dilemma is one of the most famous problems in game theory, illustrating how rational decision-making can lead to unexpected and often suboptimal results. At first glance, the choice seems simple -stay silent or betray- but when math comes into play, the optimal choice becomes far less obvious. This problem not only has deep mathematical roots but also sheds light on human behavior when trust, risk, and personal gain are at stake.

The Classic Prisoner’s Dilemma: Rules, Payoffs, and the Big Question

Imagine this scene:
Two friends are arrested on suspicion of committing a crime together. There isn’t enough evidence to convict them on the main charge, but the police have enough to get them for a lesser offense. They are placed in separate rooms, unable to talk to each other.

Each is offered the same deal:

  • If you betray your friend and testify against him while he stays silent, you walk free, and he gets 10 years in prison.
  • If you both betray each other, you each get 5 years in prison.
  • If you both stay silent, the police can only convict you of the minor offense, and you each serve 1 year.

Here’s the catch: the choice must be made without knowing what the other will do. No messages, no hints, no body language: just your decision against his.

This setup captures the heart of the prisoner’s dilemma: a situation where the choice that seems safest for you individually may lead to a worse outcome for both of you.

Mathematically, the situation is represented in a payoff matrix, showing every possible combination of choices and their outcomes. The numbers indicate the amount of years in prison:

Prisoner A / Prisoner BStays SilentBetrays
Stays Silent(1, 1)(10, 0)
Betrays(0, 10)(5, 5)

How to read this table:

  • Each cell shows (years in prison for A, years in prison for B).
  • Example: If A stays silent and B betrays, A spends 10 years in prison and B goes free.
  • The best collective outcome is (1, 1), but the temptation to achieve (0, 10) or (10, 0) often leads to (5, 5).

Note: In game theory, this same matrix can also be shown with negative values to treat prison years as “losses” and work with payoff maximization

Game Theory Insights: Why Rational Players Often Betray

From a game theory perspective, the prisoner’s dilemma is a textbook example of a non-cooperative game where individual incentives clash with collective benefit. The key concept here is the Nash equilibrium: a state where no player can improve their own outcome by changing their decision, assuming the other player’s choice remains the same.

Let’s break it down:

  • If Prisoner A assumes Prisoner B will stay silent, the best move for A is to betray, because going free (0 years) is better than serving 1 year.
  • If Prisoner A assumes Prisoner B will betray, the best move for A is also to betray, because 5 years is still better than 10.

The same logic applies symmetrically to Prisoner B. This makes betrayal the dominant strategy: it gives a better individual outcome regardless of the other player’s choice.

Paradoxically, when both players follow this “rational” strategy, they end up with a worse result (5 years each) than if they had cooperated (1 year each). This outcome is a classic illustration of how short-term self-interest can harm everyone in the long run.

Psychologically, this aligns with risk aversion:

  • The fear of being the “loser” (serving 10 years while the other goes free) outweighs the potential benefit of mutual cooperation.
  • Without trust or communication, betrayal feels like the safest defensive move.

This tension between individual rationality and collective optimality is what makes the prisoner’s dilemma so powerful and why it keeps appearing in economics, politics, and everyday life.

Math Behind the Dilemma: From Payoff Matrices to Equations

Beyond the narrative, the prisoner’s dilemma can be expressed with mathematical precision, allowing us to analyze decisions systematically. In game theory, the outcome of each player’s choice can be described using a payoff function. Here, the function for Prisoner A, Pa(x,y), returns the years in prison for A, given their choice x and Prisoner B’s choice y. Likewise, Pb(x,y) does the same for B. If we let S represent “stay silent” and B represent “betray,” the model becomes:

PA(S,S) = 1, PA(S,B) = 10, PA(B,S) = 0, PA(B,B) = 5, 

PB(S,S) = 1, PB(S,B) = 0, PB(B,S) = 10, PB(B,B) = 5, 

These equations encapsulate the dilemma: each player faces a tempting choice that benefits them in the short term but can lead to worse results if both act the same way. Writing the problem in this functional form allows mathematicians and students to explore strategies, identify equilibria such as the Nash equilibrium, and even simulate repeated games to observe how cooperation or betrayal evolves over time. A useful tool for producing these equations clearly is MathType, a professional equation editor developed by Wiris. MathType supports LaTeX, MathML, and integrates with Word, Google Docs, Moodle, and other LMS platforms, making it ideal for creating clean, shareable mathematical notation for scenarios like the prisoner’s dilemma. With MathType, it becomes simple to present these functions, tweak the values, and visually test how small changes in the game’s setup might alter players’ decisions.

Variations That Change the Game. Iterations, Trust, and Strategy

Small changes to the prisoner’s dilemma can transform its outcome. In the classic one-shot game, betrayal dominates, but in iterated versions -where players face the dilemma repeatedly- cooperation can emerge. Strategies like Tit-for-Tat (start by cooperating, then copy the opponent’s last move) often outperform aggressive approaches by rewarding trust and punishing betrayal.

Allowing communication or introducing a shared history increases cooperation rates, reflecting how reputation shapes decisions in real life. Changing the payoffs -for example, making one prisoner risk more years than the other- or adding multiple players creates new dynamics similar to public goods problems. In all these variations, the math stays the same, but psychology and strategy shift, often turning predictable betrayal into sustainable cooperation.

From Prison Cells to Boardrooms: Real-World Applications

The prisoner’s dilemma is not just a fascinating mathematical concept: it’s a lens for understanding decision-making in real-world contexts. From market competition to global politics, from animal cooperation to neighborhood disputes, the same tension between individual interest and collective benefit keeps reappearing. What makes it so powerful is its ability to explain why rational actors often choose options that leave everyone worse off.

  • In economics, the prisoner’s dilemma emerges when companies decide whether to cooperate or compete aggressively. A classic case is a price war: if both firms keep prices high, they enjoy healthy profits. However, the temptation to lower prices to capture more market share can lead to both companies reducing prices, ultimately shrinking profits for everyone. Similar dynamics occur in cartel agreements, advertising battles, and joint ventures, where mutual restraint would yield better returns.
  • In politics, the dilemma often plays out on the international stage. Climate change agreements are a prime example: all nations benefit from lower global emissions, but each has an incentive to let others shoulder the cost while continuing their own high-emission activities. 
  • In biology, evolutionary game theory uses the prisoner’s dilemma to model cooperation in nature. Predators that hunt in packs, birds that share vigilance duties, or species engaged in mutualistic relationships all face the same temptation to free-ride on others’ efforts. When too many individuals defect, cooperation collapses, reducing survival chances for all.
  • Even in everyday life, the structure of the dilemma is easy to spot. Neighbors deciding whether to contribute to maintaining shared spaces, colleagues debating whether to share credit for a project, or members of online communities choosing whether to moderate harmful behavior all face the same choice: act for the group’s benefit or focus solely on personal gain. Trust and long-term thinking are often what make the difference between mutual benefit and mutual loss.

Cooperation, Math, and Your Turn to Play the Prisoner’s Dilemma

Although the prisoner’s dilemma suggests rational players will betray, humans often cooperate, especially when trust, shared history, or future interactions are at stake. Social norms, empathy, and reputation can outweigh short-term gains, and in repeated games, cooperation often becomes the winning move.Now it’s your turn: open MathType and design your own prisoner’s dilemma. Change the payoffs -what if betrayal brings harsher penalties, or cooperation gets extra rewards? See how the “rational” choice shifts, and discover whether your version favors trust or cunning strategy. The game is yours: play it smart.

Share

Related articles