Skip to content
All apps

Cooperation & evolution

About this app

The iterated prisoner's dilemma in three views: an Axelrod tournament with nine strategies and a builder for your own, the evolution of population shares over generations, and a spatial grid after Nowak & May where cooperators and defectors can be painted in. Tit for Tat wins the tournament without winning a single match; on the grid, cooperators hold out in groups.

How cooperation can emerge

In the prisoner’s dilemma, defecting is the better choice for each player whatever the other does, because T > R > P > S. If both defect, both get the punishment P instead of the reward R. Repeating the game changes this. In 1980 Robert Axelrod ran two computer tournaments, and both were won by Anatol Rapoport’s tit for tat: start nice, retaliate against defection, forgive after cooperation. In Nowak and May’s spatial grid (1992) each cell plays its neighbours and copies the most successful one; cooperators in compact clusters can hold their ground against defectors.

What the app shows

Three views show the same game. In the tournament every strategy plays every other one and its own twin, with a pairing table and a ranking showing average scores and win–draw–loss records. The strategies are tit for tat, tit for two tats, grim trigger, Pavlov, always cooperate, always defect, random, Joss and prober, plus one of your own from the strategy builder. In the evolution view population shares grow in proportion to their average score. In the grid you set the temptation b and paint in cooperators and defectors. The payoff matrix, number of rounds and noise are adjustable.

Try it yourself

Run the tournament and notice that tit for tat wins without winning a single duel: it never defects first, so it never outscores an opponent, but it scores well against many of them. Add noise and watch retaliation chains cost tit for tat points while more forgiving strategies such as Pavlov gain. Start the evolution from a world of defectors. In the grid, begin with a single defector and vary b: below about 1.8 cooperators hold the field, between 1.8 and 2 constantly changing patterns appear.

Frequently asked questions

What is the prisoner’s dilemma?
The prisoner’s dilemma is a game in which two players choose between cooperating and defecting. Defecting pays for each player whatever the other does, yet if both defect they end up worse off than if both had cooperated. It is a basic model of the conflict between self-interest and the common good.
Why does tit for tat win?
Tit for tat starts by cooperating, retaliates immediately against defection, forgives after cooperation and is easy for opponents to read. It therefore cooperates stably with nice strategies and can be exploited by defectors only once. In Axelrod’s tournaments this earned it the highest total score, even though it won no individual duel.
What did Nowak and May show with the spatial prisoner’s dilemma?
In 1992 Martin Nowak and Robert May showed that cooperation can survive without memory or strategy when players only interact with their neighbours on a grid. Cooperators in connected clusters earn enough among themselves to hold the border against defectors. Depending on the temptation value, the patterns are stable, ever-changing or dominated by defectors.
What can I try in the cooperation and evolution app?
You pit nine strategies and one of your own against each other in a tournament, follow their shares over generations and paint cooperators and defectors onto a grid. Payoffs, number of rounds, error rate and temptation b are adjustable. An info panel explains Axelrod’s tournaments and the Nowak–May model.

Subject: Sociology & networks

More from Sociology & networks

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps