Genetic Drift Simulation: Hardy-Weinberg & Flow
Run island populations for 50 generations. When does chance beat selection, and when do islands become new species?
Under Hardy-Weinberg equilibrium (random mating, no selection, no migration, no mutation, very large N), a dominant allele at p = 0.20 stays at 20.0% across 10 generations (p^2 = 0.04 AA, 2pq = 0.32 Aa, q^2 = 0.64 aa; 36.0% dark birds), whereas finite island populations undergo random genetic drift that erodes heterozygosity H_t = H_0*(1 - 1/(2N))^t far faster on 10-bird islets (H_50 = 0.038) than on 500-bird islets (H_50 = 0.476). In this 3D genetic drift simulation, students run Hardy-Weinberg chi-square tests, trigger storm bottlenecks (N = 4) and founder islets, and compare connected vs. isolated twin islands over 200 generations.
- 11 languages
- Laptop · tablet · phone
- Members
Create a free account to get 2 lifetime Free Lab Passes for any labs in the library. The course guide on this page stays free.

Inside this lab
- 1
Preview
- Driving question
- What you will predict
- Equipment and safety
- 2
Lab
- Lock in prediction
- Run the experiment, measure and replay
- Your notebook fills in as you go
- 3
Check
- Did the lab agree with you?
- Claim, evidence, reasoning
- Check questions and a printable lab report
Hardy-Weinberg equation, genetic drift, and gene flow
Use this population genetics simulation and Hardy-Weinberg simulation to separate null equilibrium from the mechanisms that shift allele frequencies (p for dominant dark-feather allele A, q = 1 - p for recessive light allele a):
- Hardy-Weinberg equilibrium:
p + q = 1andp^2 + 2pq + q^2 = 1. Test observed bird samples (n = 50,200, orall 2,000) withchi^2 = sum((O - E)^2 / E),df = 1, critical value3.84(p = 0.05; requires every expected countE >= 5). - Expected heterozygosity decay under drift:
H_t = H_0 * (1 - 1 / (2N))^t(starting atp_0 = 0.5,H_0 = 0.500). - Expected drift variance of
p:Var(p_t) = p_0 * (1 - p_0) * (1 - (1 - 1 / (2N))^t). - Twin-island neutral divergence (
20loci):D = mean(|p_1 - p_2|)averaged across20independent loci on two50-bird islands.
| Evolutionary Force in Lab | Station & Setting | Effect on Within-Population Diversity (H) | Effect on Between-Island Difference (D) |
|---|---|---|---|
| Hardy-Weinberg null | Mainland (N = 2,000, s = 0) | Constant (2pq unchanged in Ideal) | None |
| Genetic drift | Islets (N = 10 vs. 500, 50 gens) | Erodes H rapidly in small N (0.500 -> 0.038 at N = 10) | Increases divergence among isolated islets |
| Bottleneck / Founder | Islets (Storm -> 4 survivors; Found -> 4 colonists) | Sharp drop in H; lost alleles cannot return without gene flow | Instant shift in allele frequency by sampling chance |
| Gene flow (Migration) | Twin East pair (m = 0.02, sandbar) vs. West (m = 0) | Replenishes lost alleles between linked islands | Suppresses D compared with isolated west pair |
| Directional selection | Mainland / Islets (s = +0.10 favoring A) or Twin divergent food (+/-0.10 at locus 0) | Drives favored allele toward fixation (can still lose to drift at N = 10) | Divergent food increases divergence at selected locus |
Apparatus, safety notes, and step-by-step procedure
- Apparatus: 3D archipelago with three stations: (1) Mainland (
N = 2,000birds, adjustablep_0 = 0.1–0.9,Selection None / +10%,10generations, genotype sampler for50,200, orAll, and Hardy-Weinberg chi-square calculator); (2) Islets (8islands,50generations fromp_0 = 0.5, presetsA: 4x10 + 4x500,B: 8x50,C: 4x25 + 4x100,Selection None / +10%, Storm bottleneck to4survivors, and Found a new islet from4birds growing to50); (3) Twin islands (E1/E2sandbar-linkedm = 0.02vs.W1/W2channel-isolatedm = 0,N = 50,20neutral loci,100 -> 200generations, Same vs. Different food, plus illustrative prezygotic/postzygotic barrier scenes); and Inside: gene pool binomial draw visualizer. - Safety note: This is a computer population simulation with no live animals handled; real field biologists obtain permits and follow wildlife ethics protocols before banding or sampling birds.
- Watch the Opening mainland flock (
p_0 = 0.20dominant dark alleleA,36.0%dark birds, random mating, no selection) and lock your 10-generation prediction before pressing Continue. - Open Investigate -> Mainland in Ideal mode, set Start A to
0.60(Selection = None), run10generations, and press Sample to verify exact Hardy-Weinberg counts (AA = 720,Aa = 960,aa = 320,chi^2 = 0.00). - Switch to Real mode on Mainland, sample
200birds (withSelection = Noneand then+10%), and evaluatechi^2(df = 1, critical3.84), noting why failing to reject does not prove zero evolution. - Switch to Investigate -> Islets, lock your 4 x 10 vs. 4 x 500 drift prediction, select Preset A (
4x10 + 4x500) withSelection = None, run50generations, and press Measure now to compare mean|p - 0.5|, heterozygosityH, and fixed/lost alleles across tiny vs. large islets. - Start a new Islets run and trigger a Storm (
4survive) bottleneck on a large500-bird islet mid-run, or click Found a new islet (4founders growing to50), then open Inside: gene pool to inspect parental genotypes and the2Nrandom allele draw into the next generation. - Toggle Selection (
+10%) on Preset A across several Real-mode seeds to test when random drift on10-bird islets overpowers+10%selection and eliminatesA. - Switch to Investigate -> Twin islands, lock your East vs. West isolation prediction, run
100generations (then continue to200), and press Measure now to compareD_linked(east sandbar) vs.D_iso(west channel). - Compare the Prezygotic (different songs) and Postzygotic (sterile hybrids) barrier scenarios, noting that neutral-locus
Dmeasures genetic divergence rather than reproductive compatibility.
Recording table and model reference data
Model reference data — run your own trials in the 3D lab. Values below reflect analytical Hardy-Weinberg and Wright-Fisher drift expectations built directly into
model.ts(p_0 = 0.20opening;p_0 = 0.50,H_0 = 0.500on islets).
| Trial | Independent Variable (Population Size & Condition) | Dependent Variable (Exact Model Expectation) | Units | Observation |
|---|---|---|---|---|
| Ref 1 | Mainland Ideal (p_0 = 0.20, s = 0, 10 gens) | p = 0.200, AA = 0.04, Aa = 0.32, aa = 0.64 (36.0% dark) | frequency (0–1), % | Dominance never raises p under Hardy-Weinberg equilibrium |
| Ref 2 | Mainland Ideal (p_0 = 0.60, s = 0, N = 2,000) | 720 AA, 960 Aa, 320 aa (chi^2 = 0.00, df = 1) | birds, chi^2 | Matches p^2 = 0.36, 2pq = 0.48, q^2 = 0.16 exactly |
| Ref 3 | Islets analytical drift (p_0 = 0.50, t = 50 gens): N = 10 vs. N = 500 | H_50 = 0.038 (Var = 0.2308) vs. H_50 = 0.476 (Var = 0.0122) | heterozygosity H, variance | Small islets lose 92% of expected heterozygosity in 50 generations |
| Ref 4 | Twin islands (N = 50, 20 loci, 100–200 gens): East (m = 0.02) vs. West (m = 0) | D_iso > D_linked across repeated runs (1 migrant/gen mixes East) | mean |p_1 - p_2| | Gene flow prevents neutral divergence; geographic barrier allows drift apart |
| Your Trial | Record station, mode/seed, N or preset, s, and generation | Record AA/Aa/aa, chi^2, p, H, or D_linked vs. D_iso | counts, 0–1, chi^2 | Compare chi^2 against 3.84 (df = 1) only when all expected counts >= 5 |
Lab report outline (blank template)
- Title: State the evolutionary genetics hypothesis tested (Hardy-Weinberg equilibrium, population-size drift, bottleneck/founder effect, or gene flow).
- Purpose: Define how genotype sampling, heterozygosity tracking, and multi-locus island divergence test equilibrium vs. drift and migration.
- Hypothesis: Predict how
pbehaves under random mating with no selection, howN = 10vs.500alters drift after50generations, and how a sandbar vs. deep channel altersD. - Variables: Identify starting
p_0, population sizeN, selections, bottleneck/founder events, and migrationm(independent); genotype counts,p,H, fixation count,chi^2, andD(dependent); non-overlapping generations, zero mutation, and20twin-island loci (controlled). - Data Table: Log Mainland
AA/Aa/aacounts andchi^2, Islet per-island finalp,H, and fixation status, and Twin-islandD_linkedvs.D_isoat generations100and200. - Analysis & Calculation: Compute
p = (2*AA + Aa) / (2n), expected countsn*p^2,n*2pq,n*q^2,chi^2(df = 1), and compare observed meanH_50against0.5 * (1 - 1/(2N))^50. - Conclusion & Sources of Error: Explain when random drift beats selection, distinguish prezygotic vs. postzygotic barriers from neutral divergence
D, and discuss stochastic Real-mode run-to-run variation (including rare runs where a large islet shifts more by chance).
Related evolution and genetics labs
Compare directional selection on adaptive traits in Beaks of Finches, review Mendelian segregation ratios in Genetic Crosses, apply chi-square inference to behavioral counts in Animal Behavior: Choice Chamber, or browse Biology Simulations.
Common questions
What are the Hardy-Weinberg equations and the five equilibrium conditions?
The allele-frequency equation is p + q = 1 and the genotype-frequency equation is p^2 + 2pq + q^2 = 1, where p and q are allele frequencies (A and a) and p^2, 2pq, and q^2 are AA, Aa, and aa frequencies. Equilibrium requires a very large population, random mating, no natural selection, no migration (gene flow), and no mutation.
Why does a dominant allele (A) starting at 20% not take over the mainland flock?
Dominance controls phenotype (both AA and Aa birds have dark feathers), not transmission probability during meiosis. With random mating, no selection, and a large population, each parent passes A or a with equal chance, keeping p fixed at 0.20 generation after generation.
Why do 10-bird islets lose alleles or reach fixation much faster than 500-bird islets?
Each generation draws 2N allele copies randomly from the parental gene pool. Drawing only 20 gene copies (N = 10) produces wide binomial sampling swings that quickly push p to 0 or 1, whereas drawing 1,000 copies (N = 500) keeps allele frequencies tightly clustered near 0.50.
How do a population bottleneck and a founder effect differ in the Islets station?
A bottleneck occurs when a storm slashes an existing islet down to 4 random survivors in place, erasing alleles that happened not to survive. A founder effect occurs when 4 random birds colonize a brand-new empty islet from the p = 0.5 source pool and then expand to 50 birds carrying only the founders' allele sample.
How does gene flow affect divergence between the east and west twin-island pairs?
On the sandbar-linked east pair (m = 0.02, about 1 migrant per 50-bird island each generation), gene flow continually mixes allele pools and keeps the 20-locus mean difference D small. On the channel-isolated west pair (m = 0), independent drift drives D much higher over 100 to 200 generations.
Why does the Hardy-Weinberg chi-square test use 1 degree of freedom instead of 2?
Although there are 3 genotype classes (AA, Aa, aa), the total sample size fixes one constraint and estimating p from those same observed counts uses a second constraint, leaving df = 3 - 1 - 1 = 1 (critical value 3.84 at p = 0.05).


