The Hardy-Weinberg equation, mutation and natural selection

Plant Structure and Function, Biodiversity and Conservation · Niche, allele frequency and conservation · note 2 of 4

The Hardy-Weinberg equation, mutation and natural selectionSpec 4.20(i), 4.20(ii)

In short

The Hardy-Weinberg equation, p² + 2pq + q² = 1 with p + q = 1, predicts genotype frequencies in a population in which allele frequencies are not changing. If observed frequencies differ from the predicted ones over generations, allele frequencies are changing. Mutation and natural selection are two causes of change in allele frequency.

The allele frequency is the proportion of a particular allele among all the alleles of that gene in a population. For a gene with two alleles, the dominant allele has frequency p and the recessive allele has frequency q.

p + q = 1
p² + 2pq + q² = 1
  • p = frequency of the dominant allele; q = frequency of the recessive allele
  • p² = frequency of the homozygous dominant genotype; q² = frequency of the homozygous recessive genotype
  • 2pq = frequency of the heterozygous genotype

Conditions for the equation to hold

The equation predicts that allele frequencies stay the same from one generation to the next only if the population is large, mating is random, there is no mutation, no natural selection and no migration into or out of the population (gene flow).

Using it to detect change

If the population does not meet these conditions, allele frequencies may change over time. Allele frequencies are calculated from a sample of one generation and used to predict the genotype frequencies (p², 2pq, q²) expected if nothing changes. These are compared with the frequencies observed in later generations: if they differ significantly, a change in allele frequency is occurring, that is, the population is evolving.

Using the Hardy-Weinberg equation

In a population of 500 plants, 45 plants have white flowers. White is caused by a recessive allele and the population is in Hardy-Weinberg equilibrium. Calculate the number of heterozygous plants.

  1. q² = 45 ÷ 500 = 0.09
  2. q = √0.09 = 0.3
  3. p = 1 − 0.3 = 0.7
  4. 2pq = 2 × 0.7 × 0.3 = 0.42
  5. number = 0.42 × 500

Answer: 210 heterozygous plants

Maths skill:

Always start from the one genotype you can see: the homozygous recessive (q²). Take the square root to get q, then p = 1 − q, then 2pq.

How allele frequencies change

  • Mutation: a change in the DNA base sequence can create a new allele. Mutation is random and rare, but it is the source of new alleles.
  • Natural selection: individuals with advantageous alleles are more likely to survive and reproduce and to pass those alleles on, so the frequency of advantageous alleles increases from generation to generation. For example, a mutation giving bacteria resistance to an antibiotic is selected for when the antibiotic is present, and the frequency of the resistance allele increases.
Two line graphs of allele frequency against generation number: allele R rising and allele r falling under selection, and flat lines when Hardy-Weinberg conditions are met. (opens full size in a new tab)
Allele frequencies change under selection (left) but stay constant when the Hardy-Weinberg conditions are met (right). Illustrative data.

Written and checked against the Edexcel International A Level Biology (YBI11) specification · Updated October 2026

Frequently asked questions

What is a niche in biology?

A niche is the role of a species within its habitat: how it obtains food and other resources, the abiotic conditions it tolerates and how it interacts with other species. Each species has its own niche, and species with very similar niches compete, so one may be excluded.

What are behavioural, anatomical and physiological adaptations?

Behavioural adaptations are how an organism acts, such as hibernation or migration. Anatomical adaptations are structural features, such as the rolled leaves of marram grass. Physiological adaptations are internal processes, such as a kangaroo rat producing concentrated urine. All of them increase survival and reproduction in the environment.

How do you use the Hardy-Weinberg equation?

Find q² from the frequency of the homozygous recessive phenotype, take the square root to get q, then calculate p = 1 − q. Use p² for homozygous dominant and 2pq for heterozygous. If later generations differ from the predicted frequencies, allele frequencies are changing.

All 5 questions on Niche, allele frequency and conservation