The Hardy-Weinberg Principle, and Mathematics within Biology

When we consider low-level biology courses, we may tend to think of more memorization-based concepts, such as the names of dozens of different organelles within a plant cell, as well as their various functions. In many cases, biology courses remain completely descriptive, removing any form of mathematics to avoid confusing the students any further than they already are. There are a few cases in biology, however, where instructors are required to introduce some mathematics to the curriculum; a welcome break from all the memorization required!

Consider a population of herbivorous moths, enjoying a sequestered life on a far-away island, with no predators to worry about and enough food to maintain a stable population of 1,000 moths. Inside the DNA of these moths resides a particular gene known as gene X. Gene X can have two different possible “variants”, capital A and lowercase a. Each moth cell has two copies of this gene, one from its mother and one from its father. As biologists, we know that the capital A variant corresponds to being a red-colored moth, and the lowercase a variant to being a blue-colored moth. The capital A variant is dominant over the other, meaning that if your father or mother gave you the red variant, you would also be a red moth. However, having two a variants results in a blue moth. These kinds of genes can be represented in a Punnett Square, as seen in the diagram below.

AAA (red moth)Aa (red moth)
aAa (red moth)aa (blue moth)
Yes, I am aware my Punnett Square consists of rectangles. Thanks, WordPress!

When two moths reproduce, one copy of the gene from each parent is contributed (at random) to create the child moth, leading to four possible equally-likely results. This concept of how genes are transmitted will help us understand the math behind the Hardy-Weinberg Principle.

Now that we understand the nature of how two individual moths reproduce, let’s zoom out to the bigger picture, considering the case of a population with 1,000 moths. Using our god-like omnipotence, we know that at this point in time there are a total of 1000 lowercase a gene variants in the population, and 1000 uppercase A variants. exactly 250 moths with two lowercase a variants, 250 moths with two uppercase A variants, and 500 with one uppercase A and one lowercase a. Following the Punnett Square logic seen above, it follows that both the 250 homozygous red moths (AA) and the 500 heterozygous moths (Aa) are red, resulting in a total of 250 + 500 = 750 red moths. Let’s unpack this information:

A table explaining the information above in a concise format.

Awesome! We see that the totals gene variants add up correctly — There should be twice as many copies of the gene as there are moths, as every moth has 2 copies. This also highlights an important aspect of observing such populations. Although there are an equal amount of A and a variants in the population, 75% of the population is still red. Why is that?

Recall that the A variant is dominant. Any moths that have the Aa genotype are still completely red. One could say that some of the blue a variants are “wasted”, as they do not contribute to the color when the A variant is present.

Now that we have some of the background necessary, we can begin to explore the question of what the Hardy-Weinberg Principle actually tells us.

When a population is in Hardy-Weinberg Equilibrium, the allele frequencies of that population’s genes that population will not change.

This may sound complicated, but we can break down this concept into more understandable terms. An allele is the scientific name for the different “variants” of a particular gene that we mentioned earlier. For instance, in our above example, the a and A variants are both examples of different alleles.

The term “allele frequency” refers to how many of each variant of the gene are present. For instance, the a allele’s frequency would be 50%, since 1000 of the 2000 alleles in the population are type a.

What does it mean for the allele frequencies to remain constant? Let’s consider the moth example again. Right now, we have a total of 1,000 moths, with 1,000 a alleles and 1,000 A alleles. Now, let’s say the moths have been reproducing a lot, and now there are 2,000 moths. Using the Hardy-Weinberg principle, we can also say there are now 2,000 a alleles and 2,000 A alleles. Furthermore, if there were 750 red moths and 250 blue moths, now there are 750 × 2 = 1,500 red moths, and 250 × 2 = 500 blue moths!

This may seem fairly straightforward. Twice as many moths, twice as many of each kind of moth. Simple algebra, right?

What makes Hardy-Weinberg so interesting, however, is that this neat pattern of multiplication only occurs under a specific set of circumstances — when the population is in Hardy-Weinberg Equilibrium.

