Genetic diversity is not lost according to the census population size N — it is lost according to the effective population size Ne, the size of an idealised population that would drift at the same rate as the real one. Two real-world effects shrink Ne below N:
Unequal sex ratio (Wright 1931):
Ne(sex) = 4·Nm·Nf / (Nm + Nf)
Variance in offspring number (Crow & Morton 1955):
Ne(var) = 4·N / (Vk + 2) [Vk = variance/mean of offspring count]
Combined (independent factors):
1/Ne ≈ 1/Ne(sex) + 1/Ne(var) − 1/N
Each generation this simulator draws Ne "effective parents" (with replacement) from the current population, then draws all N offspring from those parents — a small Ne means offspring share fewer parental lineages, so an allele's frequency swings more per generation. Gene diversity (Nei's expected heterozygosity) is measured directly from the simulated allele pool:
H = 1 − Σ pᵢ² (pᵢ = frequency of allele i)
Expected decay: H(t) = H₀ · (1 − 1/(2Ne))^t
The dashed curve projects that decay formula forward from the current point using today's Ne; the solid curve is the actual simulated trajectory — they track closely but never match exactly, because the simulation is itself one stochastic draw from the same process the formula describes.
The 50/500 rule (Franklin 1980, Soulé 1980), a long-standing conservation-genetics rule of thumb: Ne below ~50 risks measurable inbreeding depression within a few generations; Ne below ~500 is too small to maintain the standing variation needed for long-term adaptive evolution. Try skewing the sex ratio or raising reproductive skew with N held fixed — N never changes, yet Ne and the diversity-loss rate both collapse.