Union of sets
High school
Consider two sets $A$ and $B$. The union of $A$ and $B$, written $A \cup B$, is the set of every element that is in $A$, in $B$, or in both.
Undergraduate
Consider two sets $A$ and $B$. The union of sets $A$ and $B$ is
\[A \cup B = \setdef{x \suchthat x \in A \text{ or } x \in B}.\]More generally, the union of a family of sets \((A_i)_{i \in I}\) is the set of all $x$ such that $x \in A_i$ for some $i \in I$.
Examples
Worked examples
- $A = \setdef{1, 2}$ and $B = \setdef{3, 4}$ : $A \cup B = \setdef{1, 2, 3, 4}$ Elementary
- $A = \setdef{\text{apple}}$ and $B = \setdef{\text{banana}}$ : $A \cup B = \setdef{\text{apple}, \text{banana}}$ High school
- $A = \setdef{\text{apple}, \text{orange}}$ and $B = \setdef{\text{orange}, \text{banana}}$ : $A \cup B = \setdef{\text{apple}, \text{orange}, \text{banana}}$ High school