1.2: Operations with Sets
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 18 th century. These illustrations now called Venn Diagrams .
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.
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.
- If we were searching for books, the universal set might be all the books in the library.
- If we were grouping your Facebook friends, the universal set would be all your Facebook friends.
- 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.
The complement of a set contains everything that is not in the set but still within the universal set.
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\).
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.
The union of two sets contains all the elements contained in either (or both) 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.
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\).
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 }\}\)
- Find \(A \cup B\).
- Find \(A \cap B\).
- Find \(A^{\prime}\).
Solution
- 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.
- The intersection contains all the elements in both sets:
\(A \cap B=\{\text { c, a }\}\).
- 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.
Consider the sets:
\(\quad A=\{\text { red, green, blue }\} \quad B=\{\text { red, yellow, orange }\} \quad C=\{\text { red, orange, yellow, green, blue, purple }\}\)
- Find \(A \cup B\).
- Find \(A \cap B\).
- Find \(A^{\prime} \cap C\).
Solution
- The union contains all the elements in either set:
\(A \cup B=\{\text { red, green, blue, yellow, orange }\}\).
- The intersection contains all the elements in both sets:
\(A \cap B=\{\text { red }\}\).
- 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:
- First, perform any operation within parentheses, ( ).
- Then, find the complement.
- Next, perform the union \(\cup\) and the intersection \(\cap\) in order from left to right.
Suppose
\(U=\{\text { 1, 2, 3, 4, 5, 6, 7, 8 }\} \quad A=\{\text { 2, 4, 7 }\} \quad B=\{\text { 1, 2, 3, 8 }\}\)
- Find \((A \cup B)^{\prime}\).
- Find \(A^{\prime} \cup B^{\prime}\).
Solution
- 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 }\}\).
- 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 }\}\).
Suppose
\(H=\{\text { cat, dog, rabbit, mouse }\} \quad F=\{\text { dog, cow, duck, pig, rabbit }\} \quad W=\{\text { duck, rabbit, deer, frog, mouse }\}\)
- Find \((H \cap F) \cup W\)
- Find \(H \cap(F \cup W)\)
- Find \((H \cap F)^{\prime} \cap W\)
Solution
- 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 }\}\).
- 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 }\}\).
- 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.
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 \cap B\) contains only those elements in both sets - in the overlap of the circles.
\(A^{\prime} \cap B\) contains those elements that are not in set \(A\) but are in set \(B\).
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\).
Now, \((H \cap F)^{\prime} \cap W\) will contain everything not in the region shown above but that is in set \(W\).
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}\).
Try it Now 2
Write an expression to represent the outlined portion of the Venn diagram shown:
- Answer
-
\((A \cup B) \cap C^{\prime}\)