Union, intersection, complement, difference, and symmetric difference
Just as arithmetic gives us ways to combine numbers, set operations give us ways to combine sets. Union brings sets together, intersection finds what they share, and complement identifies what lies outside.
These operations obey elegant algebraic laws -- commutativity, associativity, distributivity, and De Morgan's laws -- that mirror (and generalize) the rules of Boolean logic.
Explore union (A ∪ B) and intersection (A ∩ B) by manipulating sets and watching the results update in real time.
Select an operation and see which regions of the Venn diagram are highlighted.
A ∪ B =
{ 1, 2, 3, 4, 5, 6 }
All elements that are in A or B (or both).
Key insight: Union collects everything from both sets (logical OR), while intersection keeps only what they share (logical AND). These two operations are duals of each other under De Morgan's laws.
Visualize set complement (Aᶜ), set difference (A − B), and symmetric difference (A Δ B). See how removing elements creates new sets.
Choose an operation and see the highlighted region on the Venn diagram. Modify sets A and B below.
A = {1, 2, 3, 4, 5}
B = {3, 4, 5, 6, 7}
Aᶜ =
{ 6, 7, 8, 9, 10 }
All elements in U but not in A.
Key insight: The complement of A contains everything in the universal set that is not in A. The symmetric difference A Δ B contains elements in exactly one of the two sets -- it is the "exclusive or" of set theory.
Combine multiple set operations into compound expressions and verify algebraic identities like De Morgan's laws.
Choose two sets, pick an operation, and see the result. Toggle step-by-step mode for explanations.
A ∪ B =
{ 1, 2, 3, 4 }
|A ∪ B| = 4
| Element | In A | In B | In Result |
|---|---|---|---|
| 1 | Y | N | Y |
| 2 | Y | Y | Y |
| 3 | Y | Y | Y |
| 4 | N | Y | Y |
Key insight: De Morgan's laws state that (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ and (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ. These laws connect union, intersection, and complement in a beautiful symmetry.