Three ingredients, one matrix
Game Theory is the mathematics of situations where an agent's outcome depends not only on its own choice but on everyone else's too. Every game reduces to three ingredients: a set of players, a set of strategies available to each, and a payoff function mapping every combination of choices to a value for each player. For two players, that payoff function is conveniently drawn as a matrix: rows are Player 1's options, columns are Player 2's, and each cell holds the pair of resulting payoffs.
The most famous payoff matrix in the field is the Prisoner's Dilemma. Two suspects, questioned separately, can each Cooperate (stay silent) or Defect (betray). If both cooperate, each serves one year. If both defect, each serves two. If one defects while the other cooperates, the defector walks free and the cooperator serves three years. Look at it from either player's side: whatever the other one does, defecting always shaves a year off your own sentence. Defection is a dominant strategy — a choice that is best no matter what the opponent does, so no prediction about them is even needed.
Player 2: C Player 2: D Player 1: C (-1, -1) (-3, 0) Player 1: D ( 0, -3) (-2, -2) both dominant strategies -> (D, D), payoff (-2,-2) yet (C, C) with payoff (-1,-1) is better for both
Both players reasoning correctly end up worse off than if they had somehow agreed to cooperate. That gap between individually rational choices and a collectively better outcome is the central tension that game theory exists to formalise — and it recurs everywhere from arms races to advertising spend to overfishing shared waters.
Nash equilibrium: nobody can do better alone
John Nash's 1950 contribution was a general definition of a stable outcome that applies to any game, not just the Prisoner's Dilemma. A Nash equilibrium is a set of strategies, one per player, such that no player can improve their own payoff by switching strategy while everyone else's choice stays fixed. Every player's move is a best response to what everyone else is doing. Nash proved — using Kakutani's fixed-point theorem — that every finite game has at least one such equilibrium, possibly one where players randomise over their options rather than commit to a single pure choice (a mixed strategy).
In the Prisoner's Dilemma, (Defect, Defect) is the unique Nash equilibrium: given that the opponent defects, defecting is still your best response, so neither player has an incentive to move unilaterally. In Rock-Paper-Scissors no pure strategy survives being predicted, so the only Nash equilibrium has each player randomising uniformly across the three options — each move played a third of the time, the exact frequency that leaves an opponent indifferent between all their own choices. Some games have more than one equilibrium: in the Stag Hunt, two hunters can jointly bring down a stag (high reward, requires trust) or each catch a rabbit alone (lower but guaranteed). Both (Stag, Stag) and (Rabbit, Rabbit) are Nash equilibria, and which one a population lands on is a matter of history and expectation, not payoff maximisation alone.
Repetition changes everything
A one-shot Prisoner's Dilemma has no room for reputation. Play it repeatedly against the same opponent, however, and defecting today can be punished tomorrow — the threat of future retaliation becomes a strategic asset in itself. In 1980 political scientist Robert Axelrod ran a computer tournament inviting researchers to submit strategies for the iterated Prisoner's Dilemma. The simplest entry, Tit-for-Tat — cooperate first, then copy whatever the opponent did last round — won convincingly, and won again in a follow-up tournament with more entrants. Its four traits (nice, retaliatory, forgiving, simple) turned out to matter more than any amount of cleverness against a diverse population of rivals.
Strategies that survive: evolutionary game theory
John Maynard Smith and George Price reframed the question biologically: instead of asking which strategy a rational individual should pick, ask which strategy can persist in a population subject to natural selection. A strategy is an Evolutionarily Stable Strategy (ESS) if, once it dominates a population, no small group of mutants playing something else can invade and spread. The textbook example is Hawks and Doves: hawks always escalate a contest over a resource and fight until someone is injured; doves display but retreat the moment a hawk escalates. An all-dove population is invadable by a hawk mutant, who wins every contest unhurt. An all-hawk population is invadable by a dove mutant, who avoids the costly fights. Neither pure strategy is stable — instead the population settles at a mixed equilibrium frequency.
ESS condition: payoff(I, I) > payoff(J, I) for every mutant strategy J Hawk-Dove equilibrium frequency of hawks: p* = V / C (when V < C) V = value of the resource, C = cost of losing a fight
This population-level view generalises further: agents placed on a spatial lattice who only interact with neighbours can sustain cooperation even without repeated pairwise play or reciprocity, because cooperators cluster together and shield each other from being exploited by nearby defectors. Local structure alone can rescue cooperation from a fate that a well-mixed population cannot escape.
How the simulation here models it
The Game Theory simulation on this site places a population of agents on a grid, each carrying a strategy — cooperate or defect, or a probability of each — and plays a Prisoner's Dilemma-style payoff against neighbours every round. After each round, agents can imitate more successful neighbours or mutate, which is exactly the update rule evolutionary game theory studies: payoff determines reproduction, not rational deliberation. Watching clusters of cooperators survive, shrink or spread as the payoff parameters change is a direct visual demonstration of an ESS forming, breaking, or never existing at all — you can nudge the reward for exploiting a cooperative neighbour and watch the whole population's behaviour tip.
Game theory's reach extends well past two-player toy matrices. In economics, Nash equilibrium predicts prices in oligopolies and underlies auction design — a Vickrey (second-price) auction makes bidding your true value a dominant strategy. In political science, Mutual Assured Destruction is analysed as a Nash equilibrium sustained purely by the catastrophic cost of deviating. In computer science, Braess's paradox shows that adding a road to a network can make every driver's commute worse once each one routes selfishly to a new equilibrium. The common thread in all of it is the same matrix logic laid out above: define the players, the strategies, the payoffs, and ask what nobody can improve on alone.
Frequently asked questions
Is a Nash equilibrium always the best outcome for everyone?
No. A Nash equilibrium is a stability concept, not an optimality one — it only guarantees that no single player can do better by switching strategy alone. The Prisoner's Dilemma is the classic counterexample: mutual defection is the unique Nash equilibrium, yet mutual cooperation would leave both players better off. Getting there requires something outside a one-shot game, such as repetition or enforceable agreements.
Why does Tit-for-Tat work so well in the iterated Prisoner's Dilemma?
Tit-for-Tat won Robert Axelrod's 1980 tournaments by combining four properties: it is nice (never defects first), retaliatory (punishes defection immediately), forgiving (returns to cooperation as soon as the opponent does), and simple (opponents can predict and adapt to it). Against a field of more complicated strategies, that mix of clarity and reciprocity outperformed anything trying to be clever.
What does it mean for a strategy to be evolutionarily stable?
An Evolutionarily Stable Strategy (ESS) is one that, once common in a population, cannot be outcompeted by any small group of mutants playing a different strategy. It replaces individual rationality with population-level persistence under selection. In the Hawk-Dove model neither pure strategy is an ESS; instead a mixed population of hawks and doves at a specific ratio determined by the cost and value of the resource is stable.
Try it live
Everything above runs in your browser — open Game Theory and watch strategies rise and fall across a population as the payoffs change. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Game Theory simulation