In a population of varying density, an attempt at gathering N individuals that engage in a public goods interaction might not always be successful at low population densities and instead of a group of size N, only SN individuals participate. If S = 0 or 1 no interaction occurs. This leads to a natural feedback between population density and game theoretical interactions. The dynamics of cooperators and defectors in public goods interactions is determined by their respective payoffs obtained in randomly formed groups of S individuals. Independent of whether the focal individual is a cooperator or a defector, it receives the same expected payoff from its S - 1 co-players. Hence, the sole determinant of success is the return of the individual's own investment c, which is (r/S - 1) c. For 1 < r < S defectors are always better off as required by the traditional formulation of the public goods game. However, for r > S the social dilemma is relaxed and cooperation dominates. Nevertheless, defectors outperform cooperators in any group consisting of both types (this represents an instance of Simpson's paradox). Also note that this is a fleeting state since thriving cooperators increases the average population payoff and hence the population density which in turn leads to larger interaction groups and puts defectors back into control.

The negative feedback between population density and interaction group size hinges on the fact that the group size can become smaller than r. For pairwise prisoner's dilemma interactions this is not the case: because S cannot vary (and is always equal to N = 2), either r < S always holds (in which case the population goes extinct) or r > S always holds (in which case defectors disappear but cooperators persist). The dynamic feed back cannot operate in either case.

This tutorial complements scientific articles co-authored with Miranda Holmes, Michael Doebeli and Joe Yuichiro Wakano and provides interactive Java applets to visualize and explore the systems' dynamic for parameter settings of your choice.

Dynamical scenarios

The following panels illustrate the rich dynamics of this system. The phase space is spanned by the population density x + y (or 1 - z) and the relative fraction of cooperators f = x / (x + y). The left boundary (z = 1) is attracting and consists of a line of stable fixed points (filled circles), which represent states where the population cannot maintain itself and disappears. Conversely, the right boundary, which denotes the maximal population density (z = 0), is repelling. In absence of cooperators (bottom boundary, f = 0), population densities decrease and eventually vanish. Finally, in absence of defectors (top boundary, f = 1), there are two saddle points (open circles) except for the last scenario where one is a stable node (filled circle). In addition, there may be an interior fixed point Q present.

The following list illustrates the different dynamical scenarios. A click on the image to the left, opens a new window with an interactive Java applet that allows to explore the dynamics by numerical integration of the differential equations. The initial condition is set with a mouse-click in the phase plane. Hit 'Run' for forward and backward integration of the differential equations for the given initial condition. The numerical integration can be interrupted by another mouse-click on the phase plane.


Dynamical scenarios

Trajectory of the interior fixed point Q for increasing multiplication factors r. Along this trajectory, the system undergoes a series of various types of bifurcations:

  1. No Q - extinction
  2. Q unstable node - extinction
  3. Q unstable focus - extinction
  4. Q stable focus - co-existence
  5. Q stable node - co-existence
  6. No Q - cooperation
-+Click to enlarge

Series of bifurcations

The position of the fixed point Q changes with the multiplication factor r. Q enters on the top left for low r and leaves at the top right for high r. For increasing r, the system undergoes a series of different types of bifurcations. The different dynamical scenarios (i)-(vi) apply depending on the location of Q. In (i) and (vi) Q is absent, in (ii), (iii) it is unstable and in (iv), (v) it is stable. Between scenarios (iii) and (iv) a Hopf bifurcation occurs and over a very narrow range of r, stable and unstable limit cycles can be observed.


No interior fixed point Q - extinction

No matter what the initial configuration of the cooperators and defectors, the population will invariably go extinct.

Hint: start from different initial configurations to get a better intuition of the dynamics.


Interior fixed point Q unstable node - extinction

The presence of the interior fixed point Q does not affect the evolutionary end state of the system - the population keeps going extinct irrespective of the initial conditions.

Hint: backwards intergration reveals the location of the unstable node when starting in a suitable part of the phase plane.


Interior fixed point Q unstable focus - extinction

For larger r, the interior fixed point Q turns into an unstable focus and - depending on the initial conditions - the population faces extinction in an oscillatory manner.


Interior fixed point Q unstable focus - stable limit cycle

For slightly higher r the interior fixed point Q is still an unstable focus but now surrounded by a stable limit cycle - the hallmark of a super critical Hopf bifurcation. Cooperators and defectors co-exist in never ending periodic oscillations.

Hint: often, the forward integration will not stop and keep tracking the stable limit cycle. Just click on the phase plane to stop forward integration and start the backward integration. Another click stops backward integration, too.


