Switch off natural selection entirely — make every allele exactly equally fit — and evolution does not stop. With nothing pushing, pure chance in who happens to reproduce still grinds one allele to total victory and the other to extinction. Here is the machine that does it, and the proof that the numbers it shows are the real ones.
A textbook lie of omission goes like this: variation in a population is shaped by selection — the fitter allele wins. True, but it buries the deeper, stranger fact. Imagine two alleles, A and a, that are perfectly interchangeable — neither helps nor hurts, neither is seen by selection at all. The frequency of A should just sit where it is forever. It does not. In any finite population it wanders, and it keeps wandering until one allele is gone. This is genetic drift, and it is the engine of evolution that runs with the lights off.
The model is the simplest one that can possibly drift — Wright–Fisher (Sewall Wright, 1931; R.A. Fisher, 1930). A population of N diploid individuals carries 2N copies of a gene. To make the next generation you reach into the current pool and draw 2N copies at random, with replacement. No mutation, no migration, no selection: each copy is as likely to be drawn as any other. That single act of sampling is the whole of drift. Watch one population do it.
Run it a dozen times. Each walk is unpredictable — but the fraction that end at the top converges on 0.50, the starting frequency, exactly. There is no force at work; the wandering itself does the killing.
Why an edge, always? Because the frequency of A is a martingale: its expected value next generation equals its value now (E[p′ | p] = p — there is genuinely no drift in the mean). A bounded martingale must converge, and the only places it can settle are 0 and 1, the two states the sampling can never leave. So it converges to an edge with certainty. And which edge? A bounded martingale lands at 1 with probability equal to its starting value — so
P(an allele eventually fixes) = its current frequency.
A brand-new mutation, present in a single copy out of 2N, has exactly a 1/2N chance of one day being the only version left — no matter how clever or useless it is. Most new genes vanish; a few, by luck alone, take over the species. Run a thousand populations at once and watch the law appear.
Two true things at once: the share fixing at A lands on p₀, and the average heterozygosity falls by a constant factor 1/2N every generation — its half-life is about 1.39·N generations. Small populations lose their diversity fast; that is why drift is the quiet terror of conservation genetics.
Hardy–Weinberg, restored to its real meaning. The Hardy–Weinberg principle (1908) is usually taught as the headline result: allele frequencies stay constant across generations. But its hidden assumption is an infinite population — only then does sampling have zero variance and p′ = p exactly. Hardy–Weinberg is not a law of nature; it is the null model, the prediction for a world with no finite-size noise. Drift is precisely the size of the deviation that real, finite populations force: the per-generation variance of the frequency is p(1−p)/2N — vanishing as N → ∞, largest when N is small. Cut a population in half and you double its wander.
So when does selection win? That is the honest frontier of this whole picture, and it has a number.
Slide s while watching 1/2N. A beneficial allele with s below the drift scale is invisible to selection — it fixes at almost exactly its frequency, as if neutral. Only when |s| ≫ 1/2N does the green curve bow away from the diagonal and selection take the wheel. The boundary s ≈ 1/2N is the real edge between the two evolutionary regimes — named, not fudged.
Everything the three instruments display is computed live in your browser by the same arithmetic the verifier proves: the binomial Wright–Fisher resampling, the exact absorbing Markov chain, Kimura's diffusion formula. The fixation fractions and decay curves are real Monte Carlo, seeded so a screenshot is reproducible.
The named frontier. Two simplifications are stated, not hidden. First, N here is the effective population size Nₑ — in real populations Nₑ is usually smaller than the headcount (unequal family sizes, skewed sex ratios, bottlenecks all shrink it), so real drift is stronger than a census would suggest; the model uses Nₑ = N. Second, the famous result that a new mutant takes on average ≈ 4N generations to fix, given it fixes (Kimura & Ohta, 1969), is a diffusion limit — the exact small-N chain climbs toward it but does not equal it; the page shows the exact chain's own absorption times and names 4N as the asymptote, never claiming a small population already hits it.
research/the-drift/verify.mjs,
31/31. Recomputed, not asserted:
(1) per-generation variance = p(1−p)/2N at three population sizes,
vanishing as N→∞;
(2) E[p′|p]=p to machine precision for every state (the martingale);
(3) fixation probability = p₀ — the exact chain's vector
i/2N solves u=Pu (residual <10⁻¹³),
confirmed by seeded Monte Carlo;
(4) heterozygosity decay H₀(1−1/2N)ᵗ tracked exactly for 30 generations;
(5) mean absorption time grows monotonically with N (exact fundamental matrix);
(6) Kimura's selection formula reduces to p as s→0,
is invisible for |s|≪1/2N and dominant for |s|≫1/2N,
and matches Monte Carlo of the selective Wright–Fisher.
Run it: node research/the-drift/verify.mjs.