← Lab

Game Theory

Payoff matrices, Nash equilibria, and iterated tournaments.

Edit payoff values directly. Switch presets to explore classic games.

Game Prisoner's Dilemma · Nash Equilibria · Dominant Strategy
, ,
, ,
Nash Equilibrium Pareto Optimal
ANALYSIS
ITERATED TOURNAMENT
# Strategy Total Score Avg / Round
EVENT LOG

What's going on here

Game theory studies strategic interaction between rational agents. When your outcome depends not just on what you do but on what someone else does, you're in a game.

The payoff matrix

Two players choose simultaneously. Each cell shows both payoffs — (Row's, Column's). Neither player knows the other's choice in advance.

Nash equilibrium

A pair of strategies where neither player can improve by switching alone. It's a stable resting point — not necessarily the best outcome, just one nobody wants to unilaterally leave.

The Prisoner's Dilemma

The most famous game. Two suspects can cooperate (stay silent) or defect (betray). Defecting is individually rational no matter what the other does — it dominates. But when both defect, they're worse off than if both cooperated. That's the dilemma: individual rationality leads to collective irrationality.

Dominant strategies

A strategy is dominant if it's at least as good as every alternative, regardless of what the opponent does. When one exists, a rational player always picks it. In the Prisoner's Dilemma, Defect dominates Cooperate for both players.

Mixed strategies

Sometimes there's no pure Nash equilibrium where players pick one strategy for certain, or there are multiple equilibria and players need a way to randomize. A mixed strategy assigns probabilities to each option, chosen so the opponent is indifferent between their choices. The mixed Nash equilibrium probabilities shown above make each player's expected payoff equal across their options.

Iterated games change everything

Play the Prisoner's Dilemma once and defection wins. Play it hundreds of times and something different happens — cooperation can emerge. With repeated play, reputation matters. You can punish defectors and reward cooperators.

Axelrod's tournament

In the 1980s, Robert Axelrod ran a computer tournament inviting strategies to play iterated Prisoner's Dilemma. Tit-for-Tat won — a strategy that's just four lines of code: cooperate on the first move, then copy whatever your opponent did last time. It wins by being nice (never defects first), retaliatory (punishes defection immediately), and forgiving (returns to cooperation as soon as the opponent does).