BIOL-108 · Lesson 3 of 12 · 25 min
Mutation, gene flow, genetic drift and Hardy–Weinberg
Natural selection is only one of the forces that change populations. Mutation creates new genetic variation, gene flow moves it between populations, and genetic drift changes allele frequencies by pure chance. To see any of these forces at work, biologists need a baseline: what would a population look like if nothing were changing it? That baseline is the Hardy–Weinberg principle. This lesson introduces the vocabulary of population genetics, the Hardy–Weinberg model and the four main evolutionary forces. BIOL-322 develops the mathematics much further.
Genes, alleles and gene pools
A gene is a stretch of DNA that codes for a product such as a protein. Different versions of a gene are called alleles. A diploid organism such as a human, a pea plant or a fruit fly carries two copies of each gene, one from each parent, and so has two alleles at each locus (gene position). If the two alleles are the same, the individual is homozygous; if they differ, it is heterozygous. The combination is the genotype; the observable trait it produces is the phenotype.
Population geneticists think in terms of the gene pool: all the alleles at a locus across all the individuals in a population. The allele frequency is the proportion of all copies that are a given allele. If a population of 100 diploid moths has 200 copies of a colour gene and 120 of them are allele A, then the frequency of A, written \(p\), is 0.6 and the frequency of the other allele a, written \(q\), is 0.4. Because there are only two alleles here, \(p + q = 1\). Evolution, in the modern synthesis definition, is a change in allele frequencies over generations.
The Hardy–Weinberg principle
In 1908 the English mathematician G. H. Hardy and the German physician Wilhelm Weinberg independently showed that, in a large, randomly mating population with no evolutionary forces acting, allele frequencies stay constant from generation to generation and genotype frequencies settle at predictable values after one generation of random mating:
Here \(p^2\) is the frequency of AA homozygotes, \(2pq\) the frequency of Aa heterozygotes and \(q^2\) the frequency of aa homozygotes. The logic is simply probability: if eggs and sperm combine at random, the chance of an offspring receiving A from both parents is \(p \times p\), and the chance of one A and one a is \(2pq\) because it can happen two ways.
Hardy–Weinberg equilibrium holds only when five conditions are met. Each condition corresponds to one evolutionary force that, if present, will change allele or genotype frequencies.
| Hardy–Weinberg condition | Force that breaks it | Effect when broken |
|---|---|---|
| No mutation | Mutation | New alleles appear and frequencies change slowly |
| No migration | Gene flow | Alleles enter or leave; populations become more similar |
| Very large population | Genetic drift | Frequencies change at random, fastest in small populations |
| No selection | Natural selection | Alleles that improve fitness increase |
| Random mating | Non-random mating (for example inbreeding) | Genotype frequencies shift, usually toward more homozygotes, without directly changing allele frequencies |
Real populations never meet all five conditions perfectly, so why is the model useful? Because it is a null hypothesis. If observed genotype frequencies match Hardy–Weinberg expectations, no strong force is acting on that locus, at least not detectably. If they do not match, something is happening, and the pattern of the mismatch hints at what.
Worked problem
Estimating carrier frequency
Cystic fibrosis is a recessive condition. Suppose it affects about 1 in 3,600 births in a population. Assuming Hardy–Weinberg equilibrium, what proportion of people are heterozygous carriers?
Show solution
- Affected people are aa, so q² = 1/3,600.
- q = √(1/3,600) = 1/60 ≈ 0.0167.
- p = 1 − q ≈ 0.9833.
- Carriers are heterozygotes: 2pq = 2 × 0.9833 × 0.0167 ≈ 0.0328.
Answer: About 3.3 per cent, roughly 1 person in 30, is a carrier, even though only 1 in 3,600 is affected. Most copies of a rare recessive allele hide in heterozygotes.
Testing for equilibrium
To test whether a sample fits Hardy–Weinberg proportions, biologists count genotypes, estimate allele frequencies from the counts, calculate the expected genotype numbers and compare observed with expected using a chi-square test. For one gene with two alleles there is one degree of freedom (three genotype classes, minus one for the total, minus one for the estimated allele frequency).
from scipy.stats import chi2
# Genotype counts at a two-allele locus in a sample of 500 deer (invented data)
obs = {"AA": 205, "Aa": 210, "aa": 85}
n = sum(obs.values())
p = (2 * obs["AA"] + obs["Aa"]) / (2 * n)
q = 1 - p
exp = {"AA": p * p * n, "Aa": 2 * p * q * n, "aa": q * q * n}
stat = sum((obs[g] - exp[g]) ** 2 / exp[g] for g in obs)
pval = chi2.sf(stat, df=1)
print(f"p = {p:.3f}, q = {q:.3f}")
for g in obs:
print(f"{g}: observed {obs[g]:3d}, expected {exp[g]:6.1f}")
print(f"chi-square = {stat:.2f}, df = 1, P = {pval:.4f}")p = 0.620, q = 0.380 AA: observed 205, expected 192.2 Aa: observed 210, expected 235.6 aa: observed 85, expected 72.2 chi-square = 5.90, df = 1, P = 0.0151
Here there are fewer heterozygotes than expected and more of both homozygotes. A deficit of heterozygotes is the classic signature of inbreeding, or of a sample that accidentally mixed two populations with different allele frequencies (called the Wahlund effect). A small P value tells us the population is not in equilibrium at this locus; the biology tells us which explanation to investigate.
Mutation: the source of new variation
A mutation is a change in DNA sequence. Mutations arise from copying errors during DNA replication, from chemical damage and radiation, and from mobile genetic elements that jump around the genome. They range from single base changes (point mutations) to insertions, deletions, duplications of whole genes and rearrangements of chromosomes. Gene duplications are especially important in evolution, because the spare copy is free to accumulate changes and take on new functions; the globin genes that carry oxygen in our blood arose this way.
Mutation rates per gene are low. In humans, each newborn carries roughly 60 to 70 new point mutations across the whole genome that neither parent had, out of about 3 billion base pairs per genome copy. Most mutations are neutral, having no effect on fitness; many of the rest are harmful; a few are beneficial in a particular environment. Crucially, mutations are random with respect to need: an environment does not cause the mutations that would help in it. Mutation alone changes allele frequencies very slowly, but it supplies the raw material for every other force.
Gene flow
Gene flow is the movement of alleles between populations through migrating individuals or dispersing gametes, such as pollen carried by wind or bees. Gene flow tends to make populations more similar to each other, counteracting the differences produced by selection and drift. It can also introduce useful alleles: populations of plants on old mine sites receive pollen from nearby populations, and the balance between gene flow and local selection for metal tolerance can be measured across just a few metres of ground.
A simple way to see gene flow's effect: if a fraction \(m\) of a population each generation is made up of migrants from a source with allele frequency \(p_m\), the local frequency moves toward the source value: \(p' = (1-m)\,p + m\,p_m\). Even a few migrants per generation is enough to prevent populations from diverging very far by drift alone.
Genetic drift
Genetic drift is change in allele frequencies due to chance: which individuals happen to survive, mate and pass on which of their two alleles. In a large population these chance effects average out. In a small population they do not, and allele frequencies wander randomly from generation to generation until, eventually, one allele is lost and the other is fixed (reaches 100 per cent). Drift does not favour helpful alleles; it is blind.
The Wright–Fisher model, named after Sewall Wright and Ronald Fisher, simulates drift: each new generation of \(N\) diploid individuals draws its \(2N\) allele copies at random from the previous generation's gene pool. The simulation below runs it for a small and a large population.
import numpy as np
# Wright-Fisher genetic drift: 2N allele copies drawn at random each generation
rng = np.random.default_rng(7)
def drift(N, p0=0.5, gens=100, reps=200):
p = np.full(reps, p0)
for _ in range(gens):
p = rng.binomial(2 * N, p) / (2 * N)
return p
for N in (10, 100, 1000):
p = drift(N)
lost_or_fixed = np.mean((p == 0) | (p == 1))
print(f"N = {N:4d}: after 100 generations, {lost_or_fixed:5.1%} of 200 populations "
f"have lost or fixed the allele; spread of p (SD) = {p.std():.3f}")N = 10: after 100 generations, 100.0% of 200 populations have lost or fixed the allele; spread of p (SD) = 0.500 N = 100: after 100 generations, 13.0% of 200 populations have lost or fixed the allele; spread of p (SD) = 0.317 N = 1000: after 100 generations, 0.0% of 200 populations have lost or fixed the allele; spread of p (SD) = 0.113
With only 10 individuals, every one of the 200 simulated populations has lost one allele within 100 generations; with 100 individuals, about one population in eight has; with 1,000, none has and frequencies have spread only modestly around 0.5. Drift also erodes genetic diversity. A useful measure is heterozygosity, the proportion of individuals that are heterozygous. Under drift alone it declines each generation by a factor of \(1 - \frac{1}{2N}\), so a population of 25 loses about 2 per cent of its heterozygosity every generation, and about 87 per cent over 100 generations.
Two special cases of drift matter for conservation and human history:
| Situation | What happens | Example |
|---|---|---|
| Bottleneck effect | A population is drastically reduced, and the survivors carry only a random fraction of the original variation | Northern elephant seals were hunted to perhaps 20 to 100 animals in the 1890s; today’s 200,000-plus seals have very low genetic diversity |
| Founder effect | A few individuals found a new population, carrying an unrepresentative sample of alleles | Some genetic conditions are unusually common in communities founded by small groups, such as several inherited disorders in the Saguenay–Lac-Saint-Jean region of Quebec and among Old Order Amish families in Pennsylvania |
Putting the forces together
In real populations all these forces act at once. Mutation slowly adds variation; drift removes it at random, quickly in small populations; gene flow homogenizes populations; selection pushes allele frequencies toward whatever works best locally; non-random mating rearranges genotypes. Whether selection or drift wins depends on population size: roughly, if the selection coefficient is much smaller than \(1/(2N)\), drift dominates and the allele behaves as if it were neutral. This is why small, isolated populations of endangered species can accumulate harmful alleles, and why conservation programs work hard to keep populations large and connected (lesson 12).
Common mistakes
MistakeHardy–Weinberg describes how real populations usually behave.
InsteadIt is a null model of no evolution; deviations from it reveal which forces are acting.
MistakeDominant alleles automatically become more common over time.
InsteadDominance describes how alleles are expressed in heterozygotes, not whether they spread; without selection, allele frequencies stay constant.
MistakeGenetic drift favours beneficial alleles.
InsteadDrift is random; it can fix harmful alleles and lose helpful ones, especially in small populations.
MistakeMutations occur because organisms need them.
InsteadMutations arise at random with respect to need; selection then sorts them.
MistakeIn p² + 2pq + q² = 1, 2pq is the frequency of the a allele.
Instead2pq is the frequency of heterozygous individuals; q is the frequency of the a allele.
Summary and key terms
- Allele frequencies describe a gene pool; evolution is a change in allele frequencies over generations.
- Hardy–Weinberg: with no mutation, migration, drift or selection and with random mating, genotype frequencies are p², 2pq and q².
- Comparing observed with expected genotype counts using chi-square tests whether forces are acting.
- Mutation is the ultimate source of new alleles and is random with respect to need.
- Gene flow moves alleles between populations and makes them more similar.
- Genetic drift changes allele frequencies by chance, fastest in small populations, and erodes heterozygosity by about 1/(2N) per generation.
- Bottlenecks and founder effects are dramatic forms of drift with consequences for conservation and human health.
- allele
- One of the alternative forms of a gene.
- gene pool
- All the alleles at all loci in a population.
- allele frequency
- The proportion of all gene copies in a population that are a particular allele.
- Hardy–Weinberg equilibrium
- The constant allele and genotype frequencies expected in a population with no evolutionary forces acting.
- mutation
- A change in the DNA sequence.
- gene flow
- Movement of alleles between populations by migration of individuals or gametes.
- genetic drift
- Random change in allele frequencies due to chance in finite populations.
- fixation
- The state in which one allele has reached a frequency of 100 per cent in a population.
- bottleneck effect
- Loss of genetic variation when a population is drastically reduced in size.
- founder effect
- Reduced and unrepresentative variation in a population started by a few individuals.
Practice problems
Work each problem on paper first, then reveal the answer to check.
In a sample of 400 alleles, 280 are B. What are p and q?
Show answer
p = 280/400 = 0.7 and q = 0.3.
If p = 0.7, what genotype frequencies does Hardy–Weinberg predict?
Show answer
BB 0.49, Bb 0.42, bb 0.09.
A recessive trait appears in 4 per cent of a population. What is the carrier frequency?
Show answer
q² = 0.04 so q = 0.2, p = 0.8, and 2pq = 0.32 (32 per cent).
Which Hardy–Weinberg condition does inbreeding violate, and what does it do to genotype frequencies?
Show answer
Random mating; it increases homozygotes and decreases heterozygotes.
Why are most copies of rare recessive alleles found in heterozygotes?
Show answer
Because 2pq is much larger than q² when q is small.
If m = 0.1 and the source has pm = 0.9 while the local p = 0.3, what is p after one generation of gene flow?
Show answer
p′ = 0.9 × 0.3 + 0.1 × 0.9 = 0.36.
A population of 50 loses what fraction of heterozygosity per generation by drift?
Show answer
1/(2 × 50) = 1 per cent.
Distinguish a bottleneck from a founder effect.
Show answer
A bottleneck is a sharp reduction of an existing population; a founder effect occurs when a few individuals start a new population.
Why can harmful alleles become common in small populations?
Show answer
Drift can overpower weak selection when s is small relative to 1/(2N).
Why are gene duplications important in evolution?
Show answer
The extra copy can accumulate mutations and acquire a new function while the original keeps its role.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.