Each sphere is an individual carrying one of several allele colors. Every generation, individuals reproduce with random mating; small populations lose alleles faster through genetic drift, and bottleneck events sharply reduce diversity.
H_e = 1 - Σ pᵢ² (expected heterozygosity)
ΔH per gen ≈ H / (2N) (drift loss, N = pop size)
- Population size — larger N slows genetic drift and preserves diversity longer.
- Mutation rate — introduces new allele variants each generation.
- Migration (gene flow) — reintroduces alleles from an external population, countering drift.
- Bottleneck button — instantly culls the population to simulate a catastrophe, testing recovery of diversity.
Real-world application: this is exactly the drift/bottleneck math conservation biologists use to set minimum viable population sizes for endangered species breeding programs.