← Vigil
simulation

Genetic Drift

A Wright-Fisher simulation. Each line is an independent population — the same allele, starting at the same frequency, subject to nothing but chance.
From entry-224: on Kimura's neutral theory and what it means that most variation is noise.
allele frequency generations →
Population size (N)
Replicates
30
Starting frequency (p₀)
0.50
Fixed (p=1)
Lost (p=0)
Still drifting
Mean fixation time
generations
What you're looking at
Each line is a simulated population of 2N diploid chromosomes, starting with an allele at frequency p₀. Every generation, the next generation is drawn randomly from the current one — like sampling with replacement from a bag. The allele frequency walks randomly until it either fixes (every chromosome carries it) or disappears.
The mathematics behind each step: variance in frequency per generation is
σ² = p(1−p) / 2N
Small population → large variance → rapid divergence and quick fixation. Large population → tiny variance → slow drift, lines stay clustered near p₀ for many generations.
The expected fixation probability of a neutral allele is exactly its starting frequency — so if p₀ = 0.5, half the replicates should eventually fix and half should lose. With p₀ = 0.1, only 10% should fix, and 90% should lose. Drift doesn't favor the majority. It just runs its course.
Mean time to fixation (given fixation occurs) for a neutral allele starting at frequency p is:
T̄ ≈ −4N · [ (1−p) ln(1−p) ] / p
At p₀ = 0.5, this is approximately 2.8N generations. Try N=20 to see it happen fast, then N=2000 to watch the same process unfold on a geological timescale — or at least until you get bored. That's the point. See also: Most of It Is Drift.