Calculus

Set Theory

Set Theory Logo

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:

  1. \({A \cup B}\)
  2. \({A \cap B}\)
  3. \({A \backslash B}\)
  4. \({B \backslash A}\)
  5. \({A \,\triangle\, B}\)

Solution.

  1. 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\}.\]
  2. 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\}.\]
  3. 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\}.\]
  4. 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\}.\]
  5. 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:

  1. \(A \cup {B^c}\)
  2. \({\left( {A \cap B} \right)^c}\)
  3. \({\left( {A\backslash B} \right)^c}\)

Solution.

  1. 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\}.\]
  2. 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\}.\]
  3. 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:

\[A = \left( {A\backslash B} \right) \cup \left( {A \cap B} \right).\]

Compute the elements of the set \(A:\)

\[A = \left( {A\backslash B} \right) \cup \left( {A \cap B} \right) = \left\{ {1,2,7,8} \right\} \cup \left\{ {0,5,6} \right\} = \left\{ {0,1,2,5,6,7,8} \right\}.\]

Similarly, we determine the elements of the set \(B:\)

\[B = \left( {B\backslash A} \right) \cup \left( {A \cap B} \right) = \left\{ {3,4,9} \right\} \cup \left\{ {0,5,6} \right\} = \left\{ {0,3,4,5,6,9} \right\}.\]

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:

\[A = \left( {A\backslash B} \right) \cup \left( {A \cap B} \right) = \left\{ {a,b,d} \right\} \cup \left\{ {c,e} \right\} = \left\{ {a,b,c,d,e} \right\}.\]

The set \(B\) is given by

\[B = \left( {A \cup B} \right)\backslash \left( {A\backslash B} \right) = \left\{ {a,b,c,d,e,g} \right\}\backslash \left\{ {a,b,d} \right\} = \left\{ {c,e,g} \right\}.\]

Example 5.

Let \(A, B,\) and \(C\) be sets. Draw the Venn diagram for \(A \cap \left( {B \backslash C} \right).\)

Solution.

Venn diagram illustrating the intersection and difference of 3 sets.
Figure 6.

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.

Venn diagram involving the intersection, union and complements of 3 sets.
Figure 7.

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.

Venn diagram illustrating the sets of students learning 3 languages.
Figure 8.

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

\[45 - \left[ {\left( {12 - x} \right) + x + \left( {8 - x} \right)} \right] = 25 + x.\]

Similarly, we can calculate the remaining portion of the blue circle \(F:\)

\[28 - \left[ {\left( {12 - x} \right) + x + \left( {10 - x} \right)} \right] = 6 + x.\]

For the purple circle \(C\) we have

\[22 - \left[ {\left( {8 - x} \right) + x + \left( {10 - x} \right)} \right] = 4 + x.\]

Now all the partitions are expressed in terms of \(x,\) so we can write the following equation:

\[30 + \left( {4 + x} \right) + \left( {25 + x} \right) + \left( {6 + x} \right) + \left( {12 - x} \right) + \left( {8 - x} \right) + \left( {10 - x} \right) + x = 100.\]

Solving it for \(x,\) we find the number of students learning all \(3\) languages:

\[\require{cancel}{30 + 4 + \cancel{x} + 25 + \cancel{x} + 6 + \cancel{x} + 12 \cancel{- x} + 8 \cancel{- x} + 10 \cancel{- }x + x + 100,}\]
\[ \Rightarrow {95 + x = 100,}\;\; \Rightarrow {x = 5.}\]

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,

\[\left| A \right| = 80,\;\;\left| B \right| = 95,\;\;\left| C \right| = 70.\]

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

\[\left| {A \cap B} \right| = 30.\]

Similarly, we have

\[\left| {A \cap C} \right| = 33,\;\;\left| {B \cap C} \right| = 25.\]

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:

\[\left| {A \cap B \cap C} \right| = 13.\]

The cardinality of the union of three sets is given by the formula

\[\left| {A \cup B \cup C} \right| = \left| A \right| + \left| B \right| + \left| C \right| - \left| {A \cap B} \right| - \left| {A \cap C} \right| - \left| {B \cap C} \right| + \left| {A \cap B \cap C} \right|.\]

By substituting the known values, we get

\[\left| {A \cup B \cup C} \right| = 80 + 95 + 70 - \hspace{0pt}30 - 33 - 25 + 13 = 170.\]
Page 1 Page 2