Skip to article frontmatterSkip to article content

Moran Process

Motivating Example: Everyone’s citing the preprint

In a graduate student reading group, everyone cites a well-established textbook in their essays. One student, though, starts citing a recent preprint they found on arXiv.

“It’s got a better proof of the key result — and it’s open access.”

Each week:

Over time, the group begins to shift its citation culture. The preprint might become canonical, or the students might return to citing the traditional text.

The more students who cite the preprint, the more attractive it becomes to others: shared references lead to easier discussion, common assumptions, and social reinforcement. In this way, the fitness of citing the preprint is not fixed — it depends on the current citation habits of the group. This makes the process frequency-dependent, just as in evolutionary game dynamics where payoffs arise from interaction with others.

To model this interaction explicitly, consider the following symmetric game. Each player chooses whether to cite the textbook (TT) or the preprint (PP). The row and column player payoffs are given by:

Mr=(3012)Mc=(3102)M_r = \begin{pmatrix} 3 & 0 \\ 1 & 2 \end{pmatrix} \qquad M_c = \begin{pmatrix} 3 & 1 \\ 0 & 2 \end{pmatrix}

If both students cite the textbook, they align well and receive the highest payoff of 3. If both cite the preprint, they still coordinate and get a payoff of 2 — slightly lower, but still beneficial.

If one cites the textbook while the other cites the preprint, there is a mismatch: the preprint-citer still gets some benefit (payoff 1) from its clarity and openness, but the textbook-citer gains nothing (payoff 0) from the mismatch.

Note here that the group is small and so the infinite population assumption of Replicator Dynamics does not apply: the topic of this chapter is the Moran Process a model suited for exactly this purpose.

Theory

Definition: Moran Process

First defined in Moran, 1958, the Moran process assumes a constant population of NN individuals which can be of mm different types. There exists a fitness function f:{1,,m}×{1,,m}NRf: \{1, \dots, m\} \times \{1, \dots, m\}^N \to \mathbb{R} that maps each individual to a numeric fitness value which is dependent on the types of the individuals in the population.

The process is defined as follows. At each step:

  1. Every individual kk has their fitness fkf_k calculated.

  2. An individual is randomly selected for copying. This selection is done proportional to their fitness fk(v)f_k(v). Thus, the probability of selecting individual kk for copying is given by:

    fk(v)h=1Nfh(v)\frac{f_k(v)}{\sum_{h=1}^N f_h(v)}
  3. An individual is selected for removal. This selection is done uniformly at random. Thus, the probability of selecting individual ii for removal is:

    1N\frac{1}{N}
  4. An individual of the same type as the individual selected for copying is introduced to the population.

  5. The individual selected for removal is removed.

The process is repeated until there is only one type of individual left in the population.


A common representation of the fitness function ff is to use a game. In this setting, the fitness of an individual of type ii is:

fi(v)=(vi1)Aii+ji,j=1NvjAijf_i(v) = (v_{i} - 1)A_{ii} + \sum_{j\ne i, j=1}^{N}v_jA_{ij}

Example: Selection Probabilities for citation behaviour.

For the Motivating Example: Everyone’s citing the preprint let us consider the situation with NN individuals in the reading group: 3 cite the text book (TT) and 1 cites the preprint (PP). This gives a total number of 5 different populations. Table 1 gives the different selection probabilities for each population.

Table 1:Selection probabilities for citation behaviour

(vT,vP)(v_T, v_P)fTf_TfPf_PProb copy TTProb copy PPProb remove TTProb remove PP
(4,0)(4, 0)33=93 \cdot 3 = 91010
(3,1)(3, 1)23+10=62 \cdot 3 + 1 \cdot 0 = 631+02=33 \cdot 1 + 0 \cdot 2 = 33636+13=67\frac{3 \cdot 6}{3 \cdot 6 + 1 \cdot 3} = \frac{6}{7}17\frac{1}{7}34\frac{3}{4}14\frac{1}{4}
(2,2)(2, 2)13+20=31 \cdot 3 + 2 \cdot 0 = 321+12=42 \cdot 1 + 1 \cdot 2 = 42323+24=37\frac{2 \cdot 3}{2 \cdot 3 + 2 \cdot 4} = \frac{3}{7}47\frac{4}{7}12\frac{1}{2}12\frac{1}{2}
(1,3)(1, 3)03+30=00 \cdot 3 + 3 \cdot 0 = 011+22=51 \cdot 1 + 2 \cdot 2 = 51010+35=0\frac{1 \cdot 0}{1 \cdot 0 + 3 \cdot 5} = 0114\frac{1}{4}34\frac{3}{4}
(0,4)(0, 4)01+32=60 \cdot 1 + 3 \cdot 2 = 60101

