The Null Model of Evolution
In 1908, mathematician G. H. Hardy and physician Wilhelm Weinberg independently proved that allele frequencies in a population do not change from generation to generation — provided certain idealizing conditions hold. This Hardy-Weinberg principle is the fundamental null hypothesis of population genetics. Any observed change in allele frequencies over time implies that one or more evolutionary forces are at work.
The Hardy-Weinberg Equation
For a gene with two alleles A (frequency p) and a (frequency q = 1−p), the expected genotype frequencies are: AA = p², Aa = 2pq, aa = q². These frequencies emerge after a single generation of random mating and remain constant forever — unless disturbed by selection, drift, mutation, migration, or non-random mating. This simulation plots these frequencies over generations so you can watch equilibrium hold or break.
Genetic Drift in Small Populations
Real populations are finite, and random sampling introduces noise into allele transmission. In a population of 50 individuals, allele frequencies can swing wildly from generation to generation — this is genetic drift. Try reducing population size in the simulation and watch how p fluctuates. In extreme cases, one allele may be lost entirely (fixation of the other). This is why small populations lose genetic diversity and become vulnerable to extinction.
Selection Against the Recessive
When the selection coefficient s > 0, individuals with genotype aa have reduced fitness (1 − s). Over generations, the frequency of allele a declines — but not linearly. The rate of decline slows dramatically as a becomes rare, because most remaining copies are hidden in Aa heterozygous carriers who suffer no fitness cost. This is why harmful recessive diseases persist in human populations at low frequencies, even under persistent selection.