Set notation, operations and Venn diagrams
In a class of 30 students, 20 are in the choir and 15 are in the school band. Can every student be in only one of the two groups? If not, what is the smallest number who must be in both? Sets and Venn diagrams are the tools for sorting out questions like this.
Sets and their notation
A set is a collection of objects, called elements (or members). The elements go inside curly brackets, separated by commas.
$$A = \{2, 3, 5, 7, 11\}$$Order does not matter and an element is not listed twice. Sets are usually named with capital letters.
The universal set $U$ is the set of everything we are talking about in a problem. Every other set in the problem lives inside $U$.
| Symbol | Meaning | Example |
|---|---|---|
| $\in$ | is an element of | $3 \in A$ |
| $\notin$ | is not an element of | $4 \notin A$ |
| $\#A$ | number of elements in $A$ | $\#A = 5$ |
| $\subset$ | is a subset of | $\{2, 3\} \subset A$ |
| $\{\ \}$ | the empty set (no elements) | $\#\{\ \} = 0$ |
A set can also be described by a rule. For example, $B = \{x \in \mathbb{N} : 1 \le x \le 6\}$ means "$x$ is a natural number with $1 \le x \le 6$", so $B = \{1, 2, 3, 4, 5, 6\}$. Read the colon as "such that".
Using the sets from the universal set $U = \{a, b, c, d, e, f, g, h\}$, with $P = \{a, b, c, d\}$ and $Q = \{c, d, e\}$: a) Find $\#P$ and $\#Q$. b) Is…
Using the sets from the universal set $U = \{a, b, c, d, e, f, g, h\}$, with $P = \{a, b, c, d\}$ and $Q = \{c, d, e\}$:
- a) Find $\#P$ and $\#Q$.
- b) Is $\{c, d\} \subset P$? Is $e \in P$? Write your answers using correct notation.
- c) Draw a Venn diagram showing $P$ and $Q$ with all the elements placed.
Union, intersection, difference and complement
Four operations combine sets. Take $U = \{1, 2, \dots, 12\}$, $A = \{2, 3, 5, 7, 11\}$ (the primes) and $B = \{3, 6, 9, 12\}$ (the multiples of 3).
| Operation | Symbol | Meaning | Result |
|---|---|---|---|
| Union | $A \cup B$ | in $A$ or $B$ (or both) | $\{2, 3, 5, 6, 7, 9, 11, 12\}$ |
| Intersection | $A \cap B$ | in $A$ and $B$ | $\{3\}$ |
| Difference | $A \setminus B$ | in $A$ but not in $B$ | $\{2, 5, 7, 11\}$ |
| Complement | $A'$ | in $U$ but not in $A$ | $\{1, 4, 6, 8, 9, 10, 12\}$ |
Why does $A \cup B$ list 3 only once? Because a set never repeats an element.
(Answer to the last step: $A \setminus B = \{2, 5, 7, 11\}$ and $B \setminus A = \{6, 9, 12\}$. They are different, so the order matters.)
Let $U = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$, $A = \{2, 4, 6, 8, 10\}$ and $B = \{1, 2, 3, 4, 5\}$. List the elements of: a) $A \cup B$ b) $A \cap B$ c) $A \setminus B$…
Let $U = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$, $A = \{2, 4, 6, 8, 10\}$ and $B = \{1, 2, 3, 4, 5\}$. List the elements of:
- a) $A \cup B$
- b) $A \cap B$
- c) $A \setminus B$
- d) $A'$
Venn diagrams with two sets
A Venn diagram draws $U$ as a rectangle and each set as a circle. Where circles overlap we have the intersection. Two overlapping circles split $U$ into four regions.
To fill in a diagram from numbers, start in the middle (the intersection) and work outwards:
-
Put the number in $A \cap B$ in the overlap.
-
Subtract it from $\#A$ to get "A only", and from $\#B$ to get "B only".
-
Put "neither" in $U$ outside both circles, found by subtracting the others from $\#U$.
This works because every element of $U$ lies in exactly one region, so the four numbers add up to $\#U$.
For the union, we count the overlap twice if we simply add, so we take it off once:
$$\#(A \cup B) = \#A + \#B - \#(A \cap B)$$(Answer: $\frac{10}{40} = \frac{1}{4}$.) In general, for a Venn diagram with numbers,
$$P(\text{event}) = \frac{\text{number of elements in the event's region(s)}}{\#U}$$In a class of 28 students, 15 play Gaelic football, 10 play camogie and 4 play both. a) Draw a Venn diagram showing this information. b) How many students play neither…
In a class of 28 students, 15 play Gaelic football, 10 play camogie and 4 play both.
- a) Draw a Venn diagram showing this information.
- b) How many students play neither sport?
In a survey of 60 people in Limerick, 35 said they like tea, 28 like coffee and 9 like neither. a) Find how many like both tea and coffee. b) Draw a Venn diagram. c)…
In a survey of 60 people in Limerick, 35 said they like tea, 28 like coffee and 9 like neither.
- a) Find how many like both tea and coffee.
- b) Draw a Venn diagram.
- c) Find the probability that a person chosen at random likes tea only.
Given $\#U = 40$, $\#A = 18$, $\#B = 22$ and $\#(A \cap B) = 7$: a) Find $\#(A \cup B)$. b) Find $\#(A \cup B)'$. c) Find $\#(A \setminus B)$ and $\#(B \setminus A)$.
Given $\#U = 40$, $\#A = 18$, $\#B = 22$ and $\#(A \cap B) = 7$:
- a) Find $\#(A \cup B)$.
- b) Find $\#(A \cup B)'$.
- c) Find $\#(A \setminus B)$ and $\#(B \setminus A)$.
Venn diagrams with three sets
Three overlapping circles give eight regions: three "only" regions, three regions where exactly two circles overlap, the centre where all three overlap, and the outside.
Always fill in the centre $A \cap B \cap C$ first. Then do the regions where exactly two sets overlap, subtracting the centre. Then the "only" regions. Finally find the outside from $\#U$.
(Answer: $5 + 4 + 3 = 12$.)
When a three-set problem gives a rule for each set (for example "multiples of 3"), list the elements of each set first. Then place each element of $U$ one at a time, starting with those that belong to the most sets, and cross each one off as you go. Every element of $U$ must appear exactly once.
$U = \{x \in \mathbb{N} : 1 \le x \le 20\}$, $A$ is the set of multiples of 3, $B$ is the set of even numbers and $C$ is the set of prime numbers. a) List the elements…
$U = \{x \in \mathbb{N} : 1 \le x \le 20\}$, $A$ is the set of multiples of 3, $B$ is the set of even numbers and $C$ is the set of prime numbers.
- a) List the elements of $A$, $B$ and $C$.
- b) Draw a three-set Venn diagram and place every element of $U$.
- c) List $(A \cup B) \cap C'$.
In a group of 100 students, 45 study French, 40 study German and 35 study Spanish. 15 study French and German, 12 study German and Spanish, 10 study French and Spanish,…
In a group of 100 students, 45 study French, 40 study German and 35 study Spanish. 15 study French and German, 12 study German and Spanish, 10 study French and Spanish, and 5 study all three.
- a) Draw a three-set Venn diagram showing the number in each region.
- b) How many study none of the three languages?
- c) A student is chosen at random. Find the probability that they study exactly one language.
Problems with unknowns
Sometimes a region contains an unknown. Write each region as an expression in $x$. The regions must add up to $\#U$, which gives an equation to solve.
(Answer: $\#(A \cup B) = 35$, and $P = \frac{20}{45} = \frac{4}{9}$.)
$\#U = 50$, $\#A = 3x$, $\#B = 2x + 4$, $\#(A \cap B) = x$ and $\#(A \cup B)' = 10$. a) Write an expression for $\#(A \cup B)$ in terms of $x$. b) Form and solve an…
$\#U = 50$, $\#A = 3x$, $\#B = 2x + 4$, $\#(A \cap B) = x$ and $\#(A \cup B)' = 10$.
- a) Write an expression for $\#(A \cup B)$ in terms of $x$.
- b) Form and solve an equation to find $x$.
- c) Hence find $\#(A \setminus B)$ and $\#(B \setminus A)$.
Complements of unions and intersections
Two results connect complements with $\cup$ and $\cap$. They are true for all sets $A$ and $B$:
$$(A \cup B)' = A' \cap B' \qquad (A \cap B)' = A' \cup B'$$Why? Number the four regions of the Venn diagram.
-
$A \cup B$ is regions 1, 2, 3, so $(A \cup B)'$ is region 4. And $A'$ is regions 3, 4 while $B'$ is regions 1, 4, so $A' \cap B'$ is also region 4. ✓
-
$A \cap B$ is region 2, so $(A \cap B)'$ is regions 1, 3, 4. $A' \cup B'$ is regions 3, 4 together with 1, 4, which is again regions 1, 3, 4. ✓
For any sets $A$ and $B$ in a universal set $U$: a) Shade on Venn diagrams the sets $(A \cup B)'$ and $A' \cap B'$, and describe what you observe. b) Verify that…
For any sets $A$ and $B$ in a universal set $U$:
- a) Shade on Venn diagrams the sets $(A \cup B)'$ and $A' \cap B'$, and describe what you observe.
- b) Verify that $(A \cap B)' = A' \cup B'$ for $U = \{1, \dots, 12\}$, $A = \{1, 2, 3, 4, 5, 6\}$ and $B = \{4, 5, 6, 7, 8, 9\}$.
- c) Explain why verifying with one example does not prove the result in general.
Summary
-
A set is written $\{\dots\}$. Use $\in$ for an element, $\subset$ for a subset and $\#A$ for the number of elements.
-
$A \cup B$ is "or", $A \cap B$ is "and", $A \setminus B$ is "in $A$ not $B$", $A'$ is "not in $A$".
-
Fill Venn diagrams from the middle outwards, and check that all regions add up to $\#U$.
-
$\#(A \cup B) = \#A + \#B - \#(A \cap B)$. With three sets, take care to subtract the centre.
-
Probability from a Venn diagram: number in the region $\div\ \#U$.
-
$(A \cup B)' = A' \cap B'$ and $(A \cap B)' = A' \cup B'$. An example verifies, but only an argument for all sets proves.
Back to the start: with 20 in the choir and 15 in the band out of 30, at least $20 + 15 - 30 = 5$ students must be in both.