The Hardy-Weinberg equation
For a gene with two alleles, the Hardy-Weinberg principle states p² + 2pq + q² = 1, where p is the dominant allele frequency and q = 1 − p is the recessive allele frequency. The three terms give the expected frequencies of the homozygous dominant, heterozygous, and homozygous recessive genotypes when a population is not evolving. The squared terms are just the probabilities of independent events combining, as the probability calculator sets out.
How to use this calculator
Enter the dominant allele frequency p as a decimal between 0 and 1. The tool computes q, then returns p², 2pq and q². If you only know genotype counts, find p first with the allele frequency calculator.
Worked example
Suppose p = 0.6, so q = 0.4. Then p² = 0.36, 2pq = 2 × 0.6 × 0.4 = 0.48, and q² = 0.16. These sum to 1.00, confirming the population is at equilibrium.
The heterozygote term peaks when p = q = 0.5, where 2pq reaches 0.5 — no population at equilibrium can be more than half heterozygous for a two-allele gene. For a single mating rather than a whole population, use the Punnett square calculator.
Frequently asked questions
- What does Hardy-Weinberg equilibrium mean?
- It describes a non-evolving population where allele and genotype frequencies stay constant across generations, assuming no selection, mutation, migration, drift, or non-random mating.
- What are p and q?
- p is the frequency of the dominant allele and q is the frequency of the recessive allele. Because there are only two alleles, p + q = 1.
- What does 2pq represent?
- 2pq is the expected frequency of heterozygous individuals (one dominant and one recessive allele) in the population.
- Do the three frequencies always add to 1?
- Yes. p² + 2pq + q² is the expansion of (p + q)², and since p + q = 1, the genotype frequencies always total 1.
- What if the observed genotypes do not match the prediction?
- A mismatch is evidence that at least one equilibrium assumption is violated — selection, non-random mating, migration or drift may be acting. Biologists test this formally with a chi-square goodness-of-fit comparison between observed and expected counts.