SOLVETUTORMATH SOLVER

Instrument MI-01-662 · Mathematics

Union and Intersection Calculator

Adding two set sizes double-counts anything they share. Enter the size of each set and their overlap, and this sheet returns the true combined total.

Instrument MI-01-662
Sheet 1 OF 1
Rev A
Verified
Type 05 — Algebra SER. 2026-01662

Size of A ∪ B (union)

21.00000000

|A ∪ B| = |A| + |B| − |A ∩ B|

The working Every figure verified twice
  1. union = 10 + 15 − 4 = 21.00000000
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

When two sets overlap, simply adding their sizes together counts every shared element TWICE — once as part of set A, once again as part of set B. The Inclusion-Exclusion Principle corrects for this by subtracting the overlap back out exactly once: |A ∪ B| = |A| + |B| − |A ∩ B|, where |A ∪ B| is the union (everything in either set, counted once each) and |A ∩ B| is the intersection (only the elements common to both).

This is one of the most widely reused counting ideas in mathematics — it extends to three or more sets (with a more elaborate alternating add-subtract-add pattern for the various overlaps), it underlies probability calculations for 'at least one of these events happens,' and it appears constantly in database queries, survey analysis, and any situation where two groups need to be combined without inflating a shared subgroup.

The formula also pins down two useful boundary cases automatically. When the two sets share nothing at all (a zero intersection), the correction term vanishes and the union is simply the plain sum |A| + |B|. When one set entirely contains the other, or the two sets are identical, the intersection equals the smaller set's own size, and the union collapses down to just the larger set's size — adding the smaller set contributed nothing new at all.

AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|
|A|, |B| — the number of elements in each set; |A ∩ B| — the number of elements the two sets share; |A ∪ B| — the number of distinct elements in either set, counted once each.
  • Enter the size of the first set into the Size of set A field.
  • Enter the size of the second set into the Size of set B field.
  • Enter how many elements the two sets share into the Size of A ∩ B (intersection) field.
  • Read Size of A ∪ B (union): the sheet applies |A| + |B| − |A ∩ B| directly.

Worked example — 10, 15, and an overlap of 4

Set A has 10 elements and set B has 15, and the two sets share 4 elements in common. The union is |A ∪ B| = 10 + 15 − 4 = 21 distinct elements total — not 25, since simply adding the two sizes would have counted those shared 4 elements twice over.

Compare two sets of size 10 each that turn out to be completely identical, sharing all 10 elements: the union is 10 + 10 − 10 = 10, exactly the size of either set alone, since adding a set to an exact copy of itself introduces nothing new at all.

Questions

What is the Inclusion-Exclusion Principle?

It's the rule for finding the true size of a union of overlapping sets: |A ∪ B| = |A| + |B| − |A ∩ B|. Simply adding the two set sizes double-counts every shared element, so subtracting the intersection's size once corrects the total back down to the actual number of distinct elements.

What if the two sets don't overlap at all?

Then the intersection is 0, the correction term vanishes, and the union is simply the plain sum of the two set sizes, |A| + |B| — the ordinary case most people assume by default, valid only when the sets share nothing.

Can the intersection be larger than one of the sets?

No — the intersection can never exceed the size of the SMALLER of the two sets, since it can only contain elements that exist in both. An intersection larger than either individual set would be a logical impossibility, and this calculator flags that input as invalid.

Does this formula extend to three or more sets?

Yes, though it grows more elaborate — for three sets it becomes |A∪B∪C| = |A|+|B|+|C| − |A∩B| − |A∩C| − |B∩C| + |A∩B∩C|, alternating subtraction and addition to correctly account for elements shared by two sets and elements shared by all three.

Where does this show up outside pure set theory?

Constantly — in probability, 'at least one of two events happens' uses the identical add-then-subtract-the-overlap structure; in survey analysis, combining two groups of respondents (say, people who like product A and people who like product B) without double-counting the people who like both relies on exactly this formula.

References