Set Operations
Union, intersection, complement — and the Venn-diagram picture.
The idea
A set is a collection of distinct objects, called its elements, written inside braces. A set records only which objects belong to it — order and repetition do not count — so $\{1, 2, 3\}$, $\{3, 2, 1\}$ and $\{1, 2, 2, 3\}$ are all the same set. We write $x \in A$ for "$x$ is an element of $A
quot;.From two sets $A$ and $B$ we build three more, each defined by one condition on membership.
- The union $A \cup B$ contains everything that is in $A$ or in $B$, with "or" taken inclusively: the shared elements belong too, listed once each. - The intersection $A \cap B$ contains everything that is in both. - The difference $A \setminus B$ contains everything that is in $A$ but not in $B$.
The figure draws $A$ and $B$ as overlapping circles inside a rectangle $U$ holding everything under discussion. Each operation names a region of the picture: the union is both circles together, the intersection is the overlap, and the difference is $A