When strategies that perform well spread and those that perform poorly shrink,
populations evolve. This chapter derives the replicator dynamics equation,
which models this selection process mathematically, and analyses the
equilibria and long-run behaviour it produces.
Motivating Example: Coffee clubs and the common good game¶
Across a large university campus, students form informal coffee clubs. Each day,
students join clubs to share a cafetière of coffee and discuss algebraic
topology or the latest student gossip. There are three types of students:
Cooperators always bring a scoop of ground coffee to the club.
Defectors show up empty-handed but still drink the coffee.
Loners prefer to skip clubs and enjoy a quiet cup alone, reliable, if
a bit less exciting.
In each club, all coffee brought is pooled, brewed, and the resulting pot is
shared equally among the attendees. If there are k cooperators, the pot yields
rk units of value to be divided among all participants (cooperators and
defectors). The loners, who don’t attend clubs, receive a fixed payoff σ.
Let the total population be normalized to 1, with:
xc the proportion of cooperators,
xd the proportion of defectors,
xz=1−xc−xd the proportion of loners.
Assuming the population is large and well-mixed, we can model the average
payoff to each strategy as:
fc(x)=r⋅xc+xdxc−1
fd(x)=r⋅xc+xdxc
fl(x)=σ
Here, r>1 is the return factor of the public good (coffee), and the
subtraction of 1 from fC reflects the cost of bringing coffee.
These payoffs are used in the replicator dynamics equation, which models
how the frequency of each strategy changes over time:
Figure 1:A diagram showing the direction of the derivative as given by (1) for r=3 and σ=.6.
Strategies that do better than the average will increase in frequency;
those that do worse will decline. This feedback mechanism drives the
evolution of behaviour in the population, capturing the shifting fortunes
of cooperators, defectors, and loners on campus.
As we will see, this system often exhibits cyclical behaviour: when most
students cooperate, defectors thrive; when defection becomes too common,
students prefer to be loners; when clubs are small and rare, cooperation
becomes appealing again. These cycles, and their stability, are precisely
what replicator dynamics helps us understand.
This equation describes the change in frequency of each type as proportional to
how much better (or worse) its fitness is compared to the population average.
For
the common good game
if we consider a stable population x=(0,1,0) where everyone is defecting and
assume that a new student enters planning to cooperate 50% of the time and
defect 50% of the time, their fitness is given by:
For a population with N types of individuals
Given a population x∈R[0,1]N (with ∑i=1Nxi=1), some ϵ>0 and
a strategy y∈R[0,1]N (with ∑i=1Nyi=1), the post entry population xϵ is given by:
Example: Post Entry Population for the Common Goods Game¶
For
the common good game
if we consider the stable population x=(0,1,0) where everyone is
defecting and assume that a new student enters the population planning to
cooperate with a coffee club 50% of the time and defect 50% of the time the post
entry population will be:
What is of interest in the field of evolutionary game theory is what happens to the post
entry population: does this new student change the stability of the system or is
the system going to go back to all students defecting? This is the question of
evolutionary stability. The evolutionarily stable strategy (ESS), defined
formally below, captures exactly this: a population is evolutionarily stable if
residents always outperform any rare mutant. For pairwise interaction games the
invasion condition reduces to a convenient algebraic characterisation, also
developed below.
This corresponds to a population where all individuals interact with all other
individuals in the population and obtain a fitness given by the matrix M.
Note that there is a linear algebraic equivalent to (12):
Consider a population of animals. These animals, when they interact, will
always share their food. Due to a genetic mutation, some of these animals may
act in an aggressive manner and not share their food. If two aggressive animals
meet, they both compete and end up with no food. If an aggressive animal meets a
sharing one, the aggressive one will take most of the food.
These interactions can be represented using the matrix A:
Table 2:Step by step application of Euler’s method to the Hawk Dove game with step size h=.1 and x0=2/5.
n
tn
xn
f(xn)
xn+1
0
0.0
0.400
0.048
0.405
1
0.1
0.405
0.046
0.409
2
0.2
0.409
0.044
0.414
3
0.3
0.414
0.042
0.418
4
0.4
0.418
0.040
0.422
5
0.5
0.422
0.038
0.426
6
0.6
0.426
0.036
0.429
7
0.7
0.429
0.035
0.433
8
0.8
0.433
0.033
0.436
9
0.9
0.436
0.031
0.439
10
1.0
0.439
0.030
0.442
It looks the population is converging to the population which has a mix
of both sharers and aggressive types: x=1/2. Figure 2 confirms this.
Figure 2:The numerical integration of the differential equation (18) with two different initial values of x.
This indicates that x=1/2 is an evolutionary stable strategy. To confirm
this we could apply the definition of an evolutionarily stable strategy
directly; however, for pairwise interaction games there is a theoretic result
that can be used instead. We first state the definition formally.
where (1−ϵ)σ∗+ϵσ′ is the
post-entry population: a population
consisting mostly of residents with a small fraction ϵ of mutants.
The condition says that the resident strategy does strictly better than any
rare mutant, so selection removes the mutant and the population returns to
σ∗. Letting ϵ→0 gives
f(σ∗,σ∗)≥f(σ′,σ∗) for all σ′, the Nash
condition for symmetric games. Every ESS is therefore a symmetric Nash
equilibrium, but not every Nash equilibrium is an ESS: ESS is a refinement that
rules out equilibria vulnerable to invasion.
Theorem: Characterisation of ESS in two-player games¶
Let σ∗ be a strategy in a symmetric two-player game (so that Mr=Mc⊤). Then σ∗ is
an evolutionarily stable strategy (ESS) if and only if, for all σ=σ∗,
one of the following conditions holds:
f(σ∗,σ∗)>f(σ,σ∗)
f(σ∗,σ∗)=f(σ,σ∗) and f(σ∗,σ)>f(σ,σ)
Conversely, if either of the above conditions holds for all σ=σ∗,
then σ∗ is an ESS in the corresponding population game.
Rearranging, this inequality holds for all sufficiently small ϵ>0
if either:
f(σ∗,σ∗)>f(σ,σ∗) (so the left-hand side is
already greater); or
f(σ∗,σ∗)=f(σ,σ∗) but
f(σ∗,σ)>f(σ,σ), so the second-order term
dominates as ϵ→0.
For the converse, suppose neither condition holds. Then either:
f(σ∗,σ∗)<f(σ,σ∗), so for small ϵ the
inequality fails and σ∗ is not stable, or
f(σ∗,σ∗)=f(σ,σ∗) and
f(σ∗,σ)≤f(σ,σ), in which case the right-hand
side is at least as large as the left for small ϵ, again
contradicting stability.
Hence, the two conditions are necessary and sufficient for evolutionary
stability.
This theorem gives us a practical method for identifying ESS:
Construct the associated symmetric two-player game.
Identify all symmetric Nash equilibria of the game.
For each symmetric Nash equilibrium, test the two conditions above.
Note that the first condition is very close to the condition for a strict
Nash equilibrium, while the second adds a refinement that removes certain
non-strict symmetric equilibria. This distinction is especially important
when considering equilibria in strategies.
Example: Evolutionary stability in the Hawk-Dove game¶
Let us consider the Hawk-Dove game. The associated symmetric two-player game
can be written in a general form. Let v denote the value of the resource and c the cost of conflict
with v<c.
An extension of the replicator equation is to allow for mutation. In this
setting, reproduction is imperfect: individuals of a given type can give rise
to individuals of another type.
This process is represented by a matrix Q, where Qij denotes the
probability that an individual of type j is produced by an individual of type
i.
In this case, the replicator dynamics equation can be modified to yield the
replicator-mutation equation:
A further extension of the replicator dynamics framework accounts for
populations divided into two distinct subsets. Individuals in the first
population are one of M possible types, while those in the second
population are one of N possible types.
This setting arises naturally in asymmetric games, where the roles of the
players differ and the strategy sets need not be the same (i.e., M=N). In
such cases, the standard replicator equation does not apply directly.
The asymmetric replicator dynamics equations describe the evolution of
strategy distributions x and y in each population:
In tennis, serving and receiving form an asymmetric interaction. The server
(row player) chooses one of two serves, while the receiver (column player)
chooses one of three possible return strategies.
The server can deliver a power or spin serve. The receiver can either
prepare for power, cover a wide spin, or take an early aggressive position.
This leads to an asymmetric game where the server has 2 strategies and the
receiver has 3. The game matrices are:
These matrices are based on the following assumptions:
If the server uses a power serve (r1) and the receiver prepares for it
(c1), the server has some success (payoff 3), but the receiver also does
reasonably well (payoff 1).
If the server tries spin (r2) and the receiver is covering for it
(c2), the payoff is more balanced (2 for each).
A mismatch, such as a power serve into a receiver expecting spin (r1 vs
c2), favors the server more (payoff 1 vs 3).
Conversely, if the receiver takes an early position and guesses right
against spin (r2 vs c3), they gain a big advantage (payoff 1 vs 4).
Let x=(x1,x2) be the strategy distribution of the server and
y=(y1,y2,y3) that of the receiver. The asymmetric replicator
dynamics for this game are:
Figure 3 shows the numerical solutions
of these differential equations over time.
Preparing for Power quickly dies out as a strategy;
There is a cycle with the server changing between power and spin while the
returner cycles between preparing for spin and taking an aggressive position.
Figure 3:Numerical solutions to the asymmetric replicator dynamics equation. Preparing
for power quickly dies out as a played strategy in the population. There is a
cycle of the 2 remaining strategies for the returner and for the server although
power remains the strategy player most often.
In Appendix: Numerical Integration, we introduce
general programming approaches for numerically solving differential equations.
These apply directly to the replicator dynamics equation. Here, we focus on
tools specifically tailored to pairwise interaction games.
The original conceptual idea of an evolutionarily stable strategy (ESS) was
formulated by Maynard Smith Maynard Smith & Price, 1973Maynard Smith, 1982. Although
these works did not explicitly introduce the replicator dynamics equation, they
were foundational in connecting game theory with evolutionary biology.
The first formal presentation of the replicator dynamics equation appeared
in Taylor & Jonker, 1978, which directly built upon Maynard Smith’s ESS
framework. This formulation was later extended to multi-player games in
Palm, 1984, and to asymmetric populations in
Accinelli & Carrera, 2011.
Several influential applications of replicator dynamics have since emerged. For
example, Komarova et al., 2001 used replicator-mutator dynamics to model
the spread of grammatical structures in language populations. In the context of
cooperation, Hilbe et al., 2013 applied the model to study the evolution of
reactive strategies, while Knight et al., 2024 recently demonstrated how
extortionate strategies fail to persist under evolutionary pressure.
A particularly notable extension is found in Weitz et al., 2016, where the
game itself changes dynamically depending on the population state. This
approach is especially relevant in modelling the tragedy of the commons and
other environmental feedback systems.
In Lv et al., 2023, a model similar to the one in
Section: Motivating Example is examined using both
replicator dynamics and a discrete population model. The latter is explored
in detail in Chapter: Moran Process. Remarkably, the
replicator dynamics equation emerges as the infinite-population limit of the
discrete model, a connection rigorously established in
Traulsen et al., 2005.
The replicator dynamics equation provides a powerful lens through which to study
strategy evolution in large populations. By linking the fitness of strategies to
their growth or decline in the population, it captures the essence of selection
and adaptation.
Throughout this chapter, we explored how replicator dynamics:
arise naturally in settings like public goods provision (e.g., coffee clubs),
describe population change in terms of differential equations,
connect with the concept of evolutionarily stable strategies (ESS),
extend to incorporate mutation and asymmetry,
and can be simulated and visualized with numerical methods and tools.
From modelling simple two-strategy contests to rich three-strategy dynamics on
a simplex, replicator dynamics offer an interpretable and analytically rich
framework for evolutionary game theory. Table Table 3
gives a summary of the main concepts of this chapter.
Table 3:Summary of key concepts in replicator dynamics.
Concept
Description
Replicator Dynamics Equation
Models strategy frequency change based on relative fitness
Average Population Fitness (ϕ)
Weighted average of individual fitnesses
Stable Population
A distribution where no strategy’s frequency changes over time
Evolutionarily Stable Strategy (ESS)
A stable strategy resistant to invasion by nearby alternatives
Post Entry Population
Perturbed population after a rare mutant enters
Replicator-Mutator Equation
Extension accounting for imperfect strategy transmission
Asymmetric Replicator Dynamics
Models evolution in multi-population or role-asymmetric settings
Pairwise Interaction Game
Fitness determined by payoffs in repeated pairwise interactions
Harper, M. (2019). python-ternary: Ternary Plots in Python. Zenodo 10.5281/Zenodo.594435. 10.5281/zenodo.594435
Maynard Smith, J., & Price, G. R. (1973). The Logic of Animal Conflict. Nature, 246, 15–18. 10.1038/246015a0
Maynard Smith, J. (1982). Evolution and the Theory of Games. Cambridge University Press.
Taylor, P. D., & Jonker, L. B. (1978). Evolutionary stable strategies and game dynamics. Mathematical Biosciences, 40(1–2), 145–156.
Palm, G. (1984). Evolutionary stable strategies and game dynamics for n-person games. Journal of Mathematical Biology, 19, 329–334.
Accinelli, E., & Carrera, E. J. S. (2011). Evolutionarily stable strategies and replicator dynamics in asymmetric two-population games. In Dynamics, Games and Science I: DYNA 2008, in Honor of Maurı́cio Peixoto and David Rand, University of Minho, Braga, Portugal, September 8-12, 2008 (pp. 25–35). Springer.
Komarova, N. L., Niyogi, P., & Nowak, M. A. (2001). The evolutionary dynamics of grammar acquisition. Journal of Theoretical Biology, 209(1), 43–59.
Hilbe, C., Nowak, M. A., & Sigmund, K. (2013). Evolution of extortion in iterated prisoner’s dilemma games. Proceedings of the National Academy of Sciences, 110(17), 6913–6918.
Knight, V., Harper, M., Glynatsi, N. E., & Gillard, J. (2024). Recognising and evaluating the effectiveness of extortion in the Iterated Prisoner’s Dilemma. PloS One, 19(7), e0304641.
Weitz, J. S., Eksin, C., Paarporn, K., Brown, S. P., & Ratcliff, W. C. (2016). An oscillating tragedy of the commons in replicator dynamics with game-environment feedback. Proceedings of the National Academy of Sciences, 113(47), E7518–E7525.
Lv, S., Li, J., & Zhao, C. (2023). The evolution of cooperation in voluntary public goods game with shared-punishment. Chaos, Solitons & Fractals, 172, 113552.
Traulsen, A., Claussen, J. C., & Hauert, C. (2005). Coevolutionary dynamics: from finite to infinite populations. Physical Review Letters, 95(23), 238701.