2.2: Set Operations
- Page ID
- 4869
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Complement of Sets
Definition: Complement
The complement of a set is another set which contains only elements not found in the first set.
Let \(A\) be a set.
\(A\)c = \(\{x \mid x \notin A\}\)
We write c to denote a complementary set.
Often, the context provides a "universe" of all possible elements pertinent to a given discussion. Suppose we have given such a set of "all" elements. Let us call it \(U\). Then, the complement of a set \(A\), denoted by \(A^c\), is defined as \(A^c = U - A\). In our work with sets, the existence of a universal set \(U\) is tacitly assumed.
Example \(\PageIndex{1}\)
Consider \(\mathbb{Q}\) and \(\mathbb{Q}\)c, the sets of rational and irrational numbers, respectively:
\(x \in \mathbb{Q} \to x \notin \mathbb{Q}\)c, since a number cannot be both rational and irrational.
So, the sets of rational and irrational numbers are complements of each other.
Union
Definition: Union
A union of two sets creates a "united" set containing all terms from both sets.
\(A \cup B = \{x \mid (x \in A) \vee (x \in B)\}\)
Example \(\PageIndex{2}\)
Let \(A = \{1, 3, 5\}\) and \(B = \{2, 4, 6\}\)
Then \(A \cup B = \{1, 2, 3, 4, 5, 6 \}\)
Intersection
Definition: Intersection
The intersection of two sets creates a set with elements that are in both sets.
\(A \cap B = \{x \mid (x \in A) \wedge (x \in B)\}\)
Example \(\PageIndex{3}\)
Let \(A = \{8, 12, \frac{3}{7}, -22\}\) and \(B = \{8 675 309, 42, 12, 8, 57\}\)
Then \(A \cap B = \{8, 12\}\)
Set Difference
Definition: Set difference
The difference between two sets generates a set which has no elements of the second set.
\(A - B = \{x \mid (x \in A) \wedge (x \notin B)\}\)
Example \(\PageIndex{4}\)
Let \(A = \{8, 12, \frac{3}{7}, -22\}\) and \(B = \{8 675 309, 42, 12, 8, 57\}\).
Then \(A - B = \{\frac{3}{7}, -22\}\)
The Empty Set
Definition: Empty set
The empty set is a set that has no elements. It is written \(\{\}\) or \(\emptyset\).
\(\emptyset \subseteq A\), for any set A
The empty set has just one subset, which is itself. The empty set is also a subset of every set, since a set with no elements naturally fits into any set with elements.
Disjoints
Definition: Disjoint sets
A and B are called disjoints if \(A \cap B = \emptyset\).
Example \(\PageIndex{5}\)
Consider sets \(\mathbb{Q}\) and \(\mathbb{Q}\)c:
Since \(\mathbb{Q} \cap \mathbb{Q}\)c \(= \emptyset\), these sets are called disjoints.
Cartesian Product
Definition: Cartesian products
The so-called Cartesian product of sets is a powerful and ubiquitous method to construct new sets out of old ones.
Let \(A\) and \(B\) be sets. Then the Cartesian product of \(A\) and \(B\), denoted by \(A \times B\), is the set of all ordered pairs \((a, b),\) with \(a \in A\) and \(b \in B.\) In other words,
\[A \times B = \{(a, b) ~|~ a \in A, b \in B\} .\]
An important example of this construction is the Euclidean plane \(\mathbb{R}^2 = \mathbb{R} \times \mathbb{R}\). It is not an accident that \(x\) and \(y\) in the pair \((x, y)\) are called the Cartesian coordinates of the point \((x, y)\) in the plane.
Example \(\PageIndex{6}\)
Let \(A = \{2, 4, 6, 8\}\) and \(B = \{1, 3, 5, 7\}\). then
\(A \times B = \{(2, 1), (4, 3), (6, 5), (8, 7)\}\)