Union and Intersection Calculator
Find |A ∪ B| from the sizes of two sets and their intersection.
Use the inclusion–exclusion principle to combine two sets without double-counting the overlap.
The math behind it
|A ∪ B| = |A| + |B| − |A ∩ B|. Subtracting the intersection removes the elements counted twice.
Worked example
|A| = 12, |B| = 9, overlap = 4 → union = 12 + 9 − 4 = 17.
FAQ
What if the sets are disjoint?
Then |A ∩ B| = 0 and the union is simply |A| + |B|.