There are a few requirements for a population to be in Hardy-Weinberg Equilibrium, but here are the main ones:

  • Mate choice must be completely random. If Mr. Moth #295 has a particular affinity for Ms. Moth #296, tough luck. Everything must be random, otherwise we run the risk of mate selection rendering certain alleles “better” than others, which would disrupt the balance between the two alleles.
  • As we mentioned above, having one allele must provide no advantage over having the other. If being blue makes it easier to survive or reproduce than being red, then over time there will be more blue moths, disrupting the balance.
  • There must be no movement in or out of the population, or any other abnormal activity. That’s why our moths are on an island in the middle of nowhere; escapees or new visitors could also disrupt the balance.
  • The population must be fairly large. In all cases, the Hardy-Weinberg principle deals with averages, not exact numbers. Perhaps a red moth eats a poisonous plant and dies, leaving behind 749 red moths and 250 blue moths. Although it isn’t ever exact, the ratio can still be treated as approximately 3:1. In an extreme example, if our population has a total of 4 moths, the chance of a random occurrence throwing off the balance gets to be extremely likely. This concept is known as genetic drift, an interesting topic in its own right.

Now that we understand what the Hardy-Weinberg Principle describes and under what criteria it occurs, how can we prove that this phenomenon would occur in this way? Now the math starts to get really interesting.

Let’s return again to our example of a population of 1,000 moths which we assume are in Hardy-Weinberg equilibrium. Let’s say this time, however, there are only 500 A alleles, and 1,500 a alleles. Punnett Square time!


At this point, our next step is to calculate the “expected” amount of alleles generated with a case of 16 baby moths. In math, to calculate the expected value we multiply the probability by the number of “trials”, in this case the 16 moths.

Since the Punnett Square has been reduced to one row and column, the math becomes a bit less complex. The probability of the child being AA is the probability of getting two A‘s in a row (because the population is large we can treat it as an independent event). In math, the probability of one event AND another event can be calculated by multiplying the probabilities. Since we know that 1/4 of the alleles are A in this case, the probability of getting two As is 1/4 × 1/4, or 1/16.

Likewise, the probability of being Aa is the same as getting either an A from the father and an a from the mother, OR getting an a from the father and an A from the mother. Since 1/4 of the alleles are A, and 3/4 of the alleles are a, and there are two ways of doing it, the probability is 2 × 1/4 × 3/4 = 3/8.

Finally, the probability of being aa is the probability of getting two a‘s in a row, or 3/4 × 3/4 = 9/16. From here, we can convert these probabilities to expected values, totaling the genotypes to find the expected values for each allele.

The expected value of AA genotypes will be 16 × 1/16 = 1. However, since the AA genotype contains two As, the expected value of A alleles from being AA will be 2. Next, since there is only 1 A allele in the Aa genotype, the expected value of A alleles from being Aa will be 16 × 3/8 = 6. Adding these together, we get that the total expected number of A alleles is 8! Following similar logic (that is a bit too long for the article), we get that the total expected number of a alleles is 24.

Voila! Just how the original ratio of A alleles to the total was 1:4, the expected ratio of A alleles in the 16 baby moths is also 1:4! When new moths were created, the allele ratio stayed the same. This, in essence, demonstrates the Hardy-Weinberg Principle. Complicated, but beautiful! The light at the end of the tunnel!

In summary, the Hardy-Weinberg principle states that whenever a population is in genetic equilibrium, any new organisms will always follow the same patterns as their predecessors.

Like always, there are many interesting questions left unanswered. What practical use does this concept have? What happens to a population that isn’t in genetic equilibrium? Rest assured there will be plenty of time to go over this at a future date. Until we meet again, best wishes and happy exploring!

– Ely

An example of the complex procedures required for a plant cell to undergo photosynthesis. Image credit:
An example of the complex procedures required for a plant cell to undergo photosynthesis. Image credit:

Many thanks to my biology instructor, Mr. Lewis, for introducing me to Hardy-Weinberg, and inspiring me to create this post! For further exploration, I would recommend checking out Khan Academy’s excellent article: You can also subscribe; it’s completely free, WordPress handles all of privacy concerns, and you get notified whenever something new comes out! 🙂

One thought on “The Hardy-Weinberg Principle, and Mathematics within Biology

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: