Set Operations: Union, Intersection and Difference
A set is simply a collection of distinct things — numbers, letters, people, anything you like — and set operations are the ways of combining or comparing two or more of these collections to make new ones. The idea grew out of nineteenth-century mathematics, but you meet it constantly in everyday reasoning: sorting a guest list, comparing two playlists, working out who is in one club but not the other.
The basic operations
Union takes everything from both sets, with duplicates counted once. If one set holds the red fruits and another the round ones, their union is every fruit that is red, round, or both.
Intersection keeps only what the sets have in common. The intersection of red fruits and round fruits is the cherries and the tomatoes.
Read more
Difference removes one set from another. The difference of red fruits minus round fruits leaves the red things that are not round — strawberries, say. Note that this operation is not reversible: swapping the two sets gives a different result.
Complement works against a background set, often called the universal set. The complement of a set is everything in that background that the set leaves out. It only means something once you have agreed what the background is.
Symmetric difference collects what belongs to exactly one of the two sets — the union with the intersection taken away. Cartesian product, the odd one out, pairs every element of one set with every element of the other, producing not a list of items but a list of combinations.
Seeing it with Venn diagrams
Two overlapping circles make these operations visible. The union is both circles together, the intersection is the lens where they overlap, and each difference is one circle's crescent-shaped remainder. Drawing the picture first is often the fastest way to see whether a problem is asking for "and", "or", or "but not".
Rules worth knowing
Union and intersection are commutative — order does not matter — and associative, so you can group three sets however you like. Intersection distributes over union and union over intersection. De Morgan's laws connect the two: the complement of a union is the intersection of the complements, and the reverse also holds. These rules let you rewrite an expression into something simpler before you calculate.
If you are just starting
Name your sets clearly and write their elements out. Decide early what the universal set is, especially when complements appear. Sketch a Venn diagram even when the question seems easy. And check small cases by hand: with two or three elements you can list every combination, which quickly shows whether a general rule you have written down actually behaves.