← Back to blog
Study science

Hardy-Weinberg equilibrium explained with examples

The Hardy-Weinberg equations, the five conditions, and worked problems from q^2, the dominant phenotype, and genotype counts with a chi-square test.

Hardy-Weinberg equilibrium describes a population that is not evolving: its allele and genotype frequencies stay the same from one generation to the next. No real population meets the conditions, and that is the point. It is a baseline. When measured genotype frequencies don't match the Hardy-Weinberg prediction, something is acting on the population. Here are the equations, the conditions, and the problem types you will see in General Biology II, each worked through.

The two equations

For a gene with two alleles, call the dominant allele A with frequency p and the recessive allele a with frequency q.

In the second equation, p^2 is the frequency of AA individuals, 2pq is the frequency of Aa heterozygotes (carriers), and q^2 is the frequency of aa individuals. The first equation counts alleles; the second counts individuals. Mixing them up is the most common error on these problems.

The five conditions

A population stays in Hardy-Weinberg equilibrium only if all five hold at once (OpenStax Biology 2e, section 19.1):

  1. No mutation
  2. Random mating
  3. No gene flow (no migration in or out)
  4. A very large population, so genetic drift has no effect
  5. No natural selection

Each condition matches one force of evolution. Mutation adds new alleles, nonrandom mating changes genotype frequencies, gene flow moves alleles between populations, drift changes frequencies by chance in small populations, and selection favors some genotypes over others.

Example 1: start from the recessive phenotype

In a population, 16% of individuals show a recessive trait. What are p, q and the genotype frequencies?

Only aa individuals show the recessive phenotype, so their frequency is q^2.

So 36% are AA, 48% are carriers, and 16% are aa. Check: 0.36 + 0.48 + 0.16 = 1.

Always start from q^2. You cannot start from the dominant phenotype's frequency as if it were p^2, because the dominant phenotype includes both AA and Aa.

Example 2: carriers outnumber affected individuals

A recessive condition affects 1 in 400 people in a hypothetical population. What share are carriers?

About 9.5% are carriers, roughly 1 in 10.5. That is 38 carriers for every affected person (0.095 / 0.0025 = 38). When a recessive allele is rare, most copies of it sit in heterozygotes, where selection against the recessive phenotype cannot reach them.

Example 3: start from the dominant phenotype

91% of a population shows the dominant phenotype. What share of the dominant-phenotype individuals are heterozygous?

Of the dominant-phenotype individuals, 0.42 / 0.91 = 0.4615, so about 46% are heterozygous. The question asks for a share of a subgroup, so divide by 0.91, not by 1.

Example 4: from genotype counts

A sample of 500 plants has 250 AA, 200 Aa and 50 aa. Is it consistent with Hardy-Weinberg equilibrium?

Step 1: count alleles. Each individual carries two copies, so there are 2 x 500 = 1,000 alleles. AA plants carry two A alleles each and Aa plants carry one.

Step 2: expected counts under Hardy-Weinberg.

Step 3: compare observed to expected with a chi-square test. Chi-square is the sum of (observed - expected)^2 / expected across the three genotypes.

Step 4: compare with the critical value. There are 3 genotype classes, minus 1, minus 1 more because p was estimated from the same data, so there is 1 degree of freedom. The critical value at p = 0.05 with 1 degree of freedom is 3.84. Since 1.134 is below 3.84, the data show no significant departure from Hardy-Weinberg equilibrium.

The chi-square test isn't part of the OpenStax Hardy-Weinberg section, but it is how lab courses and AP Biology usually test these data, and the critical value table is on the AP Biology formula sheet.

Example 5: a population that is not in equilibrium

A sample of 100 has 50 AA, 20 Aa and 30 aa.

34.03 is far above 3.84, so reject the null hypothesis: this population is not in Hardy-Weinberg equilibrium. Look at where the gap is. There are 20 heterozygotes where 48 were expected. A shortage of heterozygotes is the pattern nonrandom mating such as inbreeding produces, though the test itself only tells you that at least one condition is violated, not which one.

Mistakes to watch for

Practice

The Hardy-Weinberg calculator takes q^2, p or q, or genotype counts and shows every step, including the chi-square test, so you can check your practice answers. Despite the shared word, this "equilibrium" is not the chemical kind you solve with ICE tables, though the habit of writing down what you know before solving carries over. Hardy-Weinberg builds on single-gene inheritance, so if genotype ratios feel shaky, review Punnett squares for monohybrid and dihybrid crosses. What's in General Biology II shows where population genetics sits in the course, and the testing effect explains why working problems beats rereading worked examples.

Encodr's free General Biology II course has a full unit on the evolution of populations, including Hardy-Weinberg practice.

Free tool

Hardy-Weinberg Calculator

Allele and genotype frequencies from q^2, p or q, or genotype counts, plus a chi-square test with the working shown.

Try it →

Encodr turns this into a habit: study anything in a feed, and it schedules the rest.

Get started free

Related posts