Set Operations and Venn Diagrams
Solved Problems
Example 1.
Given \(A = \left\{ {2,3,4,5,6,7} \right\}\) and \(B = \left\{ {0,1,5,6} \right\}.\) List the elements of the following sets:
- \({A \cup B}\)
- \({A \cap B}\)
- \({A \backslash B}\)
- \({B \backslash A}\)
- \({A \,\triangle\, B}\)
Solution.
- By definition, the union of sets \({A \cup B}\) contains all elements which are either in set \(A\) or set \(B\) or in both \(A\) and \(B.\) Therefore, we can write
\[A \cup B = \left\{ {2,3,4,5,6,7} \right\} \cup \left\{ {0,1,5,6} \right\} = \left\{ {0,1,2,3,4,5,6,7} \right\}.\]
- The intersection of sets \({A \cap B}\) is defined as the set containing all elements of \(A\) that also belong to \(B.\) Using this definition, we obtain
\[A \cap B = \left\{ {2,3,4,5,6,7} \right\} \cup \left\{ {0,1,5,6} \right\} = \left\{ {5,6} \right\}.\]
- The set difference \({A \backslash B}\) contains only those elements of \(A\) that do not belong to \(B.\)
\[A\backslash B = \left\{ {2,3,4,5,6,7} \right\}\backslash \left\{ {0,1,5,6} \right\} = \left\{ {2,3,4,7} \right\}.\]
- This question is opposite of the previous one. The set difference \({B \backslash A}\) contains only those elements of \(B\) that do not belong to \(A.\)
\[B\backslash A = \left\{ {0,1,5,6} \right\}\backslash \left\{ {2,3,4,5,6,7} \right\} = \left\{ {0,1} \right\}.\]
- We compute the symmetric difference \({A \,\triangle\, B}\) by the formula \(A \,\triangle\, B = \left( {A\backslash B} \right) \cup \left( {B\backslash A} \right).\) This yields:
\[A \,\triangle\, B = \left( {A\backslash B} \right) \cup \left( {B\backslash A} \right) = \left\{ {2,3,4,7} \right\} \cup \left\{ {0,1} \right\} = \left\{ {0,1,2,3,4,7} \right\}.\]
Example 2.
Let the universal set be \(U = \{ x \in \mathbb{N} \mid x \le 10\}.\) Its subsets \(A\) and \(B\) are given by \(A = \{ x \mid x \text{ is even}\},\) \(B = \{ x \in \mathbb{N} \mid 5 \le x \lt 8\}.\) Find the following sets:
- \(A \cup {B^c}\)
- \({\left( {A \cap B} \right)^c}\)
- \({\left( {A\backslash B} \right)^c}\)
Solution.
- The complement of the set \(B\) is written as follows:
\[{B^c} = U\backslash B = \left\{ {1,2, \ldots ,10} \right\}\backslash \{ 5,6,7\} = \{ 1,2,3,4,8,9,10\}.\]The set \(A\) in roster form is expressed as \(A = \{ 2,4,6,8,10\},\) so the set union \(A \cup {B^c}\) is given by\[A \cup {B^c} = \{ 2,4,6,8,10\} \cup \{ 1,2,3,4,8,9,10\} = \left\{ {1,2,3,4,6,8,9,10} \right\}.\]
- First we determine the set intersection \({A \cap B}:\)
\[A \cap B = \{ 2,4,6,8,10\} \cap \{ 5,6,7\} = \left\{ 6 \right\}.\]Now we compute the complement \({\left( {A \cap B} \right)^c}:\)\[{\left( {A \cap B} \right)^c} = U\backslash \left( {A \cap B} \right) = \left\{ {1,2, \ldots ,10} \right\}\backslash \left\{ 6 \right\} = \left\{ {1,2,3,4,5,7,8,9,10} \right\}.\]
- Find the set difference \({A\backslash B}\) in roster form:
\[A\backslash B = \{ 2,4,6,8,10\} \backslash \{ 5,6,7\} = \left\{ {2,4,8,10} \right\}.\]Hence, the complement \({\left( {A\backslash B} \right)^c}\) is given by\[{\left( {A\backslash B} \right)^c} = U\backslash \left( {A\backslash B} \right) = \left\{ {1,2, \ldots ,10} \right\}\backslash \left\{ {2,4,8,10} \right\} = \left\{ {1,3,5,6,7,9} \right\}.\]
Example 3.
Find the elements of the sets \(A\) and \(B\) if \(A \backslash B = \left\{ {1,2,7,8} \right\},\) \(B \backslash A = \left\{ {3,4,9} \right\}\) and \(A \cap B = \left\{ {0,5,6} \right\}.\)
Solution.
We can express the set \(A\) as follows:
Compute the elements of the set \(A:\)
Similarly, we determine the elements of the set \(B:\)
Example 4.
Find the elements of the sets \(A\) and \(B\) if \(A \backslash B = \left\{ {a,b,d} \right\},\) \(A \cap B = \left\{ {c,e} \right\}\) and \(A \cup B = \left\{ {a,b,c,d,e,g} \right\}.\)
Solution.
We can find the set \(A\) as follows:
The set \(B\) is given by
Example 5.
Let \(A, B,\) and \(C\) be sets. Draw the Venn diagram for \(A \cap \left( {B \backslash C} \right).\)
Solution.
The region \(A \cap \left( {B\backslash C} \right)\) is colored with orange.
Example 6.
Let \(A, B,\) and \(C\) be sets. Draw the Venn diagram for \(\left( {A \cap {B^c}} \right) \cup \left( {A \cap {C^c}} \right).\)
Solution.
The region \(\left( {A \cap {B^c}} \right) \cup \left( {A \cap {C^c}} \right)\) is colored with orange.
Example 7.
In a high school, \(100\) students are surveyed and asked which of the foreign languages they learn. \(45\) students learn Spanish, \(28\) learn French, and \(22\) learn Chinese. \(12\) students learn Spanish and French, \(8\) learn Spanish and Chinese, and \(10\) learn French and Chinese. \(30\) students learn no language. How many students learn three languages?
Solution.
We denote the set of students learning Spanish by \(S\), the set of students learning French - by \(F,\) and the set of students learning Chinese - by \(C.\)
Let \(x\) be the number of students learning the \(3\) languages simultaneously. Draw the Venn diagram and express in terms of \(x\) the number of students in all regions.
As the number of students learning Spanish and French is \(12,\) the intersection between the sets \(S\) and \(F\) is represented in the form \(12 = x + \left( {12 - x} \right).\)
Similarly, since \(8\) students learn Spanish and Chinese, we represent the intersection between the two sets as \(8 = x + \left( {8 - x} \right).\)
The last pair of French and Chinese is given by \(10 = x + \left( {10 - x} \right).\)
Recall that the total number of students learning Spanish is \(45.\) Using the Venn diagram, we find that the remaining portion of the green circle \(S\) contains the number of students equal to
Similarly, we can calculate the remaining portion of the blue circle \(F:\)
For the purple circle \(C\) we have
Now all the partitions are expressed in terms of \(x,\) so we can write the following equation:
Solving it for \(x,\) we find the number of students learning all \(3\) languages:
Example 8.
Let \(S\) be a finite set of natural numbers. It is known that there are \(80\) numbers among them multiple of \(2,\) \(95\) numbers multiple of \(3,\) \(70\) numbers multiple of \(5,\) \(30\) numbers multiple of \(6,\) \(33\) numbers multiple of \(10,\) \(25\) numbers multiple of \(15,\) and \(13\) numbers multiple of \(30.\) Find the cardinality of the set \(S.\)
Solution.
We denote the subsets of numbers multiple of \(2,\) \(3,\) and \(5\), respectively by \(A,\) \(B,\) and \(C.\) By condition,
If a number is multiple of \(6,\) this means it is divisible by \(2\) and \(3.\) So such numbers belong to the intersection of the subsets \(A\) and \(B,\) and we can write
Similarly, we have
Finally, if a number is multiple of \(30,\) this means it is divisible by \(2,\) \(3,\) and \(5.\) Here we have the intersection of three subsets:
The cardinality of the union of three sets is given by the formula
By substituting the known values, we get