Definition: The Fixation Probability


The fixation probability of a given type in a Moran process is the probability that the population eventually becomes composed entirely of individuals of that type.


In the case of a finite population of size NN with two types: a resident type and a mutant type. Suppose the process begins with ii individuals of the mutant type and NiN - i residents.

Let ρi\rho_i denote the fixation probability of the mutant type starting from ii individuals. Then:

In practice fixation probabilities correspond to absorption probabilities of an underlying absorbing Markov chain.

Then, the transition probabilities for the underling Markov chain are:

Pii+1=(Prob copy mutant)(Prob remove resident)P_{i \to i+1} = (\text{Prob copy mutant})\cdot (\text{Prob remove resident})

and

Pii1=(Prob copy resident)(Prob copy mutant)P_{i \to i-1} = (\text{Prob copy resident})\cdot (\text{Prob copy mutant})

Finally:

Pii=1Pii+1Pii1P_{i \to i} = 1 - P_{i \to i+1} - P_{i \to i-1}

Example: Fixation of citation behaviour as an absorbing Markov chain

For given NN the Motivating Example: Everyone’s citing the preprint the underlying absorbing Markov chain has a state space that can be indexed by ii the number of individuals that cite the preprint.

For N=4N=4, we can write down the probability of going from state ii to state jj: pijp_{ij} using Table 1:

P=(10000(6/7)(1/4)P11(1/7)(3/4)000(3/7)(1/2)P22(4/7)(1/2)0000(3/4)P33(1)(1/4)00001) using the selection probabilities=(100003/1419/283/280003/141/22/700003/41/400001) using Pii=1Pii+1Pii1\begin{align*} P &= \begin{pmatrix} 1 & 0 & 0 & 0 & 0 \\ (6/7)\cdot(1/4) & P_{11} & (1/7)\cdot(3/4) & 0 & 0 \\ 0 & (3/7)\cdot(1/2) & P_{22} & (4/7)\cdot(1/2) & 0 \\ 0 & 0 & 0\cdot(3/4) & P_{33} & (1)\cdot(1/4) \\ 0 & 0 & 0 & 0 & 1 \\ \end{pmatrix}&&\text{ using the selection probabilities}\\ &= \begin{pmatrix} 1 & 0 & 0 & 0 & 0 \\ 3/14 & 19/28 & 3/28 & 0 & 0 \\ 0 & 3/14 & 1/2 & 2/7 & 0 \\ 0 & 0 & 0 & 3/4 & 1/4 \\ 0 & 0 & 0 & 0 & 1 \\ \end{pmatrix}&& \text{ using } P_{i \to i} = 1 - P_{i \to i+1} - P_{i \to i-1} \end{align*}

This is an absorbing Markov chain which, by reordering of states, we can write in the canonical form:

P=(QR0I)P = \begin{pmatrix} Q & R\\ 0 & I \end{pmatrix}

with:

Q=(19/283/2803/141/22/7003/4)Q = \begin{pmatrix} 19/28 & 3/28 & 0 \\ 3/14 & 1/2 & 2/7 \\ 0 & 0 & 3/4 \\ \end{pmatrix}

and

R=(3/1400001/4)R = \begin{pmatrix} 3/14 & 0\\ 0 & 0\\ 0 & 1/4 \end{pmatrix}

thus we can calculate the fundamental matrix:

N=(9/283/2803/141/22/7001/4)1=(98/277/98/914/97/38/3004)\begin{align*} N &= \begin{pmatrix} 9/28 & -3/28 & 0 \\ -3/14 & 1/2 & -2/7 \\ 0 & 0 & 1/4 \\ \end{pmatrix} ^ {-1}\\ & = \begin{pmatrix} 98/27 & 7/9 & 8/9\\14/9 & 7/3 & 8/3\\0 & 0 & 4 \end{pmatrix} \end{align*}

We omit the calculation of the inverse which can be obtained using Gauss-Jordan elimination or any other approach.

We can now compute the absorption probability matrix:

B=NR=(7/92/91/32/301)B = N R = \begin{pmatrix} 7/9 & 2/9\\ 1/3 & 2/3\\0 & 1 \end{pmatrix}

Thus if a single mutant, or in our case a single individual starts citing the pre print: there is 2/92/9 chance that the entire reading group starts citing the pre print over time.

ρ1=29\rho_1 = \frac{2}{9}

