Chapter 5 Sets
5.4 Set Operations with Two Sets
Learning Objectives
By the end of this section, you will be able to:
- Determine the intersection of two sets
- Determine the union of two sets
- Determine the cardinality of the union of two sets
- Apply the concepts of AND and OR to set operations
- Draw conclusions from Venn diagrams with two sets
The movie Yours, Mine, and Ours was originally released in 1968 and starred Lucille Ball and Henry Fonda. This movie, which is loosely based on a true story, is about the marriage of Helen, a widow with eight children, and Frank, a widower with ten children, who then have an additional child together. The movie is a comedy that plays on the interpersonal and organizational struggles of feeding, bathing, and clothing twenty-one people in one household.
If we consider the set of Helen’s children and the set of Frank’s children, then the child they had together is the intersection of these two sets, and the collection of all their children combined is the union of these two sets. In this section, we will explore the operations of union and intersection as they relate to two sets.
The Intersection of Two Sets
The members that the two sets share in common are included in the intersection of two sets. To be in the intersection of two sets, an element must be in both the first set and the second set. In this way, the intersection of two sets is a logical AND statement. Symbolically, [latex]A[/latex] intersection [latex]B[/latex] is written as [latex]A\cap B[/latex]. [latex]A[/latex] intersection [latex]B[/latex] is written in set builder notation as [latex]A\cap B=\{x|x\in A \text{ and } x\in B\}.[/latex]
Let us look at Helen’s and Frank’s children from the movie Yours, Mine, and Ours. Helen’s children consist of the set
[latex]\textit {H }\text{={Colleen, Nick, Janette, Tommy, Jean, Phillip, Gerald, Theresa, Joseph}}[/latex]
and Frank’s children are included in the set
[latex]\textit {F }\text{={Mike, Rusty, Greg, Rosemary, Loise, Susan, Veronica, Mary, Germaine, Joan, Joseph}}[/latex].
[latex]H[/latex] intersection [latex]F[/latex] is the set of children they had together.
[latex]H\cap F = \text{{Joseph}}[/latex], because Joseph is in both set [latex]A[/latex] and set [latex]B[/latex].
Example 1
Finding the Intersection of Set [latex]A[/latex] and Set [latex]B[/latex]
Set [latex]A=\{1, 3, 5, 7, 9\}[/latex]and set [latex]B=\{3, 5, 7\}[/latex] Find [latex]A \cap B[/latex].
The intersection of sets [latex]A[/latex] and [latex]B[/latex] include the elements that set [latex]A[/latex] and [latex]B[/latex] have in common: [latex]3, 5,[/latex] and [latex]7[/latex].
[latex]A\cap B =\{3, 5, 7\}[/latex]
Exercise 1
Set [latex]A=\{m, a, r, d, i\}[/latex] and set [latex]B=\{g, r, a, s\}[/latex]. Find [latex]A\cap B[/latex].
Solution
[latex]A\cap B=\{a, r\}[/latex]
Notice that if sets [latex]A[/latex] and [latex]B[/latex] are disjoint sets, then they do not share any elements in common, and [latex]A[/latex] intersection [latex]B[/latex] is the empty set, as shown in the Venn diagram below.
Example 2
Set [latex]A=\{0, 2, 4, 6, 8\}[/latex] and set [latex]B=\{1, 3, 5, 7, 9\}[/latex]. Find [latex]A \cap B[/latex].
Because sets [latex]A[/latex] and [latex]B[/latex] are disjoint, they do not share any elements in common. So the intersection of set [latex]A[/latex] and set [latex]B[/latex] is the empty set. [latex]A \cap B = \emptyset[/latex]
Exercise 2
Set [latex]A=\text {{red, yellow, blue}}[/latex] and set [latex]B=\text{{purple, green, gold}}[/latex]. Find [latex]A\cap B[/latex].
Solution
[latex]A\cap B=\{ \text{ }\}[/latex]
Notice that if set [latex]A[/latex] is a subset of set [latex]B[/latex], then [latex]A[/latex] intersection [latex]B[/latex] is equal to set [latex]A[/latex], as shown in the Venn diagram below.
Example 3
Set [latex]A=\{1, 3, 5...\}[/latex] and set [latex]B=\mathbb{N} =\{1, 2, 3....\}[/latex]. Find [latex]A\cap B[/latex].
Because set [latex]A[/latex] is a subset of set [latex]B[/latex], [latex]A[/latex] intersection [latex]B[/latex] is equal to set [latex]A[/latex].
[latex]A\cap B=A=\{1, 3, 5, ....\}[/latex], the set of odd natural numbers.
Exercise 3
Set [latex]A=\{a, b, c, ..., z\}[/latex] and set [latex]B=\{a, e, i, o, u\}[/latex]. Find [latex]A \cap B[/latex].
Solution
[latex]A\cap B=B=\{a, e, i, o, u\}[/latex]
The Union of Two Sets
Like the union of two families in marriage, the union of two sets includes all the members of the first set and all the members of the second set. To be in the union of two sets, an element must be in the first set, the second set, or both. In this way, the union of two sets is a logical inclusive OR statement. Symbolically, [latex]A[/latex] union [latex]B[/latex] is written as [latex]A \cup B[/latex]. [latex]A[/latex] union [latex]B[/latex] is written in set builder notation as [latex]A\cup B=\{x|x \in A \text{ or } x \in B\}[/latex].
Let us consider the sets of Helen’s and Frank’s children from the movie Yours, Mine, and Ours again. Helen’s children consist of the set [latex]\textit{H }\text{={Colleen, Nick, Janette, Tommy, Jean, Phillip, Gerald, Theresa, Joseph}}[/latex]
and Frank’s children are included in the set [latex]\textit {F }\text{={Mike, Rusty, Greg, Rosemary, Loise, Susan, Veronica, Mary, Germaine, Joan, Joseph}}[/latex]
The union of these two sets is the collection of all nineteen of their children,
[latex]H\cup F = \text{{Colleen, Nick, Janette, Tommy, Jean, Phillip, Gerald, Theresa, Joseph, Mike, Rusty, Greg, Rosemary, Loise, Susan, Veronica, Mary, Germaine, Joan }}[/latex]
Notice, Joseph is in both set [latex]H[/latex] and set [latex]F[/latex], but he is only one child, so he is only listed once in the union.
Example 4
Set [latex]A=\{1, 3, 5, 7, 9\}[/latex] and set [latex]B=\{2, 3, 5, 7\}[/latex]. Find [latex]A \cup B[/latex].
[latex]A[/latex] union [latex]B[/latex] is the set formed by including all the unique elements in set [latex]A[/latex], set [latex]B[/latex], or both sets [latex]A[/latex] and [latex]B[/latex]: [latex]A \cup B=\{1, 3, 5, 7, 9, 2\}[/latex].
The first five elements of the union are the five unique elements in set [latex]A[/latex]. Even though [latex]3, 5,[/latex] and [latex]7[/latex] are also members of set [latex]B[/latex], these elements are only listed one time. Lastly, set [latex]B[/latex] includes the unique element [latex]2[/latex], so [latex]2[/latex] is also included as part of the union of sets [latex]A[/latex] and [latex]B[/latex].
Exercise 4
Set [latex]A=\{m, a, r, d, i\}[/latex] and set [latex]B=\{g, r, a, s\}[/latex]. Find [latex]A\cup B[/latex].
Solution
[latex]A\cup B=\{a, d, g, i, m, r, s\}[/latex]
When observing the union of sets [latex]A[/latex] and [latex]B[/latex], notice that both set [latex]A[/latex] and set [latex]B[/latex] are subsets of [latex]A[/latex] union [latex]B[/latex]. Graphically, [latex]A[/latex] union [latex]B[/latex] can be represented in several different ways depending on the members that they have in common. If [latex]A[/latex] and [latex]B[/latex] are disjoint sets, then [latex]A[/latex] union [latex]B[/latex] would be represented with two disjoint circles within the universal set, as shown in the Venn diagram below.
If sets [latex]A[/latex] and [latex]B[/latex] share some but not all members in common, then the Venn diagram is drawn as two separate circles that overlap.
If every member of set [latex]A[/latex] is also a member of set [latex]B[/latex], then [latex]A[/latex] is a subset of set [latex]B[/latex], and [latex]A[/latex] union [latex]B[/latex] would be equal to set [latex]B[/latex]. To draw the Venn diagram, the circle representing set [latex]A[/latex] should be completely enclosed in the circle containing set [latex]B[/latex].
Example 5
Set [latex]A=\{0, 2, 4, 6, 8\}[/latex] and set [latex]B=\{1, 3, 5, 7, 9\}[/latex]. Find [latex]A \cup B[/latex].
Because sets [latex]A[/latex] and [latex]B[/latex] are disjoint, the union is simply the set containing all the elements in both set [latex]A[/latex] and set [latex]B[/latex].
[latex]A \cup B=\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\}[/latex].
Exercise 5
Set [latex]A=\text {{red, yellow, blue}}[/latex] and set [latex]B=\text{{purple, green, gold}}[/latex]. Find [latex]A\cup B[/latex].
Solution
[latex]A\cup B=\text{{red, yellow, blue, purple, green, gold}}[/latex]
Example 6
Set [latex]A=\{1, 3, 5,...\}[/latex] and set [latex]B=\mathbb{N} =\{1, 2, 3....\}[/latex]. Find [latex]A\cup B[/latex].
Because set [latex]A[/latex] is a subset of set [latex]B[/latex], [latex]A[/latex] union [latex]B[/latex] is equal to set [latex]B[/latex].
[latex]A\cup B=\mathbb{N} =\{1, 2, 3....\}=B[/latex]
Exercise 6
Set [latex]A=\{a, b, c, ..., z\}[/latex] and set [latex]B=\{a, e, i, o, u\}[/latex]. Find [latex]A \cup B[/latex].
Solution
[latex]A\cup B=\{a, b, c,...,z\}=A[/latex]
Determining the Cardinality of Two Sets
The cardinality of the union of two sets is the total number of elements in the union of the two sets. Symbolically, the cardinality of [latex]A[/latex] union [latex]B[/latex] is written [latex]n(A \cup B)[/latex]. If two sets [latex]A[/latex] and [latex]B[/latex] are disjoint, the cardinality of [latex]A[/latex] union [latex]B[/latex] is the sum of the cardinality of set [latex]A[/latex] and the cardinality of set [latex]B[/latex]. If the two sets intersect, then [latex]A[/latex] intersection [latex]B[/latex] is a subset of both set [latex]A[/latex] and set [latex]B[/latex]. This means that if we add the cardinality of set [latex]A[/latex] and set [latex]B[/latex], we will have added the number of elements in [latex]A[/latex] intersection [latex]B[/latex] twice, so we must then subtract it once as shown in the formula that follows.
The cardinality of [latex]A[/latex] union [latex]B[/latex] is found by adding the number of elements in set [latex]A[/latex] to the number of elements in set [latex]B[/latex], then subtracting the number of elements in the intersection of set [latex]A[/latex] and set [latex]B[/latex].
[latex]n(A \cup B)=n(A)+n(B)-n(A \cap B)[/latex]
or
[latex]n(A \text{ or } B)=n(A)+n(B)-n(A \text{ and } B)[/latex].
If sets [latex]A[/latex] and [latex]B[/latex] are disjoint, then [latex]n(A \cap B)=n(A\text{ and }B) =0[/latex] and the formula is still valid but simplifies to [latex]n(A\cup B)=n(A)+n(B).[/latex]
Example 7
The number of elements in set [latex]A[/latex] is 10, the number of elements in set [latex]B[/latex] is 20, and the number of elements in [latex]A[/latex] intersection [latex]B[/latex] is 4. Find the number of elements in [latex]A[/latex] union [latex]B[/latex].
Using the formula for determining the cardinality of the union of two sets, we can say [latex]n(A \cup B)=n(A)+n(B)-n(A \cap B)=10+20-4=26[/latex]
Exercise 7
If [latex]n(A)=23, n(B)=17[/latex], and [latex]n(A \cap B)=7,[/latex] then find [latex]n(A \cup B).[/latex]
Solution
[latex]33[/latex]
Example 8
If [latex]A[/latex] and [latex]B[/latex] are disjoint sets and the cardinality of set [latex]A[/latex] is 37 and the cardinality of set [latex]B[/latex] is 43, find the cardinality of [latex]A[/latex] union [latex]B[/latex].
To find the cardinality of [latex]A[/latex] union [latex]B[/latex], apply the formula [latex]n(A \cup B)=n(A)+n(B)-n(A \cap B)[/latex].
Because sets [latex]A[/latex] and [latex]B[/latex] are disjoint, [latex]A \cap B[/latex] is the empty set; therefore, [latex]n(A \cap B)=n(\emptyset )=0[/latex] and [latex]n(A \cup B)=37+43-0=80[/latex].
Exercise 8
If [latex]A \cap B = \emptyset, n(A)=35,[/latex] and [latex]n(B)=78,[/latex] then find [latex]n(A \cup B).[/latex]
Solution
[latex]113[/latex]
Applying Concepts of “AND” and “OR” to Set Operations
To become a licensed driver, you must pass some form of written test and a road test, along with several other requirements depending on your age. To keep this example simple, let us focus on the road test and the written test. If you pass the written test but fail the road test, you will not receive your license. If you fail the written test, you will not be allowed to take the road test, and you will not receive a license to drive. To receive a driver’s license, you must pass the written test AND the road test.
For an “AND” statement to be true, both conditions that make up the statement must be true. Similarly, the intersection of two sets [latex]A[/latex] and [latex]B[/latex] is the set of elements that are in both set [latex]A[/latex] and set [latex]B[/latex]. To be a member of [latex]A[/latex] intersection [latex]B[/latex], an element must be in set [latex]A[/latex] and also must be in set [latex]B[/latex]. The intersection of two sets corresponds to a logical “AND” statement.
The union of two sets is a logical inclusive “OR” statement. Say you are at a birthday party and the host offers Leah, Lenny, Maya, and you some cake or ice cream for dessert. Leah asks for cake, Lenny accepts both cake and ice cream, Maya turns down both, and you choose only ice cream. Leah, Lenny, and you are all having dessert.
The “OR” statement is true if at least one of the components is true. Maya is the only one who did not have cake or ice cream; therefore, she did not have dessert, and the “OR” statement is false. To be in the union of two sets [latex]A[/latex] and [latex]B[/latex], an element must be in set [latex]A[/latex] or set [latex]B[/latex] or both set [latex]A[/latex] and set [latex]B[/latex].
Example 9
[latex]A=\{0, 3, 6, 9, 12\}, B=\{0, 4, 8, 12, 16\},[/latex] and [latex]C=\{1, 2, 3, 5, 8, 13\}.[/latex]
Find the set consisting of elements in:
a) [latex]A[/latex] and [latex]B[/latex]
[latex]A \text{ and } B=A \cap B =\{0, 12\}[/latex], because only the elements [latex]0[/latex] and [latex]12[/latex] are members of both set [latex]A[/latex] and set [latex]B[/latex].
b) [latex]A[/latex] or [latex]B[/latex]
[latex]A \text{ or }B=A \cup B=\{0, 3, 4, 6, 8, 9, 12, 16\}[/latex], because the set [latex]A[/latex] or [latex]B[/latex] is the collection of all elements in set [latex]A[/latex] or set [latex]B[/latex] or both.
c) [latex]A[/latex] or [latex]C[/latex]
[latex]A \text{ or } C=A\cup C=\{0, 1, 2, 3, 5, 6, 8, 9, 12, 13\}[/latex] because the set [latex]A[/latex] or [latex]C[/latex] is the collection of all elements in set [latex]A[/latex] or set [latex]C[/latex] or both.
d) [latex](B \text{ and } C)[/latex] or [latex]A[/latex].
[latex](B \text{ and }C )\text{ or } A=(B\cap C)\cup A[/latex]. Parentheses are evaluated first: the only member that both set [latex]B[/latex] and set [latex]C[/latex] share in common is [latex]8[/latex]. So now we need to find [latex]\{8\}[/latex] or [latex]\{0, 3, 6, 9, 12\}[/latex], Because the word “or” translates to the union operation, the problem becomes [latex]\{8\} \cup \{0, 3, 6, 9, 12\}[/latex], which is equal to [latex]\{0, 3, 6, 8, 9, 12\}[/latex].
Exercise 9
[latex]A=\{h, a, p, y\}[/latex] and [latex]B=\{a, w, e, s, o, m\}[/latex], and [latex]C=\{m, a, t, h\}[/latex].
Find the set consisting of elements in:
a) [latex]A[/latex] or [latex]B[/latex]
b) [latex]A[/latex] and [latex]C[/latex]
c) [latex]B[/latex] or [latex]C[/latex]
d) [latex](A \text{ and } C) \text{ and } B[/latex].
Solution
a) [latex]A \text { or } B=A\cup B = \{h, a, p, y, w, e, s, o, m\}[/latex].
b) [latex]A \text{ and } C=A \cap C=\{a, h\}.[/latex]
c) [latex]B \text { or }C=B\cup C=\{a, w, e, s, o, m, t, h\}.[/latex]
d) [latex](A \text{ and }C) \text{ and }B=(A \cap C)\cap B=\{a, h\} \cap \{a, w, e, s, o, m\}=\{a\}[/latex].
Example 10
Determine and apply the appropriate set operations to solve the problem.
Don Woods is serving cake and ice cream at his Juneteenth celebration. The party has a total of [latex]54[/latex] guests in attendance. Suppose [latex]30[/latex] guests requested cake, [latex]20[/latex] guests asked for ice cream, and [latex]12[/latex] guests did not have either cake or ice cream.
a) How many guests had cake or ice cream?
The total number of people at the party is [latex]54[/latex], and [latex]12[/latex] people did not have cake or ice cream. Recall that the total number of elements in the universal set is always equal to the number of elements in a subset plus the number of elements in the complement of the set, [latex]n(U)=n(A)+n(A')[/latex].
That means [latex]54=n(\text {cake or ice cream})+n(\text{not(cake or ice cream)})[/latex],
or equivalently, [latex]n(\text{cake} \cup \text{ice cream})=54-n(\text{(cake} \cup \text{ice cream)'})=54-12=42[/latex].
A total of [latex]42[/latex] people at the party had cake or ice cream.
b) How many guests had cake and ice cream?
To determine the number of people who had both cake and ice cream, we need to find the intersection of the set of people who had cake and the set of people who had ice cream. From Question 1, the number of people who had cake or ice cream is [latex]42[/latex]. This is the union of the two sets. The formula for the union of two sets is [latex]n(A \cup B)=n(A)+n(B) -n(A \cap B)[/latex].
Use the information given in the problem and substitute the known values into the formula to solve for the number of people in the intersection: [latex]42=30+20-n(A \cap B)[/latex].
Adding 30 and 20, the equation simplifies to [latex]42=50-n(\text{cake and ice cream})[/latex].
Which means [latex]n(\text{ cake and ice cream })=50-42=8[/latex].
Exercise 10
Ravi and Priya are serving shrimp bisque and salad along with the main course at their wedding reception. The reception will have a total of [latex]150[/latex] guests in attendance. A total of [latex]92[/latex] shrimp bisques and [latex]85[/latex] salads were ordered, while [latex]23[/latex] guests did not order any shrimp bisque or salad.
a) How many guests had shrimp bisque or salad or both?
b) How many guests had both shrimp bisque and a salad?
Solution
a) [latex]127[/latex]
b) [latex]50[/latex]
Drawing Conclusions from a Venn Diagram with Two Sets
All Venn diagrams will display the relationships between the sets, such as subset, intersecting, and/or disjoint. In addition to displaying the relationship between the two sets, there are two main additional details that Venn diagrams can include: the individual members of the sets or the cardinality of each disjoint subset of the universal set.
A Venn diagram with two subsets will partition the universal set into 3 or 4 sections depending on whether they are disjoint or intersecting sets. Recall that the complement of set [latex]A[/latex], written [latex]A'[/latex] is the set of all elements in the universal set that are not in set [latex]A[/latex].
Example 11
a) Find [latex]A \cup B[/latex].
[latex]A\cup B=\{1, 2, 3, 4, 5, 6, 7, 8\}[/latex], because [latex]A[/latex] union [latex]B[/latex] is the collection of all elements in set [latex]A[/latex] or set [latex]B[/latex] or both.
b) Find [latex]A \cap B[/latex].
Because [latex]A[/latex] and [latex]B[/latex] are disjoint sets, there are no elements that are in both [latex]A[/latex] and [latex]B[/latex]. Therefore, [latex]A[/latex] intersection [latex]B[/latex] is the empty set, [latex]\emptyset[/latex].
c) Find [latex]B'[/latex].
The complement of set [latex]B[/latex] is the set of all elements in the universal set that are not in set [latex]B[/latex]: [latex]B'=\{0, 1, 3, 5, 7, 9\}[/latex].
d) Find [latex]n(B')[/latex].
The cardinality, or number of elements, in set [latex]B'[/latex] is [latex]n(B')=6[/latex].
Exercise 11
a) Find [latex]A \cap B[/latex].
b) Find [latex]A \cup B[/latex].
c) Find [latex]A \cap B'[/latex].
d) Find [latex]n(A \cap B')[/latex].
Solution
a) [latex]A \cap B=\{3, 5, 7\}[/latex].
b) [latex]A \cup B=\{1, 2, 3, 5, 7, 9\}[/latex].
c) [latex]A \cap B'=\{1, 9\}[/latex].
d) [latex]n(A \cap B')=2[/latex].
Example 12
Using a Venn Diagram to Draw Conclusions about Set Cardinality
a) Find [latex]n(A \text{ or } B)[/latex].
The number of elements in [latex]A[/latex] or [latex]B[/latex] is the number of elements in [latex]A[/latex] union [latex]B[/latex]: [latex]n(A \cup B)=n(\{2, 5, 7\})=14[/latex].
b) Find [latex]n(A \text{ and } B)[/latex].
The number of elements in [latex]A[/latex] and [latex]B[/latex] is the number of elements in [latex]A[/latex] intersection [latex]B[/latex]: [latex]n(A \cap B)=5[/latex].
c) Find [latex]n(A)[/latex].
The number of elements in set [latex]A[/latex] is the sum of all the numbers enclosed in the circle representing set [latex]A[/latex]: [latex]n(A)=n(\{7, 5\})=12[/latex].
Exercise 12
a) Find [latex]n(A \text{ or } B)[/latex].
b) Find [latex]n(A \text{ and } B)[/latex].
c) Find [latex]n(A)[/latex].
Solution
a) [latex]40[/latex]
b) [latex]0[/latex]
c) [latex]23[/latex]
Media Attributions
- disjoint sets © Openstax is licensed under a CC BY (Attribution) license
- subsets © Openstax is licensed under a CC BY (Attribution) license
- intersection © Openstax is licensed under a CC BY (Attribution) license
- Side-by-side Venn diagrams with disjoint and intersecting sets, respectively. © OpenStax is licensed under a CC BY (Attribution) license
- Example 1.33 © OpenStax is licensed under a CC BY (Attribution) license
- Venn diagram with two intersecting sets and elements © OpenStax is licensed under a CC BY (Attribution) license
- Venn diagram with intersecting sets and number of elements in each section indicated © OpenStax is licensed under a CC BY (Attribution) license
- Venn diagram with two disjoint sets and number of elements in each section. © OpenStax is licensed under a CC BY (Attribution) license
The members that the two sets share in common
all the members of the first set and all the members of the second set.
the total number of elements in the union of the two sets