Inclusion-Exclusion with Three Sets: Finding Exact Overlaps

Number Puzzle 9th-10th Grade
Problem

Of the 150 houses in a certain development, 60 percent have air-conditioning, 50 percent have a sunporch, and 30 percent have a swimming pool. If 5 of the houses have all three of these amenities and 5 have none of them, how many of the houses have exactly two of these amenities?

Already Got the Answer? Check Here First

  • Setup: set sizes are 90, 75, 45 (sum 210); houses with at least one amenity: 150 − 5 = 145; all three: 5.
  • Key relation:exactly two = (sum of sets) − (at least one) − 2 × (all three)
  • Answer:210 − 145 − 10 = 55 houses have exactly two amenities.
  • One-line check: 85 + 55 + 5 + 5 = 150 houses, and 85 + 2(55) + 3(5) = 210 amenities.

What You Will Learn

  • Why "adding up the sets" overcounts. A house with two amenities is counted twice in the total, and a house with three is counted three times. Seeing this clearly is the whole problem.
  • How to translate a Venn diagram into equations. Each region becomes a category, and two simple equations (one counting houses, one counting amenities) do the rest.
  • The difference between "exactly two" and "at least two." Word choice changes the answer here (55 versus 60), and learning to read it precisely is a skill that carries over to every counting problem.
  • The inclusion-exclusion principle for three sets, and how it connects to the counting-by-tally approach.
  • That you can solve a problem without finding every unknown. You never need to know how many houses have only a pool, and in fact the data do not determine that.

Picture This

With three overlapping categories, a picture does real work. Each of the seven regions inside the circles holds houses with one specific combination of amenities, and the rectangle around everything holds all 150 houses, including those outside every circle.

Of the 150 houses in a certain development, 60 percent have air-conditioning, 50 percent have a sunporch, and 30...
a, b, c = exactly one amenity (AC only, sunporch only, pool only) · d, e, f = exactly two (d: AC + sunporch, e: AC + pool, f: sunporch + pool) · center = all three

The question asks for d + e + f, the three overlap regions that exclude the center. Note that the percentages describe whole circles, so "90 have air-conditioning" means a + d + e + 5 = 90, not just region a.

Solution: Method 1 — The Amenity-Tally Approach

The idea is to count the same group of houses in two different ways, once by houses and once by amenities, then compare. Each way gives one equation, and the two equations together pin down the answer.

Step 1 — Turn the percentages into house counts

Everything is easier with actual numbers of houses:

Air-conditioning: 0.60 × 150 = 90
Sunporch: 0.50 × 150 = 75
Pool: 0.30 × 150 = 45

Step 2 — Find how many houses have at least one amenity

Five houses have none of the three amenities, so the rest must have at least one:

150 − 5 = 145 houses with at least one amenity

Step 3 — Sort those 145 houses by how many amenities they have

Let x be the number of houses with exactly one amenity and y the number with exactly two. We are told that 5 houses have all three. Every one of the 145 houses falls into exactly one of these groups, so

x + y + 5 = 145 → x + y = 140 (Equation 1)

Step 4 — Count amenities instead of houses

Add the three set sizes: 90 + 75 + 45 = 210. This number is the total count of (house, amenity) pairs. A house with one amenity contributes 1 to it, a house with two amenities contributes 2, and a house with all three contributes 3. Therefore

1·x + 2·y + 3·5 = 210 → x + 2y = 195 (Equation 2)

Step 5 — Subtract the equations

Subtracting Equation 1 from Equation 2 eliminates x:

(x + 2y) − (x + y) = 195 − 140
y = 55

For completeness, x = 140 − 55 = 85 houses have exactly one amenity.

Solution: Method 2 — Inclusion-Exclusion Formula

This is the textbook route. It is the same arithmetic in a different outfit, but it organizes the counting through overlaps rather than through "exactly one, two, three."

For three sets A (air-conditioning), S (sunporch), and P (pool), the number of houses in at least one set is

|A ∪ S ∪ P| = |A| + |S| + |P| − |A∩S| − |A∩P| − |S∩P| + |A∩S∩P|

Step 1 — Substitute what is known

145 = 90 + 75 + 45 − (sum of the three pair overlaps) + 5
145 = 215 − (pair overlaps)

So the three pair overlaps add up to 215 − 145 = 70.

Step 2 — Interpret the 70 carefully

The pair overlaps are "at least" overlaps. The set A∩S includes houses with air-conditioning and a sunporch whether or not they also have a pool. So:

  • A house with exactly two amenities sits in exactly one pair overlap, so it is counted once in the 70.
  • A house with all three sits in all three pair overlaps, so it is counted three times in the 70.

Step 3 — Remove the triple-overlap houses

70 = (exactly two) + 3 × 5
exactly two = 70 − 15 = 55

The result matches Method 1. Two routes through the problem agree, which is a good sign.

The Answer

55 houses have exactly two of the three amenities.

