From Moths to Math: Understanding Genetic Variation with Hardy–Weinberg Principle
Author: waiGuru Muriuki
When you look at a forest filled with moths, flies, or any other familiar species, it is tempting to think that all individuals are more or less the same. Yet beneath the surface, populations contain a hidden wealth of genetic variation. This variation, expressed as different versions of genes called alleles, is the essential fuel of evolution. Population genetics is the field of biology that studies how this variation is structured and how it changes over time.
At the foundation of population genetics are a few simple but powerful definitions. A locus is the position of a gene or DNA sequence on a chromosome, much like an address on a street. An allele is a variant of that gene, and an individual’s genotype is simply the pair of alleles it carries at a particular locus. Collectively, the alleles of all individuals in a population make up the gene pool, the raw material upon which evolutionary forces act.
One of the most famous illustrations of these concepts comes from the story of the peppered moth (Biston betularia) in England. Before the Industrial Revolution, most moths were light-colored, blending in with lichen-covered tree trunks. A darker form existed, but it was rare because predators could easily spot it against pale bark. With the rise of factories and the soot that coated trees, the tables turned: dark moths became camouflaged while light moths stood out. As a result, the frequency of the dark allele rose dramatically. Later, when pollution controls restored clean trees and lichens, the light form returned to dominance. This tale demonstrates how allele frequencies can shift visibly in response to environmental change, making evolution observable within human history.
To study such changes scientifically, geneticists need a baseline — a model of what populations look like in the absence of evolutionary forces. This is the role of the Hardy–Weinberg principle, which states that if mating is random, populations are infinitely large, and there is no mutation, migration, or selection, then allele and genotype frequencies remain stable over generations. For two alleles, A and a, with frequencies p and q, the Hardy–Weinberg equilibrium predicts that genotypes will occur in the proportions p² for AA, 2pq for Aa, and q² for aa. These proportions serve as a “yardstick” for measuring whether real populations are in equilibrium or whether forces like selection or migration are shifting the genetic makeup.
A simple worked example shows how this is applied. Suppose we collect 100 moths and find 40 AA homozygotes, 40 Aa heterozygotes, and 20 aa homozygotes. The first step is to estimate allele frequencies. Each AA carries two copies of A, each Aa carries one, and each aa carries none. Thus the frequency of A is (2×40 + 40) / 200 = 0.6, while the frequency of a is 0.4. Under Hardy–Weinberg expectations, we would predict 36 AA, 48 Aa, and 16 aa. Comparing these expected numbers to the observed counts reveals small discrepancies. To test whether they are meaningful, we calculate a chi-square statistic: (40–36)²/36 + (40–48)²/48 + (20–16)²/16 = 2.78. With one degree of freedom, this falls below the critical value of 3.841 at the 5% level. In other words, the population does not significantly deviate from Hardy–Weinberg equilibrium, even though it shows a slight shortage of heterozygotes.
This exercise highlights the beauty of population genetics. From just a handful of definitions and a simple formula, we can connect a striking natural story — moths changing color with pollution — to a statistical test that quantifies whether evolution is at work. Chapter One of Gillespie’s Population Genetics: A Concise Guide builds this foundation. It introduces the language of loci and alleles, explains why variation is the raw material of evolution, and provides the Hardy–Weinberg equilibrium and chi-square test as the first tools to study populations. With these in hand, students and scientists alike can begin to see how the invisible mathematics of genes translates into the visible drama of evolution.
References
Gillespie, J. H. (2004). Population genetics: A concise guide (2nd ed.). Johns Hopkins University Press.
Majerus, M. E. N. (1998). Melanism: Evolution in action. Oxford University Press.
Endler, J. A. (1986). Natural selection in the wild. Princeton University Press.
Hartl, D. L., & Clark, A. G. (2007). Principles of population genetics (4th ed.). Sinauer Associates.