Hardy-Weinberg equilibrium isn’t just a formula to memorise for exams. It’s a working tool that lets population geneticists check whether a real population is evolving. Once you know the expected genotype numbers a population “should” have under equilibrium, you can compare them with what you actually observe. If the two don’t match closely enough, something interesting is happening: selection, non-random mating, migration, or genetic drift. The chi-square test is what turns this comparison from a guess into a statistically defensible conclusion.
Table of Contents
- Why hardy-weinberg equilibrium works as a baseline
- Running the chi-square test step by step
- Step 1: Calculate allele frequencies from observed data
- Step 2: Calculate expected genotype numbers
- Step 3: Calculate the chi-square statistic
- Making sense of degrees of freedom and the critical value
- When alleles can’t be counted directly: the case of dominant traits
- Ticul, mexico and beyond: PTC tasting in real populations
- Why this test matters beyond the classroom
Why hardy-weinberg equilibrium works as a baseline
Hardy-Weinberg equilibrium describes a population where allele and genotype frequencies stay constant across generations, provided nobody is mating non-randomly, mutating, migrating, drifting, or facing selection pressure. In practice, no real population meets all five conditions perfectly. That’s exactly the point. Equilibrium is treated as a null hypothesis, a theoretical “nothing is happening” scenario against which real data gets tested. When observed genotype numbers deviate significantly from what equilibrium predicts, researchers know that at least one assumption has broken down, and that’s often a sign of evolution in action or an error in how the data was collected or genotyped, which is precisely why geneticists routinely check for these deviations in genetic association studies before drawing conclusions from their data.
Running the chi-square test step by step
The chi-square statistic compares observed (O) numbers of each genotype with the numbers expected (E) under equilibrium, using the formula χ² = Σ(O−E)²/E. Getting there takes three straightforward steps.
Step 1: Calculate allele frequencies from observed data
Say a sample of 100 people shows AA = 28, Aa = 45, and aa = 27. Using the allele counting method, the frequency of allele A is p = [(2 × 28) + 45] / 200 = 0.505, and the frequency of allele a is q = 1 − p = 0.495. Each homozygote contributes two copies of its allele, while each heterozygote contributes one copy of each, so dividing by 200 (twice the sample size) gives the correct proportion.
Step 2: Calculate expected genotype numbers
Plugging p and q into the Hardy-Weinberg equation (p² + 2pq + q² = 1) gives expected genotype frequencies, which are then multiplied by the total population size to get expected counts. Here, expected AA = p² × 100 = 25.5, expected Aa = 2pq × 100 = 50.0, and expected aa = q² × 100 = 24.5.
Step 3: Calculate the chi-square statistic
Now the differences between observed and expected numbers get squared and divided by the expected value for each genotype, then summed: (28−25.5)²/25.5 + (45−50.0)²/50.0 + (27−24.5)²/24.5, which works out to roughly 0.245 + 0.5 + 0.255 = 1.0002. That single number, χ² = 1.0002, is what gets compared against a critical value to decide whether the population fits the equilibrium model.
Making sense of degrees of freedom and the critical value
A chi-square value on its own doesn’t mean much until it’s checked against a chi-square distribution table using the correct degrees of freedom (df). For a Hardy-Weinberg test, df = n − k − 1, where n is the number of genotype categories and k is the number of independent allele frequencies estimated from the data. With three genotypes (AA, Aa, aa) and only one independent allele frequency (since q is simply 1 − p), df = 3 − 1 − 1 = 1. This matches how the test is generally structured for a two-allele, three-genotype system, and it’s a detail that’s easy to get wrong if you assume df should equal the number of genotype categories.
At a significance level of 0.05 and df = 1, the critical value from the chi-square distribution table is 3.841. The rule is simple: if the calculated χ² is less than the critical value, the differences between observed and expected numbers are small enough to be explained by chance, so the population is accepted as being in equilibrium. If χ² exceeds the critical value, the deviation is too large to be random, and the null hypothesis is rejected. In the earlier example, χ² = 1.0002 is well below 3.841, so this population can be treated as being in Hardy-Weinberg equilibrium for this gene.
When alleles can’t be counted directly: the case of dominant traits
Allele counting works cleanly when every genotype produces a distinct, visible phenotype. Many human traits don’t cooperate that way. Consider the ability to taste phenylthiocarbamide, or PTC, a bitter-tasting compound used as a classic teaching example in population genetics. Tasters can be either homozygous dominant (TT) or heterozygous (Tt), and both look identical on a taste test. There’s no way to count T and t alleles directly by observation alone.
This is where assuming Hardy-Weinberg equilibrium becomes genuinely useful rather than just theoretical. Non-tasters must be homozygous recessive (tt), and under equilibrium, the frequency of this genotype equals q². Since that’s the only genotype you can identify with certainty, you take the square root of the non-taster frequency to estimate q, then calculate p as 1 − q. This single trick converts an unobservable allele frequency problem into a solvable one, using only the phenotype frequency of the recessive category.
Ticul, mexico and beyond: PTC tasting in real populations
In a well-known study by Giles and colleagues conducted in Ticul, Mexico, in 1968, researchers found 117 non-tasters among 1,374 people tested. That gives q² = 117/1374 = 0.085, so q = √0.085 = 0.292, and p = 1 − 0.292 = 0.708. The underlying gene responsible for PTC tasting, TAS2R38, a bitter taste receptor gene identified on chromosome 7, has since been studied across dozens of human populations worldwide, and taster and non-taster frequencies vary noticeably depending on ancestry and geography.
Closer to home, a study across six populations in Jammu and Kashmir used the same serial-dilution PTC testing method and Hardy-Weinberg calculations to estimate taster and non-taster allele frequencies, showing that this decades-old technique from a Mexican village works just as well for population genetics research conducted in India today. The basic PTC tasting trait itself has been recognised as a genetically controlled ability governed by a dominant taster allele and a recessive non-taster allele for nearly a century, which is part of why it remains such a durable classroom and research tool.
Why this test matters beyond the classroom
The chi-square test for Hardy-Weinberg equilibrium isn’t confined to textbook exercises. Medical geneticists use deviations from equilibrium as a quality-control check in large genomic datasets, since unexpected departures can flag genotyping errors rather than genuine biology. Forensic scientists rely on the same equilibrium assumptions when they use Hardy-Weinberg calculations to estimate how rare a particular DNA profile is within a population, which directly affects how DNA evidence gets interpreted in court. Population geneticists studying wildlife conservation use it to detect inbreeding or population fragmentation in endangered species. In every one of these contexts, the same underlying logic applies: build an expected baseline, compare it against what’s actually observed, and let the chi-square statistic tell you whether the gap is meaningful or just noise.
What do you think? If a population you’re studying shows a chi-square value just barely above the critical threshold, would you feel confident concluding that evolution is definitely occurring, or would you want to check for genotyping errors first? And given how differently PTC tasting frequencies vary across populations like Ticul and Jammu and Kashmir, what evolutionary or historical forces do you think might explain such regional variation in a trait that seems to offer no obvious survival advantage?
References
- https://sites.radford.edu/~rsheehy/Gen_flash/Tutorials/Chi-Square_tutorial/x2-tut.htm
- https://pmc.ncbi.nlm.nih.gov/articles/PMC4853779/
- https://www.sciencedirect.com/science/article/pii/S1110863012000043
- https://www.britannica.com/science/phenylthiocarbamide-tasting
- https://nij.ojp.gov/nij-hosted-online-training-courses/population-genetics-and-statistics-for-forensic-analysts/population-theory/hardy-weinberg-principle
Leave a Reply