Full breakdown: 85 exactly one · 55 exactly two · 5 all three · 5 none · total 150.

Verification

Two independent checks: the house count must come to 150, and the amenity count must come to 210.

Houses: 85 + 55 + 5 + 5 = 150 ✓
Amenities: 85(1) + 55(2) + 5(3) = 85 + 110 + 15 = 210 ✓
Sets: 90 + 75 + 45 = 210 ✓

For a stronger test, build an actual set of houses that fits. Put 20 houses in the AC-and-sunporch-only region, 20 in AC-and-pool-only, and 15 in sunporch-and-pool-only. That gives 55 houses with exactly two amenities. Then:

SetOnly that onePlus pair regionsPlus all threeTotal
Air-conditioning4520 + 20590 ✓
Sunporch3520 + 15575 ✓
Pool520 + 15545 ✓

The "only" columns sum to 45 + 35 + 5 = 85, matching x. Every circle total comes out right, so a valid arrangement exists and the answer is consistent.

What Trips People Up

✗ 90 + 75 + 45 = 210, and 210 − 150 = 60 "overlap houses"

This treats the excess over 150 as the number of houses with two amenities. It ignores two facts: houses with all three are overcounted twice, not once, and the 5 houses with no amenity are not in any circle at all. The excess 210 − 150 mixes both effects together.

✗ Answering 70 (the sum of the pairwise overlaps) or 60 (at least two)

Method 2 produces 70 as an intermediate number. It includes the 5 triple-overlap houses three times. Subtracting only the five houses once gives 65, and subtracting nothing gives 70. Likewise, "at least two" is 55 + 5 = 60. The word exactly is a flag: the all-three houses must be excluded.

✗ x + y + 5 = 150

The 150 includes the 5 houses with none of the amenities. If you write 150 on the right side of the house-count equation, you silently place those houses into "exactly one" or "exactly two." Always subtract the "none" group before using inclusion-exclusion; it lives outside the circles.

✗ Setting out to find each of a, b, c, d, e, f separately

With seven regions and fewer independent equations, the individual regions are not determined. The verification table shows one valid arrangement, but other arrangements work too (try 25, 20, and 10 for the pair regions). The problem asks only for the total of the three pair regions, and that total is forced. Recognizing which quantity the data actually pin down saves a lot of wasted effort.

The Pattern Behind This

The key move was comparing two counts of the same collection. Generalizing it gives a formula that works for any three-set problem. Let N be the total, n the number in no set, T the number in all three, and S the sum of the three set sizes. Then

houses: x + y + T = N − n
tally: x + 2y + 3T = S
─────────────────────────
subtract: y + 2T = S − (N − n)
y = S − (N − n) − 2T

Here, y = 210 − 145 − 2(5) = 55. The formula reads as a story: the sum of the set sizes exceeds the number of distinct houses by exactly the overcounting, and the overcounting is one extra per exactly-two house plus two extra per all-three house.

Limits of the shortcut. It computes the total of the exactly-two regions, not the individual ones. It is also specific to three sets; with four sets the weights become 1, 2, 3, 4 and you need more information, such as the count with exactly three.

If You See These Words...

  • "Exactly two of these" or "exactly one" signals that you must separate Venn regions rather than whole circles.
  • Percentages of a common total (60%, 50%, 30%) that add to more than 100% mean the groups must overlap. Here they add to 140%.
  • "All three" and "none of them" are the two easiest regions to pin down. Start from them.
  • Disguised versions: students taking Math, Science, or Art; customers who buy items A, B, or C; survey respondents choosing several options. If the problem lists group sizes whose total exceeds the population, it is probably this pattern.

Beyond the Textbook

  • Database queries. Counting records that match "at least one of three filters" or "exactly two of three tags" uses the same inclusion-exclusion logic that query planners rely on.
  • Epidemiology and surveys. Overlapping symptoms, risk factors, or product-ownership categories are tallied exactly this way to estimate how many people are in none, one, or several categories.
  • Probability. The formula for P(A or B or C) is inclusion-exclusion with probabilities replacing counts.

If You Want to Go Deeper

Inclusion-exclusion extends to any number of sets, alternating between adding and subtracting overlaps. For four amenities, the "tally" idea needs weights 1, 2, 3, 4, and you would need extra data (for instance the number with exactly three amenities) to pin down the number with exactly two. Try inventing a four-set version where all the numbers are consistent. You will find that checking whether the data are consistent becomes part of the problem.

Extend Your Thinking

Four variations, roughly in increasing order of difficulty. Try each on paper first, then open the solution to compare.

1
More empty houses
In the same 150-house development (90 with air-conditioning, 75 with a sunporch, 45 with a pool, 5 with all three), suppose 20 houses have none of the three amenities instead of 5. How many houses have exactly two amenities?
Step 1 — Houses with at least one amenity

150 − 20 = 130

Step 2 — House-count equation

With x = exactly one and y = exactly two: x + y + 5 = 130, so x + y = 125.

