♻️AP Environmental Science Review
How to Use Biodiversity Equations to Compare Biodiversity (Shannon Index)
How to Use Biodiversity Equations to Compare Biodiversity (Shannon Index)
The Shannon Biodiversity Index
Note: The Shannon Biodiversity Index is a useful ecology tool for comparing biodiversity, but this specific equation is not required by the current AP Environmental Science AP course framework. APES students should mainly understand biodiversity conceptually—especially species richness, species evenness, and how biodiversity can be compared between communities. If your teacher includes Shannon calculations, use the steps below as enrichment or class-specific practice.
In AP Environmental Science, biodiversity is typically discussed using two main ideas: species richness (how many different species are present) and species evenness (how evenly individuals are distributed among those species). Some teachers also use the Shannon Biodiversity Index, H = -Σ(pi ln pi), as a mathematical way to combine richness and evenness into a single value. On the APES exam, students are more likely to compare biodiversity conceptually than to be required to calculate Shannon index values.
The Shannon Biodiversity Index is used to quantify biodiversity in a community. The main Shannon index value is H, calculated as H = -Σ(pi ln pi), where pi is the proportion of each species. In some classes or extensions, you may also calculate evenness using E = H / ln(S), but H is the Shannon biodiversity index itself.
Want to learn more about biodiversity make sure you watch this 🎥 video on Biodiversity and Ecosystem Services for more info!

Variables to Know
This equation uses a lot of variables and looks very intimidating 😨 at first, but if you just take it step-by-step, it won't be hard 😎 . Here is what all the variables represent.
- Pi 🥧 - Pi represents the number of a certain species divided by the total population. The 'i' in Pi for this equation represents the species you are calculating Pi for.
- S - The variable 's' represents the number of species in a population.
- E - The variable 'E' represents the evenness of species in a population.
- H - The variable 'H' is the Shannon Biodiversity Index number. Higher values of H represent greater biodiversity.
Biodiversity is influenced by both species richness (the number of different species) and species evenness (how evenly individuals are distributed among those species). The Shannon index H reflects both richness and evenness, while E focuses specifically on evenness.
When E = 1, all species are equally abundant, which indicates maximum species evenness. Lower E values indicate that some species are much more abundant than others. Evenness is one component of biodiversity, along with species richness.
How to Use the Equation
Before you work the example: The Shannon Biodiversity Index is a useful ecology tool for comparing biodiversity, but this specific equation is not required by the current AP Environmental Science AP course framework. APES students should mainly understand biodiversity conceptually—especially species richness, species evenness, and how biodiversity can be compared between communities. If your teacher includes Shannon calculations, use the steps below as enrichment or class-specific practice.
I feel the best way to explain this equation is through an example. Below is an example of a population and how we would use the Shannon Index to calculate H, and then species evenness E if needed.
Example Population:
- Rattlesnakes 🐍 : 18
- Whitetail Deer 🦌 : 25
- Bald Eagle 🦅 : 15
- Lizards 🦎 : 22
- Bears 🐻 : 11
- Bobcat 🐈 : 19
- Total Population: 110
- The first step is to calculate the value of Pi 🥧 for each species. Calculate pi for each species by dividing the number of individuals of that species by the total number of individuals. Keep several decimal places (or use the unrounded calculator values) throughout the calculation, because rounding too early can change the final H and E values. The pi values should sum to 1, aside from tiny rounding differences at the very end.
- Next, we need to calculate the natural log, or ln, of Pi 🥧 for each value. Remember to watch rounding!
- Now, we are going to multiply the Pi 🥧 value to its natural log value.
- After that, we add Pi * ln (Pi) values and multiply them by -1 to get H.
- At the top of the page, we saw two equations. The four previous steps worked out the first equation to find H, the Shannon biodiversity index. If your teacher specifically asks for species evenness, continue from H and calculate E = H / ln(S). Otherwise, H is the Shannon biodiversity index value.
That's the entire equation. Our E value for this example was 0.98. This is very close to 1, which means the species were very evenly represented in the population. Also, the H value for this example was 1.76, which indicates relatively high biodiversity for this community.
Using the Values to Compare
For AP Environmental Science, the biggest idea is still conceptual comparison:
- A community with more species has greater species richness
- A community where species are more equally represented has greater species evenness
- Communities with high richness and high evenness are generally considered more biodiverse
You can use the E value to compare the species evenness of this population to another. Let's say we used the same equation on another population, population 2. If their E value was 0.56, that would tell us that population 1 has greater species evenness, because the species in population 1 were more equally represented.
You can also compare H values to compare overall biodiversity. In this equation, the higher the H value, the greater the diversity in a population. In population 1, the H value was 1.76. For example, if another population had an H value of 1.09, it would have less biodiversity in the community than our original population.
So the big takeaway is:
- H tells you about overall biodiversity
- E tells you specifically about how evenly individuals are distributed among species
Continue to learn about biodiversity and population by reading about the impacts humans have on biodiversity!
-----




