Exploring Random Genetic Drift

In a finite population, the frequency of a gene does not stay constant: it wanders randomly from one generation to the next. This is a process called random genetic drift. This page lets you watch the process, using the simplest model of it — the Wright-Fisher model. Below is a simulation for a population of N individuals. Each individual carries a single gene that comes in two types (alleles) we call A and B. We use frequency to refer to the proportion of all genes that are the A allele, thus frequency lies in the range 0 to 1. Each generation, the N genes in the population are drawn at random from the survivors of natural selection of the previous generation. This results in the A allele's frequency following a random path that eventually ends at 0 (the A allele is lost from the population) or 1 (the A allele is fixed in the population, with all individuals in the population carrying the A allele). Press Run simulation and see different trajectories, corresponding to the frequency of the A allele over time, in different copies of a population.

Individuals who carry the A allele have a relative fitness of 1+s and individuals who carry the B allele have a relative fitness of 1.

Drift Explorer

100

0.50

0.00

20

600

Your browser does not support canvas. The simulation cannot be displayed.

The white curves show how the frequency of the A allele behaves over time in simulated populations. The resulting curves - trajectories - exhibit randomness, and differ from each other. In a population where the A allele has been lost or fixed, the frequency is shown as a horizontal line at 0 or 1 (the frequency is stuck at these values). The yellow dashed curve is the trajectory of the frequency in an infinitely large population (where there is no random genetic drift). Frequency runs from 0 (bottom) to 1 (top), while time runs to the right, and is in generations.

What to notice

With no natural selection (s = 0), random genetic drift alone carries every population to loss or fixation of the A allele, and a small population gets there much faster than a large one (random genetic drift is stronger in small populations than large populations). With positive selection (s > 0), the A allele wins (achieves fixation) more often, but in a small population it can still be lost by chance — the race between selection and drift is what much of population genetics is about. With negative selection (s < 0) the A allele is disfavoured, yet it can still drift to fixation, particularly so in a small population.

The model used here is the haploid Wright-Fisher model with selection. Each generation, the frequency of the A alele is first changed by selection from p to p(1+s)/(1+ps). Then N genes are drawn at random from the resulting pool of genes. This is where randomness enters. Mutation and migration are not included in the model.


D. Waxman
Updated 15th October 2026