Theorem: The fixation probabilities in populations of two types


Given a Moran process in a population with two types as defined in Definition: The Fixation Probability, the fixation probability ρi\rho_i is given by:

ρi=1+j=1i1k=1jγk1+j=1N1k=1jγk\rho_i=\frac{1+\sum_{j=1}^{i-1}\prod_{k=1}^j\gamma_k}{1+\sum_{j=1}^{N-1}\prod_{k=1}^j\gamma_k}

where:

γk=fR(i)fM(i)\gamma_k = \frac{f_R(i)}{f_M(i)}

Proof:


For the underlying absorbing Markov chain we have:

pi,i+1ρi+1=pi,i1ρi1+ρi(1pii)pi,i+1ρi+1=pi,i1(ρiρi1)+ρipi,i+1ρi+1ρi=pi,i1pi,i+1(ρiρi1)=γi(ρiρi1)\begin{align*} p_{i,i+1}\rho_{i+1} & = -p_{i,i-1}\rho_{i-1} + \rho_i(1 - p_{ii}) \\ p_{i,i+1}\rho_{i+1} & = p_{i,i-1}(\rho_{i} - \rho_{i-1}) + \rho_ip_{i,i+1} \\ \rho_{i+1} - \rho_i & = \frac{p_{i, i-1}}{p_{i, i+1}}(\rho_i-\rho_{i-1})=\gamma_i(\rho_i-\rho_{i-1}) \end{align*}

with:

γi=pi,i1pi,i+1=(Ni)fR(i)ifR(i)+(Ni)fR(i)iNifM(i)ifR(i)+(Ni)fR(i)NiN=(Ni)fR(i)ifR(i)+(Ni)fR(i)iNifR(i)+(Ni)fR(i)ifM(i)NNi=(Ni)fR(i)iifM(i)(Ni)=fR(i)fM(i)\begin{align*} \gamma_i &= \frac{p_{i, i - 1}}{p_{i, i + 1}}\\ &= \frac{\frac{(N - i)f_R(i)}{if_R(i) + (N - i)f_R(i)}\frac{i}{N}}{\frac{if_M(i)}{if_R(i) + (N - i)f_R(i)}\frac{N-i}{N}}\\ &= \frac{(N - i)f_R(i)}{if_R(i) + (N - i)f_R(i)}\frac{i}{N}{\frac{if_R(i) + (N - i)f_R(i)}{if_M(i)}\frac{N}{N-i}}\\ &= \frac{(N - i)f_R(i)i}{if_M(i)(N-i)}\\ &= \frac{f_R(i)}{f_M(i)}\\ \end{align*}

We observe that:

ρ2ρ1=γ1(ρ1ρ0)=γ1ρ1ρ3ρ2=γ2(ρ2ρ1)=γ2γ1ρ1ρ4ρ3=γ3(ρ3ρ2)=γ3γ2γ1ρ1  ρi+1ρi=γi(ρiρi1)=k=1iγkρ1  ρNρN1=γN1(ρN1ρN2)=k=1N1γkρ1\begin{align} \rho_2 - \rho_1 &= \gamma_1(\rho_1-\rho_{0})=\gamma_1\rho_1\\ \rho_3 - \rho_2 &= \gamma_2(\rho_2-\rho_1)=\gamma_2\gamma_1\rho_1\\ \rho_4 - \rho_3 &= \gamma_3(\rho_3-\rho_2)=\gamma_3\gamma_2\gamma_1\rho_1\\ &\; \vdots & \\ \rho_{i+1} - \rho_i &= \gamma_i(\rho_i-\rho_{i-1})=\prod_{k=1}^i\gamma_k\rho_1\\ &\; \vdots & \\ \rho_{N} - \rho_{N-1} &= \gamma_{N-1}(\rho_{N-1}-\rho_{N-2})=\prod_{k=1}^{N-1}\gamma_k\rho_1\\ \end{align}

thus we have:

ρi=j=0i1ρj+1ρj=(1+j=1i1k=1jγk)ρ1\rho_i=\sum_{j=0}^{i-1}\rho_{j+1}-\rho_j=\left(1+\sum_{j=1}^{i-1}\prod_{k=1}^j\gamma_k\right)\rho_1

solving the following equation to obtain ρ1\rho_1 gives the required result.

ρN=1=(1+j=1N1k=1jγk)ρ1\rho_N=1=\left(1+\sum_{j=1}^{N-1}\prod_{k=1}^j\gamma_k\right)\rho_1

Example: Direct calculation of fixation of citation behaviour

