This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
The Prisoner’s Dilemma goes back to Merrill Flood and Melvin Dresher at the RAND Corporation in 1950; Albert Tucker gave it its name and its story of two prisoners. Each of two players either cooperates or defects. Whatever the other one does, defecting pays more, yet two cooperators both earn more than two defectors. In a well-mixed population, where everyone meets everyone, defectors therefore always win. Martin Nowak and Robert May showed in 1992 that space alone changes this. Their players sit on a grid and have no memory: in each generation a player either cooperates with everyone or defects against everyone, plays its neighbors, and then takes over the strategy of its most successful neighbor. Clusters of cooperators earn enough from each other to hold their ground against the defectors at their edge, and for a range of payoffs the two strategies coexist forever in patterns that never settle. A single defector placed among cooperators grows into a symmetric, ever-changing pattern that Nowak and May called a kaleidoscope.
What you see
A 200 by 200 grid whose edges wrap around, so the grid is a torus. Each cell is one player. Blue cells cooperated in this generation and the last one, red cells defected in both. Green cells have just switched to cooperating and yellow cells have just switched to defecting, so the green and yellow cells mark where the boundary between the two strategies is moving. At normal speed the simulation advances one generation per frame, 60 generations per second.
Rule
Each generation, every cell plays one round of the game with each of its eight neighbors (up, down, left, right and the four diagonals) and one round with itself, as in the original model. Two cooperators each earn . A defector meeting a cooperator earns the temptation , and the cooperator it exploits earns . Two defectors earn . Nowak and May chose , the boundary case of the dilemma: against a defector, defecting pays no more than cooperating, which leaves as the only parameter. A cooperator with cooperating neighbors therefore scores , a defector with cooperating neighbors scores . Then all cells switch at once to the strategy of the highest scorer among themselves and their eight neighbors. A cell keeps its strategy unless a neighbor scored strictly more.
Because the scores take only a few discrete values, the outcome changes only at the values of where a defector’s score crosses a cooperator’s score. From a random start with half of the cells cooperating, this grid gives:
- for , cooperators win most of the grid: 72 to 99% of the cells, depending on . Defectors survive in small clusters, and for and above some cells keep switching back and forth.
- for , the two strategies coexist in spatial chaos: clusters of cooperators keep growing, being invaded and splitting up, and about a quarter of all cells switch strategy every generation. The cooperator fraction fluctuates around 0.315, the same for starts with 10%, 50% or 90% cooperators. Nowak and May found that this fraction approaches on large grids.
- at , defectors take over the whole grid.
Presets
Cooperators hold (b = 1.7): a random start with half of the cells cooperating. In the first generation the defectors exploit almost every cooperator, and only 3% of the cells still cooperate. The surviving cooperator clusters then grow back, and after about 30 generations, half a second, cooperators hold 88% of the grid. The defectors are left in small clusters, and about 5% of the cells keep switching.
Spatial chaos (b = 1.9): the same random start, and also the default. The cooperators first drop below 1% of the grid, recover, and after about 60 generations, one second, settle into the chaotic regime. Over the following generations the cooperator fraction stays between 0.29 and 0.35.
Kaleidoscope (b = 1.9): a single defector in the middle of a grid of cooperators. It infects its neighbors, and the defecting region grows by one cell per generation in every direction. The rule is deterministic and treats all directions alike, so the pattern keeps an exact four-fold symmetry (checked over 2000 generations). After about 100 generations the growing pattern reaches the edges and meets itself across the wrap-around; it stays symmetric and keeps changing, with a cooperator fraction between 0.24 and 0.39.
Parameters
Temptation b: the payoff a defector earns from each cooperating neighbor, 1 to 2. It applies immediately, so the grid can be moved from one regime to the other while it runs.
Initial condition: Random, or Single defector in a grid of cooperators. It applies when the simulation is reset.
Initial cooperator fraction: the share of cooperators in the random start, shown only for that start. It applies when the simulation is reset. In the chaotic regime it makes no difference to the long-run fraction, unless cooperators are so rare that none of their clusters survives the first generations: with 2% cooperators the defectors win at .