In well-mixed populations with pure strategies the replicator equation returns the equilibrium fractions of cooperators and defectors. The system has up to three equilibria depending on the parameter values R, S, T and P: x1 = 0 and x2 = 1 are always fixed points and x3 = (S - P)/(T + S - R - P) is a third fixed point whenever it lies in the interval (0,1). The same results hold for well-mixed populations adopting mixed strategies where each individual cooperates with a certain probability p. This propensity to cooperate p evolves towards one of the fixed points derived for pure strategies. To illustrate this, consider a homogenous population where all individuals cooperate with probability p. The fate of a rare mutant q is then given by

dm/dt = m (Pq - P)

where m denotes the frequency of the mutant and P the average population payoff. Since the mutant strategy is rare this can be approximated by

dm/dt = m (Pq - Pp)

which means the mutant can invade whenever Pq - Pp > 0. Again for small m we obtain Pq = p q R + p(1 - q) S + (1 - p) q T + (1 - p)(1 - q) P and similalry Pp = p q R + p(1 - q) S + (1 - p) q T + (1 - p)(1 - q) P. Thus, q successfully invades whenever

(q - p) [p(R - T) + (1 - p) (S - P) ] > 0

holds. This result can now be applied to the Prisoner's Dilemma and Snowdrift or Hawk-Dove games. The Prisoner's Dilemma is characterized by T > R > P > S and therefore the expression in square brackets is always negative. Consequentially, any mutant with q < p can invade and take over the population (the latter can be derived from the first equation which is not restricted to rare mutants). Thus, in the long run, the propensity to cooperate converges to x1 = 0 - just as in the pure strategy case.

The argument for the Snowdrift or Hawk-Dove game is slighlty more complicated. Because of the payoff ranking T > R > S > P the expression in square brackets can be both positive or negative, depending on the value of p. It switches sign for

p = (S - P)/(T - R + S - P) = x3.

For simplicity let us consider only mutants with arbitrarily small deviations from the resident strategy p. It follows that for p < x3, a mutant with a slightly higher q can invade but if p > x3 only mutants with slightly lower q can invade. Thus, eventually the propensity to cooperate in the population converges to x3 - again as in the case of pure strategies.

Note that the above argument is easily generalized to random, arbitrarily large mutations but then one can no longer assume homogenous resident populations. Rather, the resident population may consist of a mixture of two strategies p, p' with p < x3 and p' > x3. But then the mutant q either satisfies the conditions for invasion for p and p' or for neither of them.

## Dynamical regimes

The following examples illustrate and highlight different relevant scenarios but at the same time they are meant as suggestions and starting points for further exploring and experimenting with the dynamics of the system. If your browser has JavaScript enabled, the following links open a new window containing a running lab that has all necessary parameters set as appropriate.

### Legend

Time evolution of the propensity to cooperate in well-mixed populations with individuals adopting mixed strategies and engaging in prisoner's dilemma and snowdrift interactions.

 Color code: Maximum Minimum Mean ### Prisoner's Dilemma

In the Prisoner's Dilemma mutants with lower probabilities to cooperate are better off which leads to a continuous decrease of the readiness to cooperate in the population until cooperative behavior vanishes*.

The sample simulation shows the time evolution of the readiness to cooperate in a well-mixed population playing the Prisoner's Dilemma when starting with a mean initial propensity to cooperate of 99% in a population of 10'000 individuals. ### Snowdrift and Hawk-Dove game

In the Snowdrift or Hawk-Dove game the success of mutant strategies depends on the current state/composition of the population. As demonstrated above, the mean readiness to cooperate eventually approaches an intermediate value as specified by the fixed point x3*.

The sample simulation shows the time evolution of the readiness to cooperate in a well-mixed population playing the Snowdrift or Hawk-Dove game when starting with an initial mean propensity to cooperate of 1% in a population of 10'000 individuals.

(*) In individual based simulations, mutations lead to some variance in the strategies present in the population and therefore the applets plot not only the mean propensity to cooperate but also the minimum and maximum values. Besides, in biologically motivated models it is reasonable to assume that mutations add only minor changes to the parental strategy. Therefore mutants are assigned a new strategy q = p + s where p is the parental strategy and s is a Gaussian distributed random variable with a small standard deviation. For small standard deviations the difference in payoffs for mutants and residents becomes very small. This can result in an enormous slowing down of the simulations because the reproductive success is proportional to Pq - Pp. To avoid this we set the reproductive success proportional to (1 + exp[ (Pq - Pp)/k])-1 where k denotes a noise term. With this rule, small differences in payoffs are amplified for small k and in addition it introduces an interesting form of errors since worse performing individuals may still manage to reproduce with a small probability - which is certainly a reasonable assumption in an imperfect world. Strictly speaking this update rule no longer corresponds to the replicator equation but it still reproduces the essential results even quantitatively. The update rule of the players is one of the many parameters that can be changed in the VirtualLabs and you are encouraged to compare the two approaches.

## VirtualLab

Along the bottom of the VirtualLab there are several buttons to control the execution and the speed of the simulations. Of particular importance are the Param button and the data views pop-up list on top. The former opens a panel that allows to set and change various parameters concerning the game as well as the population structure, while the latter displays the simulation data in different ways.

 Color code: Maximum Minimum Mean
 Strategy code: Defect Cooperate
 Payoff code: Low High

Note: For the strategies, the shades of grey indicates the individual's readiness to cooperate with black indicating defection and white full cooperation.

Java applet on cooperation in structured populations. Sorry, but you are missing the fun part!
Params Views Controls Pop up panel to set various parameters. Pop up list of different data presentations. Reset simulation Start/resume simulation Next generation Interrupt simulation Idle time between updates. On the right your CPU clock determines the update speed while on the left updates are made roughly once per second. Mouse clicks on the graphics panels start, resume or stop the simulations.
Structure - Strategy Mean frequency Data views Snapshot of the spatial arrangement of strategies. Time evolution of the strategy frequencies. Frequency distribution of mixed strategies Snapshot of the spatial distribution of payoffs. Time evolution of the mean payoff of each strategy together with the average population payoff. Histogram of payoffs for each strategy.

## Game parameters

The list below describes only the few parameters related to the Prisoner's Dilemma, Snowdrift and Hawk-Dove games. Follow the link for a complete list and detailed descriptions of all other parameters such as spatial arrangements or update rules on the player and population level.

Reward:
reward for mutual cooperation.
Temptation:
temptation to defect, i.e. payoff the defector gets when matched with a cooperator.
Sucker:
sucker's payoff which denotes the payoff the cooperator gets when matched with a defector.
Punishment:
punishment for mutual defection.
Init mean, init sdev:
initial fractions of cooperators and defectors. If they do not add up to 100%, the values will be scaled accordingly.
Mutation rate:
the probability for a mutation to occur whenever an individual reproduces. This parameter is found on the Misc parameter tab.
Mutation type, mutation sdev:
mutations can occur either uniformly distributed in the interval [0,1] or modify the parental strategy by a Gaussian distributed random variable with mean zero and the specified standard deviation. This parameter is found on the Misc parameter tab.