Union and Intersection Calculator

Your details

Enter the elements of Set A separated by commas (or spaces/semicolons). Numbers, letters, and words are all accepted.
Enter the elements of Set B separated by commas. Duplicates within a set are removed automatically.
When on, repeated elements within the same set are collapsed into one. Turn off if you want to count elements with multiplicity (multisets).
Union A ∪ B
{1, 2, 3, 4, 5, 6, 7}

All elements that appear in A, in B, or in both.

Intersection A ∩ B{3, 4, 5}
Difference A ∖ B{1, 2}
Difference B ∖ A{6, 7}
Symmetric Difference A △ B{1, 2, 6, 7}
|A|5
|B|5
|A ∪ B|7
|A ∩ B|3
|A △ B|4
Sets are disjoint?No
Subset relationNeither is a subset of the other
|A|5
|B|5
|A ∩ B|3
|A ∪ B|7
|A △ B|4

A ∪ B has 7 elements, A ∩ B has 3.

  • The intersection has 3 elements: 60% of A and 60% of B overlap.
  • The union has 7 elements. The inclusion-exclusion principle removes the 3 duplicated elements counted in both sets.
  • The symmetric difference has 4 elements: these belong to exactly one set and would be lost if you took only the intersection.

Next stepUse the cardinality formula |A ∪ B| = |A| + |B| - |A ∩ B| to check probability problems involving two events.

= Powered by OnlyCalculators