Nepedia
Back to Discover
Fluent Reader
🔢

Inclusion–exclusion principle

math Maturity 7-9 Next article →

Imagine you are counting items in different groups. You might have a group of red toys and a group of cars. Some items belong to both groups, like a red car. If you simply add the number of red toys to the number of cars, you will count those red cars twice. This makes your total number too large. To fix this, you must subtract the items that belong to both groups. This simple way of correcting your count is the inclusion-exclusion principle.

Венов дијаграм
Венов дијаграм

This idea works for many groups, not just two. When you have three groups, the math gets a bit trickier. If you subtract the overlaps between two groups, you might subtract the middle part too many times. To fix that, you have to add the middle part back in.

Inclusion-exclusion
Inclusion-exclusion

The principle follows a steady pattern to keep the count perfect. First, you include the sizes of all individual sets. Next, you exclude the items found in any two sets. Then, you include the items found in three sets. You keep switching between adding and subtracting until every item is counted exactly once.

inclusion-exclusion-3sets
inclusion-exclusion-3sets

People have used these counting ideas for a very long time. The concept is often linked to Abraham de Moivre in the year 1718. Later, a scientist named Daniel da Silva wrote about it in 1854. Another writer named J. J. Sylvester also wrote about it in 1883. Because of these people, some call it the Da Silva formula or the Sylvester formula. These thinkers helped turn a simple counting trick into a major part of math.

Inclusion-exclusion
Inclusion-exclusion

This principle is very useful for solving hard puzzles. One famous puzzle is called the hatcheck problem. It asks how many ways you can shuffle a deck of cards so that no card is in its correct spot. These special shuffles are called derangements. Using this math, we can find that the chance of every card being in the wrong spot is about 37 percent. This is related to a special number called e.

inclusion-exclusion-3sets
inclusion-exclusion-3sets

Math experts use this principle in many different areas. It is used in a field called combinatorics, which is the study of counting. It is also used in probability to find the chance of things happening. You can even use it in measure theory or number theory. It is like a sieve that catches the right numbers while letting the mistakes fall away. This makes it a very powerful tool for mathematicians everywhere.

Dirichlet hyperbola example 4
Dirichlet hyperbola example 4
410 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (4)
File:Венов дијаграм.svg
Венов дијаграм.svg
File:Inclusion-exclusion.svg
Inclusion-exclusion.svg
File:inclusion-exclusion-3sets.png
inclusion-exclusion-3sets.png
File:Dirichlet hyperbola example_4.svg
Dirichlet hyperbola example_4.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.