For given NN the fixation probabilities of Motivating Example: Everyone’s citing the preprint can be found directly using (15).

For N=4N=4, recalling that R=TR=T and M=PM=P, we can write down the values of γi\gamma_i sing Table 1:

γ1=fT(1)fP(1)=63=2γ2=fT(2)fP(2)=34γ3=fT(3)fP(3)=05\begin{align*} \gamma_1 & = \frac{f_{T}(1)}{f_{P}(1)} = \frac{6}{3}=2\\ \gamma_2 & = \frac{f_{T}(2)}{f_{P}(2)} = \frac{3}{4}\\ \gamma_3 & = \frac{f_{T}(3)}{f_{P}(3)} = \frac{0}{5} \end{align*}

This gives:

ρ1=11+j=13k=1jγk=11+k=11γk+k=12γk+k=13γk=11+γ1+γ1γ2+γ1γ2γ3=11+2+234+23045=11+2+64=29\begin{align*} \rho_1 &= \frac{1}{1 + \sum_{j=1}^3\prod{k=1}^{j}\gamma_k} \\ &= \frac{1}{1 + \prod{k=1}^{1}\gamma_k + \prod{k=1}^{2}\gamma_k + \prod{k=1}^{3}\gamma_k} \\ &= \frac{1}{1 + \gamma_1 + \gamma_1\gamma_2 + \gamma_1\gamma_2\gamma_3} \\ &= \frac{1}{1 + 2 + \frac{2\cdot 3}{4} + \frac{2\cdot 3 \cdot 0}{4\cdot5}} \\ &= \frac{1}{1 + 2 + \frac{6}{4}}=\frac{2}{9}\\ \end{align*}

as calculated Example: Fixation of citation behaviour as an absorbing Markov chain.

Exercises

Exercise: Moran Process with neutral drift

A Moran process with neutral drift is when: fkv=Cf_k{v}=C for all kk for all vv for some constant CC. In other words: a Moran process with neutral drift is a Moran process where the fitness of all types for all populations is the same.

For a population with 2 types:

  1. Describe the transition probabilities for the Moran process with neutral drift.
  2. Obtain the transition probability matrix for the Moran process with neutral drift with N=4N=4 individuals.
  3. Obtain the general formula for ρ1\rho_1 for a Moran process with neutral drift for general NN.

Exercise: Specific fixation probabilities

For the following games, assuming the mutant is of the second type, obtain the fixation probability ρ1\rho_1 for N=4N=4:

  1. M=(1111)M=\begin{pmatrix}1 & 1 \\ 1 & 1\end{pmatrix}
  2. M=(1231)M=\begin{pmatrix}1 & 2 \\ 3 & 1\end{pmatrix}

Exercise: The effect of fitness

Consider the game M=(r111)M=\begin{pmatrix}r & 1 \\ 1 & 1\end{pmatrix} for r>1r>1 and NN, assuming the mutant is of the second type, obtain ρ1\rho_1 as a function of rr. How does rr effect the chance of fixation?

Programming

Using Nashpy to simulate a Moran process

Nashpy has functionality to simulate a single Moran process. Let us create a 3 by 3 game (for a population with 3 types) and an initial population.

import nashpy as nash
import numpy as np

M = np.array(
    (
        (2, 3, 1),
        (4, 1, 2),
        (1, 2, 5),
    )
)
game = nash.Game(M)
initial_population = np.array((0, 0, 0, 1, 1, 1, 2))

Now to run a Moran process, note that we seed the numpy pseudo-random number generator which is used by Nashpy:

np.random.seed(0)
populations = game.moran_process(initial_population=initial_population)
list(populations)

Using Nashpy to approximate fixation probabilities

Nashpy can be directly used to approximate the fixation probabilities by repeated a large number of Moran processes:

M = np.array(
    (
        (3, 0),
        (1, 2),
    )
)
game = nash.Game(M)
initial_population = np.array((0, 0, 0, 1))
game.fixation_probabilities(initial_population=initial_population, repetitions=10_000)

This shows that the final population with only 1s in it occurs 2/7.222/7\approx .22 of the time.

Notable Research

Notable Research in the Moran Process and Population Genetics

The Moran process was first introduced in Moran, 1958, but it was not the first major model in population genetics. Foundational theoretical work by Ronald Fisher Fisher, 1930, J.B.S. Haldane Haldane, 1927Haldane, 1932, and Sewall Wright Wright, 1931 laid the mathematical groundwork for understanding evolution, focusing on selection and genetic drift in both infinite and finite populations. These early models often used diffusion approximations or the discrete-generation Wright-Fisher model. In contrast, the Moran process provided a continuous-time, discrete-space alternative that allows exact calculation of fixation probabilities and times. For example, Antal and Scheuring Antal & Scheuring, 2006 derived precise analytical results within this framework.

