---
title: "Genetic drift lets a neutral gene take over a finite population"
description: "Build the Wright–Fisher model from random sampling, see why a neutral gene wins as often as its starting share, and watch diversity drain away."
canonical_url: "https://sandboxphysics.com/stories/evolution-statistical-physics/drift-in-a-finite-population/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/evolution-statistical-physics/drift-in-a-finite-population/"
last_modified: "2026-10-30"
---

[Evolution as statistical physics](https://sandboxphysics.com/stories/evolution-statistical-physics/)

L1 · Chapter 1

# Genetic drift lets a neutral gene take over a finite population

Sandbox Physics · 2026-10-30

Fifty bacteria share a flask. All are equally fit, and one carries a harmless mutation. Every generation the flask is refilled to fifty by copying cells picked at random. Nobody is better than anybody else, yet after about a hundred generations every cell carries the same version of the gene. Random sampling alone does this, and the size of the population sets how fast.

## Before you begin

Probability at the level of coin flips: independent events, averages and variances. The binomial distribution is introduced below. The only biology needed is that offspring copy the genes of their parent.

- Write the Wright–Fisher model as binomial sampling and compute the mean and variance of the next generation.
- Derive the fixation probability of a neutral allele and the decay of heterozygosity, and check both against seeded simulations.

## A population that copies itself at random

Take $N$ individuals, each carrying one copy of a gene in one of two versions, called alleles: the mutant $A$ or the original $a$. Let $i$ be the number of $A$ individuals and $p=i/N$ their frequency. Time is counted in generations, and parents die when their children are born.

To build the next generation, each of its $N$ members picks a parent at random from the current one, with every parent equally likely, and copies its allele. The picks are independent. The number of $A$ children is then a binomial count: $N$ trials, each a success with probability $p$. This is the Wright–Fisher model.

Nothing in the rule favours either allele. Every change in frequency comes from the luck of the draw, and population geneticists call it genetic drift.

$$
P(i_{t+1}=j\mid i_t=i)=\binom{N}{j}p^{\,j}(1-p)^{N-j},\qquad p=\frac{i}{N}
$$

The chance of $j$ mutant children when the parents hold $i$ mutants.

Source: K. S. Korolev · N. Berestycki

## The average stays put while the spread grows

A binomial count with $N$ trials has mean $Np$ and variance $Np(1-p)$. Dividing by $N$ gives the frequency in the next generation:

The mean does not move. Each generation adds a random step whose typical size is $\sqrt{p(1-p)/N}$, and the steps add up like a random walk. The walk ends when the frequency reaches $0$ or $1$, because a population with no copy of an allele can never draw one again. The allele is then lost or fixed.

Now average over many populations that start at the same $p_0$. The average frequency is the same in every generation, so at the end it still equals $p_0$. At the end each population sits at $0$ or $1$, and the average is the fraction that reached $1$. A neutral allele therefore fixes with probability $u(p_0)=p_0$.

$$
\mathrm{E}[p_{t+1}\mid p_t]=p_t,\qquad \mathrm{Var}[p_{t+1}\mid p_t]=\frac{p_t(1-p_t)}{N}
$$

Drift has no direction. Its strength falls as the population grows.

Source: N. Berestycki · K. S. Korolev

## Heterozygosity: the chance that two individuals differ

To follow diversity, draw two individuals at random, with replacement. They carry different alleles with probability $H=2p(1-p)$, called the heterozygosity. It is largest at $p=1/2$ and zero once one allele has fixed.

Average $H$ over the next draw. The mean square of the new frequency is the square of its mean plus its variance, $\mathrm{E}[p_{t+1}^2]=p_t^2+p_t(1-p_t)/N$. Substituting gives a one-line recursion:

Each generation removes a fraction $1/N$ of the expected diversity. A population of $50$ keeps about $e^{-1}\approx0.37$ of it after $50$ generations. A population ten times larger needs ten times as long.

$$
\mathrm{E}[H_{t+1}]=2\left(\mathrm{E}[p_{t+1}]-\mathrm{E}[p_{t+1}^2]\right)=\Bigl(1-\frac1N\Bigr)H_t\ \Longrightarrow\ H_t=H_0\Bigl(1-\frac1N\Bigr)^{t}\approx H_0\,e^{-t/N}
$$

The expected heterozygosity decays exponentially, with a time constant of one population size in generations.

Source: K. S. Korolev

## Worked example: one neutral mutant among fifty

Problem. A population of $N=50$ starts with one neutral mutant. How likely is the mutant to fix, how long does fixation take when it happens, and how much diversity is left after $50$ generations?

Fixation. The starting frequency is $p_0=1/50=0.02$, so $u=0.02$. In $49$ populations out of $50$ the mutant disappears.

Time. For large $N$ the frequency behaves like a diffusion, and one unit of diffusion time equals $N$ Wright–Fisher generations. The mean time to fixation, counted only in populations where the mutant fixes, is then given by the formula below. At $p=0.02$ it gives $99.0$ generations. Solving the finite Wright–Fisher chain exactly gives $96.97$ generations; the diffusion formula is a few per cent high because it treats $N$ as large.

Diversity. $H_0=2\times0.02\times0.98=0.0392$, and after $50$ generations $H_{50}=0.0392\times0.98^{50}=0.0143$.

Check. The drift Lab runs this case as $12000$ seeded replicate populations. The mutant fixed in a fraction $0.0212\pm0.0013$ of them, within one standard error of $0.02$, and the populations where it fixed took $96.2\pm3.4$ generations.

$$
\bar t_{\mathrm{fix}}(p)\approx-\frac{2N(1-p)\ln(1-p)}{p}
$$

Mean generations to fixation, given that the allele fixes, from the diffusion limit of the neutral model.

Source: N. Berestycki · K. S. Korolev

## Try it in the Lab

### [Let luck decide a neutral gene](https://sandboxphysics.com/labs/neutral-drift-fixation/)

1. Choose the preset One neutral newcomer. Before the batch finishes, predict what fraction of the replicate populations will end with the mutant fixed.
2. Switch to Half and half: a coin flip and predict again. Then compare both measured fractions with the exact values shown beside them.
3. Double the population size and keep the starting frequency. Predict how the mean time to fixation changes, run it, and explain the result with the variance per generation.

## Exercises with explained answers

1. A neutral allele has frequency $0.25$ in a population of $20$. What is the chance that it fixes? Does the answer change for a population of $2000$?

   Show the answer

   It fixes with probability $0.25$ in both. The expected frequency never changes, and at the end it is $0$ or $1$, so the fraction of populations that fix equals $0.25$. Population size changes how long it takes, not the odds.

2. How many generations does a population of $N=100$ need to lose half of its expected heterozygosity?

   Show the answer

   Solve $(1-1/100)^t=1/2$, which gives $t=\ln2/\ln(100/99)\approx69$ generations. The shortcut $t\approx N\ln2=69.3$ agrees to within one generation.

3. In one run, a mutant rises from $0.02$ to $0.4$ in thirty generations. Does that show the mutant is favoured?

   Show the answer

   No. A neutral allele that ends up fixed must climb through every frequency on the way, and about one population in $50$ does so by luck. One trajectory cannot separate luck from advantage. The fraction of many replicate populations that fix can, because selection moves it away from the starting frequency.

[Next: Fixation probability and time, and why a better mutant often loses](https://sandboxphysics.com/stories/evolution-statistical-physics/fixation-probability-and-time/)

## Sources and what we recomputed

1. [K. S. Korolev, M. Avlund, O. Hallatschek and D. R. Nelson, Genetic demixing and evolutionary forces in the one-dimensional stepping stone model, arXiv:0904.4625v2 (2011)](https://arxiv.org/abs/0904.4625v2)

   Version 2, full text. Section II, Population genetics in well-mixed populations: genetic drift as random sampling of a finite population, the heterozygosity as the chance that two sampled individuals differ, and its loss with time.

2. [N. Berestycki, Recent progress in coalescent theory, arXiv:0909.3985v1 (2009), Ensaios Matemáticos, Sociedade Brasileira de Matemática](https://arxiv.org/abs/0909.3985v1)

   Version 1, full text. Section 2.1.1: the Kingman coalescent, in which each pair of lineages merges at rate one. Theorem 2.3: the Moran genealogy becomes this coalescent after rescaling time. Theorem 2.4: the Wright-Fisher genealogy does too when time is measured in units of $N$ generations. Theorem 2.8, Eqs. (36)-(38): a neutral allele fixes with probability equal to its frequency, with the diffusion formula for the mean absorption time; the formula after it gives the time conditioned on fixation.