Step 3 — Amenity-tally equation

The set sizes still sum to 90 + 75 + 45 = 210, so x + 2y + 15 = 210, giving x + 2y = 195.

Step 4 — Subtract and solve

(x + 2y) − (x + y) = 195 − 125, so y = 70 houses have exactly two amenities (and x = 55).

Step 5 — Verify

Houses: 55 + 70 + 5 + 20 = 150 ✓. Amenities: 55 + 140 + 15 = 210 ✓. The formula agrees: 210 − 130 − 2(5) = 70.

2
Work backwards to the pool
Among 150 houses, 90 have air-conditioning and 75 have a sunporch. An unknown number have a pool. If 5 houses have all three amenities, 5 have none, and 60 have exactly two amenities, how many houses have a pool?
Step 1 — Houses with at least one amenity

150 − 5 = 145

Step 2 — Find the exactly-one group

Let x be the houses with exactly one amenity: x + 60 + 5 = 145, so x = 80.

Step 3 — Count all amenities from the house side

Total amenities = 1(80) + 2(60) + 3(5) = 80 + 120 + 15 = 215.

Step 4 — Count them from the set side

The same total equals 90 + 75 + p, where p is the pool count. So 165 + p = 215.

Step 5 — Solve and verify

p = 50 houses have a pool. Check: (90 + 75 + 50) − 145 − 2(5) = 215 − 145 − 10 = 60 ✓, matching the given 60 exactly-two houses.

3
A new setting, new numbers
In a school of 200 students, 120 are in the math club, 100 are in the science club, and 80 are in the robotics club. Exactly 20 students are in all three clubs, and 14 students are in none. How many students are in exactly two clubs?
Step 1 — Students in at least one club

200 − 14 = 186

Step 2 — Sum of club sizes

120 + 100 + 80 = 300 memberships in total.

Step 3 — Student-count equation

x + y + 20 = 186, so x + y = 166.

Step 4 — Membership-tally equation

x + 2y + 3(20) = 300, so x + 2y = 240.

Step 5 — Subtract and verify

240 − 166 = 74, so 74 students are in exactly two clubs, and x = 92. Check: 92 + 74 + 20 + 14 = 200 ✓ and 92 + 148 + 60 = 300 ✓.

4
The unknown triple overlap
Back to the original development: 150 houses, with 90 having air-conditioning, 75 a sunporch, and 45 a pool, and 5 houses having none of the three. This time the number of houses with all three amenities is not given. Instead, you are told that the number of houses with exactly two amenities is three times the number with all three. How many houses have all three, and how many have exactly two?
Step 1 — Define the unknowns

Let z = houses with all three, y = exactly two, x = exactly one. The given relationship is y = 3z.

Step 2 — House-count equation

At least one amenity: 150 − 5 = 145, so x + y + z = 145.

Step 3 — Amenity-tally equation

x + 2y + 3z = 90 + 75 + 45 = 210.

Step 4 — Subtract

(x + 2y + 3z) − (x + y + z) = 210 − 145 gives y + 2z = 65.

Step 5 — Use the ratio

Substitute y = 3z: 3z + 2z = 65, so 5z = 65 and z = 13. Then y = 39, and x = 145 − 39 − 13 = 93.

Step 6 — Verify

Houses: 93 + 39 + 13 + 5 = 150 ✓. Amenities: 93 + 78 + 39 = 210 ✓. Ratio: 39 = 3 × 13 ✓. So 13 houses have all three amenities and 39 have exactly two.

Frequently Asked Questions

Add the three set sizes, subtract the number of items that belong to at least one set, then subtract twice the number that belong to all three sets. In this example the sets have sizes 90, 75 and 45 (sum 210), there are 150 items in total, 5 belong to none of the sets and 5 belong to all three. At least one set: 150 − 5 = 145. Then 210 − 145 − 2(5) = 55 items belong to exactly two sets.
For three sets A, B and C: |A ∪ B ∪ C| = |A| + |B| + |C| − |A∩B| − |A∩C| − |B∩C| + |A∩B∩C|. Adding the set sizes counts overlaps too many times, subtracting the pairwise overlaps removes too much from the triple overlap, and adding the triple overlap back fixes that. In this example, 145 = 210 − (pairwise total) + 5, so the pairwise total is 70.
An item in all three sets is counted three times when you add the set sizes, but it should only be counted once in the union. That is two extra counts per item. An item in exactly two sets is counted twice, which is one extra count. So (sum of set sizes) − (union) = (exactly two) + 2(all three). In this example, 210 − 145 = 65, and removing 2 × 5 = 10 leaves 55 items in exactly two sets.
NJ
Neven Jurkovic, PhD

Professor of Computer Science, Palo Alto College, Alamo Colleges District, San Antonio, TX

Developer of Algebrator

Contact

This solution was prepared with AI assistance and reviewed by Dr. Jurkovic for mathematical accuracy and pedagogical clarity.

2026-05-30