The Moran process has become indispensable in evolutionary game theory, where individual fitness depends on strategic interactions. This is central to the theory of evolutionarily stable strategies Taylor & Jonker, 1978. It has been especially influential in studying social dilemmas, such as the evolution of cooperation. Traulsen and Nowak Traulsen & Nowak, 2006 showed how cooperation can be favored in finite populations, while Knight Knight et al., 2018 explored how self-recognition algorithms can emerge through such dilemmas under the Moran process.

The process is also crucial for analyzing the role of population structure. A notable extension is the Moran process on graphs, where individuals interact only with their neighbors. This framework was first proposed by Lieberman, Hauert, and Nowak Lieberman et al., 2005 and further refined by Ohtsuki, Pacheco, and Nowak Ohtsuki et al., 2007. The Nashpy library Knight & Campbell, 2018 can be used to simulate Moran processes on such networks.

A final, and remarkable, result is the one proved by Traulsen, Claussen, and Hauert Traulsen et al., 2005: in the limit of large population size, the Moran process converges to the replicator dynamics equation.

Conclusion

The Moran process offers a foundational framework for understanding how strategies evolve in finite populations. Like the replicator dynamics equation, it links fitness to the growth or decline of types over time — but with a critical distinction: it captures the inherent stochasticity of small populations.

In this chapter, we:

These results highlight how even simple stochastic rules can give rise to rich evolutionary behavior. The Moran process provides a tractable yet powerful model that extends beyond biology — from the spread of opinions to the diffusion of technologies.

The key concepts covered in this chapter are summarized in Table 2.

Table 2:Summary of key concepts in the Moran process

ConceptDescription
Moran processA stochastic model of evolution in finite populations
Copy selection probabilityProbability of choosing an individual for reproduction, proportional to fitness
Removal selection probabilityProbability of choosing an individual for removal, uniform across the population
Absorbing stateA population state in which all individuals are of a single type
Fixation probabilityProbability that a given type eventually takes over the population
References
  1. Moran, P. A. P. (1958). Random processes in genetics. Mathematical Proceedings of the Cambridge Philosophical Society, 54(1), 60–71.
  2. Fisher, R. A. (1930). The Genetical Theory of Natural Selection. Clarendon Press.
  3. Haldane, J. B. S. (1927). A Mathematical Theory of Natural and Artificial Selection, Part IV. Mathematical Proceedings of the Cambridge Philosophical Society, 23(5), 838–844.
  4. Haldane, J. B. S. (1932). The Causes of Evolution. Longmans, Green.
  5. Wright, S. (1931). Evolution in Mendelian populations. Genetics, 16(2), 97–159.
  6. Antal, T., & Scheuring, I. (2006). Fixation probability and fixation time in the Moran process with two types of individuals. Bulletin of Mathematical Biology, 68(8), 1923–1944.
  7. Taylor, P. D., & Jonker, L. B. (1978). Evolutionary stable strategies and game dynamics. Mathematical Biosciences, 40(1–2), 145–156.
  8. Traulsen, A., & Nowak, M. A. (2006). Evolution of cooperation by kin selection and group selection in finite populations. Proceedings of the National Academy of Sciences, 103(29), 10952–10955.
  9. Knight, V., Harper, M., Glynatsi, N. E., & Campbell, O. (2018). Evolution reinforces cooperation with the emergence of self-recognition mechanisms: An empirical study of strategies in the Moran process for the iterated prisoner’s dilemma. PloS One, 13(10), e0204981.
  10. Lieberman, E., Hauert, C., & Nowak, M. A. (2005). Evolutionary dynamics on graphs. Nature, 433(7023), 312–316.
  11. Ohtsuki, H., Pacheco, J. M., & Nowak, M. A. (2007). Evolutionary Graph Theory: Breaking the Symmetry between Interaction and Replacement. Journal of Theoretical Biology, 246(4), 681–694. 10.1016/j.jtbi.2007.01.024
  12. Knight, V., & Campbell, J. (2018). Nashpy: A Python library for the computation of Nash equilibria. Journal of Open Source Software, 3(30), 904.
  13. Traulsen, A., Claussen, J. C., & Hauert, C. (2005). Coevolutionary dynamics: from finite to infinite populations. Physical Review Letters, 95(23), 238701.