Calculator of Alexandria

Hardy–Weinberg equilibrium calculator

Find allele and genotype frequencies, including carrier frequency, from p² + 2pq + q² = 1, with the derivation and its assumptions.

I know the frequency of

As a decimal or fraction of 1. 1 in 2,500 people is 0.0004.

Carriers, heterozygous (2pq)
Dominant allele p
Recessive allele q
Homozygous dominant (p²)
Homozygous recessive (q²)

Formula

p2+2pq+q2=1p^2 + 2pq + q^2 = 1
How it's derived

The formula

p+q=1p + q = 1 p2+2pq+q2=1p^2 + 2pq + q^2 = 1

pp and qq are the frequencies of the dominant and recessive alleles of a gene. p2p^2, 2pq2pq and q2q^2 are the frequencies of the three genotypes: homozygous dominant, heterozygous (carriers), and homozygous recessive.

Where it comes from

In 1908, the mathematician G. H. Hardy and the physician Wilhelm Weinberg independently answered a puzzle: why don’t dominant traits take over a population?

Think of each child as drawing two alleles at random from the population’s gene pool, one from each parent. With random mating, the chance of drawing AA is pp and of drawing aa is qq. So:

  • Both AA: probability p×p=p2p \times p = p^2
  • Both aa: probability q2q^2
  • One of each, in either order: pq+qp=2pqpq + qp = 2pq

These cover every possibility, so they add to (p+q)2=1(p + q)^2 = 1. In the next generation, the allele frequencies come out as pp and qq again. Without outside forces, the frequencies stay constant forever, and a dominant allele doesn’t spread just because it’s dominant.

Worked example

A recessive condition affects 1 in 2,500 people, so q2=0.0004q^2 = 0.0004:

q=0.0004=0.02p=0.98q = \sqrt{0.0004} = 0.02 \qquad p = 0.98 2pq=2×0.98×0.02=0.03922pq = 2 \times 0.98 \times 0.02 = 0.0392

About 1 in 26 people is a carrier, around 100 times more common than the condition itself.

Watch out for

  • The assumptions. Equilibrium needs random mating, a large population, and no selection, mutation or migration. Real populations break these, and departures from Hardy–Weinberg are how geneticists detect those forces.
  • Start from the recessive phenotype. You can count people with a recessive trait (q2q^2), but carriers look the same as AAAA people. That’s why calculations usually begin with q2q^2.

Sources

Last checked