Wright–Fisher Drift

Compare genetic drift and selection in a reproducible haploid population.

About this tool

Each colored line is an independent simulated haploid population with N allele copies, two alleles A/a and discrete, non-overlapping generations. Small populations drift more strongly. The examples compare neutral drift, population size and selection.

Relative fitness is 1+s for A and 1 for a. After selection, q = p(1+s)/(1+ps). The next generation samples X ∼ Binomial(N,q) and p = X/N. The dashed curve applies selection alone in an infinite population; it is not the expected mean of the stochastic runs under selection.

The initial A count is rounded to the nearest integer Np₀; the actual starting frequency is shown when it differs. Fixation requires exactly p=1, loss exactly p=0. Both are absorbing without mutation. The result counts describe the displayed replicates at the chosen generation, not an estimated long-term fixation probability.

The random seed reproduces the same paths. Each replicate has a separate pseudorandom stream; increasing the replicate count preserves existing paths. Pause or clear the result; editing any parameter cancels the old run. CSV includes every generation, replicate, actual starting frequency and selection-only curve.

Limits: N 10–1000, 1–500 generations, 1–24 replicates, p₀ 0–1, s −0.9–1, integer seed 0–4294967295. No mutation, migration, changing population size, diploid dominance or statistical confidence intervals.