What the Hardy-Weinberg principle actually says
The Hardy-Weinberg principle states that in a large, randomly mating population with no selection, migration or new mutation, allele frequencies do not change from one generation to the next, and genotype frequencies settle in a single generation at p2 : 2pq : q2. G. H. Hardy and Wilhelm Weinberg published it independently in 1908, and it is the null model of population genetics — the baseline against which every interesting result is measured.
Its practical use is inversion. You almost never count genotypes directly for a recessive condition, because heterozygotes look exactly like homozygous dominants. What you can count is the recessive phenotype, and that frequency is q2. Take its square root and you have q; subtract from one and you have p; multiply and double and you have the carrier frequency 2pq, which is otherwise invisible.
That inversion is why a genetic counsellor can tell a patient with no family history that their chance of being a cystic fibrosis carrier is about 1 in 25. Nobody counted 25 people and found a carrier. Somebody counted affected births — roughly 1 in 2,500 among people of Northern European ancestry — and ran the square root.
Why the formula has the shape it has
Think of the gene pool as a bucket of alleles. If a fraction p of them are A and a fraction q are a, then p + q = 1 by definition — every allele is one or the other. Now form a zygote by drawing two alleles at random. The chance of drawing A twice is p × p. The chance of drawing a twice is q × q. The chance of one of each is p × q plus q × p, because A can arrive from either parent, which is where the factor of 2 in 2pq comes from. Students who lose that 2 have halved the carrier frequency.
Those three probabilities are exactly the terms of (p + q)2 = p2 + 2pq + q2 = 12 = 1. The equilibrium equation is nothing more than a binomial square, and the check that your three frequencies sum to 1 is a genuine check, not decoration.
The carriers-per-affected ratio falls straight out: 2pq ÷ q2 = 2p ÷ q. As q gets small, p approaches 1 and the ratio approaches 2 ÷ q. Halve the allele frequency and you double the number of carriers hiding behind each affected person. This single ratio explains why recessive disease alleles are so hard to remove from a population by selection against affected individuals: almost every copy of the allele is sitting in a heterozygote that selection cannot see.
One conversion trips people up more than any other: the square root goes on the phenotype frequency, not on the allele frequency. If a trait appears in 4% of a population, q2 = 0.04 and q = 0.20, not 0.04. Entering 0.04 into the allele-frequency field instead would report a carrier frequency of 7.7% rather than the correct 32%.
Worked example: a condition affecting 1 birth in 2,500
Take a recessive condition with an incidence of 1 in 2,500 live births, and scale the answer to a city of 100,000 people.
- Write the phenotype frequency. 1 ÷ 2,500 = 0.0004. This is q2, because only aa individuals show the trait.
- Take the square root. q = √0.0004 = 0.02.
- Get the other allele. p = 1 − 0.02 = 0.98.
- Homozygous dominant. p2 = 0.98 × 0.98 = 0.9604, or 96.04%.
- Carriers. 2pq = 2 × 0.98 × 0.02 = 0.0392, or 3.92%.
- Affected. q2 = 0.02 × 0.02 = 0.0004, or 0.04% — which returns the incidence you started from, as it must.
- Check the sum. 0.9604 + 0.0392 + 0.0004 = 1.0000. Exactly.
- Express carriers as 1 in N. 1 ÷ 0.0392 = 25.5, so about 1 person in 25 is a carrier.
- Carriers per affected person. 0.0392 ÷ 0.0004 = 98, which equals 2 × 0.98 ÷ 0.02.
- Scale to the city. 0.0392 × 100,000 = 3,920 carriers, against 0.0004 × 100,000 = 40 affected people.
Read the last two lines together. In a city of 100,000, forty people have the condition and nearly four thousand carry the allele without knowing it. Every one of those 3,920 people has a 1 in 25 chance that a randomly chosen partner is also a carrier, which is precisely the calculation behind population carrier screening.
How to read the numbers you get back
Start with q, not with the percentages. An allele frequency below about 0.05 marks a genuinely rare allele: heterozygotes outnumber affected homozygotes by 38 to 1 or more (2 × 0.95 ÷ 0.05 = 38). Between 0.05 and 0.3 you are in the range typical of common polymorphisms and of recessive conditions that reach appreciable frequency in specific populations. Above 0.5 the label "recessive" no longer implies "rare" — dominant and recessive describe how an allele behaves in a heterozygote, never how common it is.
The heterozygote frequency has a ceiling. 2pq is maximised at q = 0.5, where it equals 0.5 exactly, and it falls away symmetrically on both sides. No population in Hardy-Weinberg equilibrium can be more than half heterozygous at a two-allele locus. If observed heterozygosity in your sample exceeds 50%, either the locus has more than two alleles, or the sample is not in equilibrium — a bulk cross of two inbred lines does exactly this.
Treat a mismatch as information. When observed genotype counts depart from these expectations, the departure has named causes: non-random mating and inbreeding produce a heterozygote deficit; population structure (two subpopulations pooled) also produces a deficit, the Wahlund effect; genotyping error, particularly allele dropout, mimics both. Selection against homozygotes, or against heterozygotes, shifts things the other way. Quantify the mismatch with the genetics chi-square goodness-of-fit calculator, and measure the size of the heterozygote deficit or excess with the inbreeding coefficient reported by the allele frequency calculator.
Carrier frequency and carrier-to-affected ratio by disease incidence
| Incidence (q²) | q | p | Carrier frequency 2pq | Carriers as 1 in | Carriers per affected |
|---|---|---|---|---|---|
| 1 in 100 | 0.100 | 0.900 | 18.00% | 5.6 | 18 |
| 1 in 400 | 0.050 | 0.950 | 9.50% | 10.5 | 38 |
| 1 in 1,600 | 0.025 | 0.975 | 4.88% | 20.5 | 78 |
| 1 in 2,500 | 0.020 | 0.980 | 3.92% | 25.5 | 98 |
| 1 in 10,000 | 0.010 | 0.990 | 1.98% | 50.5 | 198 |
| 1 in 40,000 | 0.005 | 0.995 | 1.00% | 100.5 | 398 |
| 1 in 250,000 | 0.002 | 0.998 | 0.40% | 250.5 | 998 |
The last column is always 2p/q, so it is close to 2/q for any rare allele. Rarer allele, more carriers per affected person.
Mistakes that produce a wrong carrier frequency
- Square-rooting the wrong thing. The incidence of the recessive phenotype is q², so q is its square root. Taking the square root of an allele frequency that was already q is the single most common error.
- Losing the factor of 2 in 2pq. Heterozygotes arise two ways — A from mother and a from father, or the reverse — so the frequency is 2pq, not pq.
- Entering a percentage as a decimal fraction. A trait in 4% of people is q² = 0.04, giving q = 0.20. Typing 4 instead of 0.04 makes the calculation meaningless.
- Assuming a dominant phenotype frequency is p. The dominant phenotype covers both AA and Aa, so its frequency is p² + 2pq = 1 − q². Get q from the recessive class and work backwards.
- Applying one population's incidence to another. Allele frequencies differ substantially between ancestral populations, and a carrier risk quoted for one group does not transfer to another.
- Using it on X-linked loci unchanged. Males carry one X, so the frequency of an X-linked recessive condition in males is q itself, not q². Females follow p² : 2pq : q².
- Forgetting that several different pathogenic variants may exist at one locus. Screening panels detect a subset of them, so a negative screen lowers but does not eliminate carrier risk.
What the model assumes, and when it stops being true
Five assumptions carry the whole result: random mating with respect to the locus, no selection on any genotype, no migration, no mutation, and a population large enough that random sampling of gametes does not shift frequencies. Violate any of them and the expected genotype frequencies stop being expected.
In practice the assumptions fail gracefully. Selection against a rare recessive is extremely weak per generation, because so few copies of the allele are exposed to it — with q = 0.02, only 1 allele copy in 51 sits in an affected homozygote. Mutation rates at the scale of 10−5 or 10−6 per locus per generation are far too small to shift frequencies over the timescales you are working on. Population size matters only when it is genuinely small: drift dominates in the low hundreds, not in the tens of thousands.
The assumption that fails first, and most often, is random mating. Consanguineous marriage, assortative mating and population substructure all raise the homozygote frequencies above p² and q² and depress 2pq. For a couple who are first cousins, the appropriate risk calculation is not q² but F·q + (1 − F)·q², with F = 1/16 for first-cousin offspring: at q = 0.02 that gives 0.0625 × 0.02 + 0.9375 × 0.0004 = 0.00163, roughly four times the population baseline of 0.0004. Work the case-specific version through the autosomal recessive carrier risk calculator.
Finally, this calculator handles one locus with two alleles. For a Mendelian cross rather than a population, use the Punnett square probability calculator; for the number of distinct gametes a multi-locus genotype can make, the gamete combinations calculator; and for linked loci, the recombination frequency and map distance calculator.
Key terms
- Allele frequency
- The proportion of all copies of a gene in a population that are a particular variant. Written p and q for a two-allele locus, and p + q = 1.
- Genotype frequency
- The proportion of individuals with a given pair of alleles. Under Hardy-Weinberg these are p², 2pq and q².
- Heterozygote (carrier)
- An individual with one copy of each allele. For a fully recessive condition a carrier is clinically unaffected, which is what makes 2pq invisible to direct counting.
- Penetrance
- The proportion of individuals with a genotype who show the associated phenotype. Deriving q from disease incidence assumes penetrance is complete; if it is not, the true q is higher.
- Wahlund effect
- The deficit of heterozygotes seen when two or more subpopulations with different allele frequencies are pooled and analysed as one.
- Fixation
- The state in which one allele has frequency 1 and all others are lost. At fixation there are no heterozygotes and carrier ratios are undefined.
