Skip to main content
Mathematics LibreTexts

1.2: Operations with Sets

  • Page ID
    92947
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \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{\longvect}{\overrightarrow}\)

    \( \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}\)

    Sets can interact. For example, you and a new roommate decide to have a house party, and you both invite your circle of friends. At this party, two sets are being combined, though it might turn out that there are some friends that were in both sets.

    To visualize the interactions and operations with sets, John Venn in 1880 thought to use overlapping circles, building on a similar idea used by Leonhard Euler in the 18th century. These illustrations now called Venn Diagrams.

    Venn Diagram

    A Venn diagram represents each set by a circle, usually drawn inside of a containing box representing the universal set. Overlapping areas of circles indicate elements common to both sets. Non-overlapping areas of circles indicate that the sets have no elements in common.

    A Venn diagram showing sets A and B and the universal set U. The diagram shows 4 areas: elements that are in set A but not set B, in set B but not set A, in both set A and set B, and in neither set A nor set B.

    Universal Set

    The universal set is a set that contains all elements of interest and is usually denoted, \(U\). The universal set is defined by the context of the problem.

    Example 1

    1. If we were searching for books, the universal set might be all the books in the library.
    2. If we were grouping your Facebook friends, the universal set would be all your Facebook friends.
    3. If you were working with sets of numbers, the universal set might be all whole numbers, all integers, or all real numbers.

    There are three common operations that can be performed on sets: complement, union, and intersection. Each of these operations is defined below and is illustrated using a shaded area of a Venn diagram.

    The universal set is necessary to find the complement of set.

    Complement

    The complement of a set contains everything that is not in the set but still within the universal set.A Venn diagram showing the complement of set A as the area of the universal set U but outside set A.

    The complement of set \(A\) is notated \(A^{\prime}\).

    More formally, we write \(x \in A^{\prime}\) if \(x \in U\) and \(x \notin A\).

    The shaded region of the Venn diagram to the right shows \(A^{\prime}\).

    Note: Occasionally you may see other notation such as \(A^{c}\) and \(\overline{A}\) used to represent the complement of \(A\).

     

    Example 2

    Suppose the universal set is \(U=\) all whole numbers from 1 to 9.

    If \(A=\{\text { 1, 2, 4 }\}\), then \(A^{\prime}=\{\text { 3, 5, 6, 7, 8, 9 }\}\).

    The union and intersection are operations that work on two sets.

    Union and Intersection

    The union of two sets contains all the elements contained in either (or both) sets.A Venn diagram shows the union of sets A and B as joining of the 2 circles representing the sets.

    The union of sets \(A\) and \(B\) is notated \(A \cup B\).

    More formally, we write \(x \in A \cup B\) if \(x \in A\) or \(x \in B\) (or both).

    The shaded region of the Venn diagram to the right shows \(A \cup B\).

     

    The intersection of two sets contains only the elements that are in both sets.A Venn diagram showing the intersection of set A and set B as the overlap of the two circles representing sets A and B.

    The intersection of sets \(A\) and \(B\) is notated \(A \cap B\).

    More formally, we write \(x \in A \cap B\) if \(x \in A\) and \(x \in B\).

    The shaded region of the Venn diagram to the right shows \(A \cap B\).

     

    Example 3

    Suppose the universal set is the letters in the word elastic: \(U=\{\text { e, l, a, s, t, i, c }\}\).

    Consider these sets: \(\quad A=\{\text { s, c, a, l, e }\} \quad B=\{\text { c, a, t }\}\)

    1. Find \(A \cup B\).
    2. Find \(A \cap B\).
    3. Find \(A^{\prime}\).

    Solution

    1. The union contains all the elements in either set:

    \(A \cup B=\{\text { s, c, a, l, e, t }\}\).

    Notice we only list c and a once.

    1. The intersection contains all the elements in both sets:

    \(A \cap B=\{\text { c, a }\}\).

    1.  Here look for all the elements that are not in set \(A\) but still in \(U\):

    \(A^{\prime} =\{\text { t, i }\}\).

    Even though letters like f and g are not in set \(A\), they cannot be in \(A^{\prime}\) because f and g are not in the universal set.

    Example 4

    Consider the sets:

    \(\quad A=\{\text { red, green, blue }\} \quad B=\{\text { red, yellow, orange }\} \quad C=\{\text { red, orange, yellow, green, blue, purple }\}\)

    1. Find \(A \cup B\).
    2. Find \(A \cap B\).
    3. Find \(A^{\prime} \cap C\).

    Solution

    1. The union contains all the elements in either set:

    \(A \cup B=\{\text { red, green, blue, yellow, orange }\}\).

    1. The intersection contains all the elements in both sets:

    \(A \cap B=\{\text { red }\}\).

    1. Here we're looking for all the elements that are not in set \(A\) but are in set \(C\):

    \(A^{\prime} \cap C=\{\text { orange, yellow, purple }\}\).

    Try it Now 1

    Using the sets from the previous example, find \(A \cup C\) and \(B^{\prime} \cap A\)

    Answer

    \(A \cup C=\{\text { red, orange, yellow, green, blue purple }\}\)

    \(B^{\prime} \cap A=\{\text { green, blue }\}\)

    As we saw earlier with the expression \(A^{\prime} \cap C,\) set operations can be grouped together. Grouping symbols can be used with sets like they are with arithmetic - to force an order of operations. When there are multiple set operations to perform, they are performed in the following order:

    1. First, perform any operation within parentheses, ( ).
    2. Then, find the complement.
    3. Next, perform the union \(\cup\) and the intersection \(\cap\) in order from left to right.

    Example 5

    Suppose

    \(U=\{\text { 1, 2, 3, 4, 5, 6, 7, 8 }\} \quad A=\{\text { 2, 4, 7 }\} \quad B=\{\text { 1, 2, 3, 8 }\}\)

    1. Find \((A \cup B)^{\prime}\).
    2. Find \(A^{\prime} \cup B^{\prime}\).

    Solution

    1. We start with the grouping symbols and find the union of set \(A\) and set \(B\): \(A \cup B=\{\text { 1, 2, 3, 4, 7, 8 }\}\).

    Now find the complement of that result with reference to the universal set: \((A \cup B)^{\prime} = \{\text{ 5, 6 }\}\).

    1. We start by finding the complements of sets \(A\) and \(B\): \(A^{\prime} = \{\text { 1, 3, 5, 6, 8 }\}\) and \(B^{\prime} = \{\text { 4, 5, 6, 7 }\}\).

    Now, union the two results: \(A^{\prime} \cup B^{\prime}=\{\text { 1, 3, 4, 5, 6, 7, 8 }\}\).

    Example 6

    Suppose

    \(H=\{\text { cat, dog, rabbit, mouse }\} \quad F=\{\text { dog, cow, duck, pig, rabbit }\} \quad W=\{\text { duck, rabbit, deer, frog, mouse }\}\)

    1. Find \((H \cap F) \cup W\)
    2. Find \(H \cap(F \cup W)\)
    3. Find \((H \cap F)^{\prime} \cap W\)

    Solution

    1. We start with the intersection: \(H \cap F=\{\text { dog, rabbit }\}\).

    Now we union that result with \(W:(H \cap F) \cup W=\{\text{dog, rabbit, duck, deer, frog, mouse }\}\).

    1. We start with the union: \(F \cup W=\{\text{dog, cow, duck, pig, rabbit, deer, frog, mouse }\}\).

    Now we intersect that result with \(H: H \cap(F \cup W)=\{\text { dog, rabbit, mouse }\}\).

    1. We start with the intersection: \(H \cap F=\{\mathrm{ dog}, \text { rabbit }\}\).

    Now we want to find the elements of \(W\) that are not in \(\mathrm{H} \cap F\): \((H \cap F)^{\prime} \cap W=\{\text { duck, deer, frog, mouse }\}\).

    Sometimes it is useful to represent set operations using Venn diagrams when the elements of the sets are unknown or the number of elements in the sets is too large. Basic Venn diagrams can illustrate the interaction among two or three sets.

    Example 7

    Use Venn diagrams to illustrate \(A \cup B, A \cap B,\) and \(A^{\prime} \cap B\).

    \(A \cup B\) contains all elements in either set (or both.)

    A Venn diagram showing the area where the two circles representing sets A and B are joined together.

     

     

     

     

     

     

     

    \(A \cap B\) contains only those elements in both sets - in the overlap of the circles.

    A Venn diagram showing the area where circles representing sets A and B overlap.

    \(A^{\prime} \cap B\) contains those elements that are not in set \(A\) but are in set \(B\).

    A Venn diagram showing the part of the circle left once the part of the circle that also represents set A is removed.

     

     

     

     

     

     

     

     

    Example 8

    Use a Venn diagram to illustrate \((H \cap F)^{\prime} \cap W\).

    Solution

    We'll start by identifying everything in the set \(H \cap F\).

    Three set Venn diagram showing area representing elements in set H and set F

    Now, \((H \cap F)^{\prime} \cap W\) will contain everything not in the region shown above but that is in set \(W\).

    Three set Venn diagram showing area representing elements in set W but not in both set H and F

    Example 9

    Write an expression to represent the outlined part of the Venn diagram shown.

    Solution

    The elements in the outlined set are in sets \(H\) and \(F\), but are not in set \(W\). So we could represent this set as \((H \cap F )\cap W^{\prime}\).

    Three set Venn diagram showing area representing elements in set H and in set F but not set W

     

    Try it Now 2

    Write an expression to represent the outlined portion of the Venn diagram shown:

    Three set Venn diagram showing area representing elements in set A or set B but not set C

    Answer

    \((A \cup B) \cap C^{\prime}\)


    This page titled 1.2: Operations with Sets is shared under a CC BY-SA license and was authored, remixed, and/or curated by David Lippman (The OpenTextBookStore) .

    • Was this article helpful?