Labs / Biology
Hardy-Weinberg
Green dots carry allele A, amber dots carry allele a, and split dots are heterozygotes. Each generation the alleles pair up at random, so the genotypes should settle at p², 2pq, and q². Switch on one evolutionary force at a time and watch when the real bars pull away from that prediction.
gen 0p 0.500q 0.500AA 0.250Aa 0.500aa 0.250χ² 0.00
What to try
- With no force acting, why do the observed bars sit right on the dashed p², 2pq, q² outlines generation after generation?
- Turn on selection against aa. Which bar starts falling short of its prediction, and what happens to p over time?
- Mutation and migration both move p, but do they ever break the genotypes away from equilibrium the way selection does? Watch the χ² readout.
- Shrink the population to a handful of individuals. How wildly does p wander now, and can an allele vanish purely by chance?
- Start with p near 0.9 versus near 0.1 under the same force — does the population reach the same place, or does its starting point decide its fate?