Inclusion-Exclusion Calculator
Apply the inclusion-exclusion principle to compute union sizes and exclusive membership for up to three sets.
About this calculator
This calculator applies the inclusion-exclusion principle to three overlapping sets: |A∪B∪C| = |A| + |B| + |C| − |A∩B| − |B∩C| − |A∩C| + |A∩B∩C| (line 13). |A| (Set A Size) has the largest measured effect on the Union at the calculator's defaults, simply because it's the largest of the three set sizes (100, versus 80 for B and 60 for C) — a proportional nudge to a bigger starting number produces a bigger absolute swing in a formula that adds all three linearly. The three pairwise intersections are each subtracted once, so raising any of them pulls the Union down — but the triple intersection |A∩B∩C| is added back at the end, so raising it alone actually pushes the Union up, the opposite direction from the pairwise terms. That "+" exists because the standard sum-then-subtract-pairs approach subtracts the triple-overlap region three times over (once inside each pairwise term), so it has to be added back once to land on the correct count — not because more triple-overlap intuitively means a bigger union.
Exclusive to A, B, and C each report the count of elements belonging to only that one set, none of the others. The calculator does not check that the seven numbers you enter actually describe a consistent configuration of three real sets — it plugs whatever you type straight into the formula (line 13) and reports the result even if, say, an intersection is larger than the sets it's supposed to be part of.
Inputs
Results
|A∪B∪C| (Union Size)
180
How to Use This Calculator
- Enter the sizes of Set A, Set B, and Set C.
- Input the pairwise intersection sizes for A and B, B and C, and A and C.
- Enter the triple intersection size for A, B, and C.
- Review the Union calculated via the inclusion-exclusion principle.
- Use this to count elements satisfying at least one of several overlapping conditions.
How the result changes with |A| (Set A size)
| |A| (Set A size) | |A∪B∪C| (Union Size) |
|---|---|
| 50 | 130 |
| 75 | 155 |
| 150 | 230 |
| 250 | 330 |
What each input means
- |A| (Set A size)
- Number of elements in set A
- |B| (Set B size)
- Number of elements in set B
- |C| (Set C size)
- Number of elements in set C
- |A∩B|
- Elements in both A and B
- |B∩C|
- Elements in both B and C
- |A∩C|
- Elements in both A and C
- |A∩B∩C|
- Elements in all three sets
How this is calculated
Worked example, using the default values
- Identify Input Parameters4 parameters|A| (Set A size) = 100, |B| (Set B size) = 80, |C| (Set C size) = 60, |A∩B| = 30 = 7 input(s) provided
- Calculate |A∪B∪C||A∪B∪C|180 = 180
- Calculate Exclusive to AExclusive to A = max(060 = 60
- Calculate Exclusive to BExclusive to B = max(035 = 35
Engine last updated . Checked against 3 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Does |A| (Set A Size) move the Union more than |B| or |C|?
Yes, at the calculator's default values — because it starts larger. |A∪B∪C| = |A| + |B| + |C| − pairwise overlaps + triple overlap (line 13) adds all three set sizes with equal weight, but Set A Size defaults to 100 versus 80 for Set B and 60 for Set C, so the same proportional nudge to it produces the biggest absolute change.
Why does raising |A∩B∩C| increase the Union instead of decreasing it, like the pairwise overlaps do?
Because it's added back, not subtracted, in the formula (line 13). Subtracting all three pairwise intersections removes the triple-overlap region three times over — once in each pairwise term — so the formula adds |A∩B∩C| back once at the end to correct for that over-subtraction, which is why it moves the Union in the opposite direction from the pairwise terms.
What does 'Exclusive to A' actually count?
It's the number of elements that belong to Set A and to neither Set B nor Set C — computed by starting from |A| and removing everyone who's also in B or C, including the triple-overlap region so it isn't subtracted twice (line 16). It's always clamped at 0 so it never displays a negative count.
Can I enter intersection sizes that don't make sense together, like an overlap bigger than either set?
The engine doesn't validate that the seven numbers are mutually consistent — it just plugs them into the inclusion-exclusion formula (line 13) and reports whatever comes out, including a Union or Exclusive count that could look unusual if your intersection values don't actually describe a valid configuration of three real sets.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Graph Theory Calculator
Analyze graph properties including degree, density, connectivity, and Eulerian path possibility.
Discrete MathematicsPermutations & Combinations Calculator
Calculate permutations and combinations with or without repetition for any n and r values.
Logic & Formal ReasoningVenn Diagram Calculator
Calculate exclusive region values for 2-set or 3-set Venn diagrams using inclusion-exclusion principle.
Logic & Formal ReasoningSet Theory Calculator
Calculate union, intersection, difference, symmetric difference, and complements for two sets with similarity metrics.
Discrete MathematicsBinomial Coefficient Calculator
Calculate nCr and nPr values with Pascal's triangle row visualization.
More in Math & Statistics.