Interior fixed point Q stable focus - co-existence

Increasing r further leads to a Hopf bifurcation, the interior fixed point Q becomes a stable focus and the limit cycle disappears. Depending on the initial conditions, cooperators and defectors co-exist at some fixed densities. If exploitation by defectors is severe or population densities are too low, the population is unable to recover and goes extinct.


Interior fixed point Q stable node - co-existence

Another increase in r turns the interios fixed point Q into a stable node. As before, cooperators and defectors co-exist at some fixed densities only, they no longer approach the equilibrium in an oscillatory manner. Severe exploitation and low population densities again result in extinction.


No interior fixed point Q - cooperation

For high r, the interior fixed point Q disappears and the high density saddle node along f = 1, i.e. in absence of defectors, becomes a stable equilibrium. Cooperators and defectors can no longer co-exist but now its only the defectors that disappear, at least for favorable initial conditions. As always, severe exploitation and low population densities result in extinction.

Complex bifurcations

For larger group sizes N fascinating and much more complex Hopf bifurcations and dynamical scenarios are possible, which includes multiple, stable and unstable limit cycles. However, also note that r values for which these fascinating bifurcations occur is restricted to a tiny interval. Thus, despite their appeal from a dynamical systems' perspective, the limit cycles might be of only limited relevance for biological applications.


Complex Hopf bifurcations - multiple limit cycles

In this example, for N = 12, a stable and an unstable limit cycle exist on one side of the Hopf bifurcation and another stable limit cycle on the other side.

Hint: Try lowering r slightly to just below the Hopf-bifurcation (set r = 3.04). The interior fixed point Q is now an unstable focus surrounded by a stable limit cycle (see above).

In a population with a fraction x cooperators, y defectors and z = 1 - x - y available space, then the average payoff to cooperators fC and defectors fD is given by:

fD = r x / (1 - z) (1 - (1 - zN) / (N (1 - z)))
fC = fD - F(z)


F(z) = 1 + (r - 1) zN - 1 - r (1 - zN) / (N (1 - z)).

Note that this ivation assumes that the benefits of the public good is contingent on social interactions, i.e. a single participant in the public goods interaction cannot increase its capital. For a detailed derivation of the formulas please consult the scientific articles in the reference section.

Virtual lab

The applet below illustrates the different components. Along the bottom 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:CooperatorsDefectorsEmpty
 New cooperatorsNew defectorsNew empty
Payoff code:Low       High

Note: The shades of grey of the payoff scale are augmented by blueish and reddish shades indicating payoffs for mutual cooperation and defection, respectively.

Java applet on ecology in public goods games. Sorry, but you are missing the fun part!
ParamsPop up panel to set various parameters.
ViewsPop up list of different data presentations.
ResetReset simulation
RunStart/resume simulation
NextNext generation
PauseInterrupt simulation
SliderIdle time between updates. On the right your CPU clock determines the update speed while on the left updates are made roughly once per second.
MouseMouse clicks on the graphics panels start, resume or stop the simulations.
Data views
Structure - Strategy Snapshot of the spatial arrangement of strategies.
Mean frequency Time evolution of the strategy frequencies.
Simplex S3 Frequencies plotted in the simplex S3. Mouse clicks set the initial frequencies of strategies or stops the simulations.
Phase Plane 2D Frequencies plotted in the phase plane spanned by the population density (x + y = 1 - z) and the relative frequency of cooperators (f = x / (x + y)). Mouse clicks set the initial frequencies of strategies, stop the simulations or switch to backward integration.
Structure - Fitness Snapshot of the spatial distribution of payoffs.
Mean Fitness Time evolution of average population payoff bounded by the minimum and maximum individual payoff.
Histogram - Fitness Snapshot of payoff distribution in population.

Game parameters

The list below describes only the parameters related to the public goods game and the population dynamics. Follow the link for a complete list and descriptions of all other parameters e.g. referring to update mechanisms of players and the population.

multiplication factor r of public good.
cost of cooperation c (investment into common pool).
Lone cooperator's payoff:
payoff for a cooperator if no one else joins the public goods interaction.
Lone defector's payoff:
payoff for a defector if no one else joins the public goods interaction.
Base birthrate:
baseline reproductive rate of all individuals. The effective birthrate is affected by the individual's performance in the public goods game and additionally depends on the availability of empty space.
constant death rate of all individuals.
Init Coop, init defect, init empty:
initial densities of cooperators, defectors and empty space. If they do not add up to 100%, the values will be scaled accordingly.