Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Inclusion–Exclusion for Finite Set Unions

Hello! Last lesson, you checked set equalities by asking which elements belong on each side. Today, the question is numerical: how many distinct elements belong to at least one set? For finite sets, adding their sizes seems natural, but an element in an overlap can be counted more than once. You will learn to correct that overcounting for two and three sets using inclusion–exclusion.


Two sets: count the overlap once

Suppose is the set of students who chose an algebra problem set and is the set who chose a geometry problem set. A student could choose both. If , , and , adding counts each of those 11 students twice. Subtracting 11 leaves each student counted once:

For any two finite sets, the rule is

This includes the familiar case of disjoint sets. If , the final term is zero, so you simply add their sizes. Notice that “in or ” includes those in both; it does not mean “in exactly one.”

Read the explanation in 1.1: Additive and Multiplicative Principles from Mathematics LibreTexts. It develops the formula from a concrete count rather than treating it as a rule to memorise.

1.1: Additive and Multiplicative Principles - Mathematics LibreTexts

Read the explanation under “Principle of Inclusion/Exclusion” to see precisely where addition overcounts.

After the “Investigate!” pie-preference table, begin with the paragraph opening “While we are thinking about sets, consider what happens to the additive principle when the sets are NOT disjoint.” Read the two-set argument, stopping just before the “Cardinality of a union (2 sets)” heading. Focus on why the intersection is subtracted once, not twice.

There is another way to check the answer . Of the 34 students in , 11 are also in . That leaves students in who are new to the count. Thus . Both methods are counting the same union without repetition.


Three sets: why the shared centre returns

Now let be a third set. Begin by adding . Someone in exactly two sets is counted twice, so subtract each pairwise intersection:

There is a catch. An element in all three sets was added three times, then subtracted three times—once in each pairwise intersection. Its current contribution is zero, although it belongs in the union. We must add the triple intersection back once:

The numbers in this image represent how many times an element in each Venn-diagram region has been counted so far—not how many elements the region contains. Follow the centre: its count changes from , to , to the required .

Three Venn diagrams track the count assigned to each region: adding the three set sizes overcounts overlaps, subtracting pairwise intersections removes the triple overlap entirely, and adding the triple intersection restores its count to one.

A pairwise intersection includes the triple intersection. For example, counts everyone in both and , whether or not they also belong to . By contrast, “in and only” explicitly excludes . Keeping that distinction clear is often the hardest part of a word problem.

In the same LibreTexts section, study Example 8 and its three-set formula. The example checks the answer both by filling Venn-diagram regions and by inclusion–exclusion.

1.1: Additive and Multiplicative Principles - Mathematics LibreTexts

Read Example 8 to compare two ways of counting the same union, then study the explanation following “Cardinality of a union (3 sets).”

Under “Principle of Inclusion/Exclusion,” find “Example 8,” beginning “An examination in three subjects, Algebra, Biology, and Chemistry, was taken by 41 students.” Read the example and formula, ending after the numerical calculation that gives 15. Pay particular attention to why a pairwise total includes the student in all three sets.


Apply the rule—and check what the numbers mean

Consider 90 students choosing problem sets. Let , , and denote those who chose algebra, geometry, and statistics, respectively. Suppose the counts are

The question “How many chose at least one?” asks for . Substituting the total intersection counts gives

Since there are 90 students altogether, chose none of the three. That last subtraction needs the total number surveyed; the union formula alone gives only the number inside the sets.

When a problem mixes phrases such as “both” and “only,” a centre-out check is useful. Put 5 in the triple-overlap region first. The -and--only region then contains , not 18. Similarly, the -and--only and -and--only regions contain 9 and 7. Subtracting these regions and the centre from each set total gives 21 in only, 14 in only, and 10 in only. The seven separate regions sum to

matching the formula. The Venn method takes more work, but it is an effective check when the wording is easy to misread.

Before accepting a count, also check its scale: a union cannot be smaller than any one of its sets, and it cannot exceed the total population when one is given. In this example, is at least and no greater than . Such checks will not catch every error, but they can catch an impossible answer quickly.


Inclusion–exclusion counts each distinct member of a union exactly once. For two sets, add their sizes and subtract the overlap. For three sets, add the individual sizes, subtract all three pairwise overlaps, and add the triple overlap back. In word problems, decide first whether each stated overlap is an inclusive intersection or an “only” region; the arithmetic follows from that choice.

Next, you will move from counting members of sets to constructing ordered pairs in Cartesian products and using them to represent relations.

Can't find a good explanation? Sign up and we'll make it for you

Sign up