Sets and Venn diagrams
Work with set notation and operations, and use Venn diagrams to count overlapping groups.
By the end of this lesson you can:
- describe a set in roster and set-builder form, and name its type;
- use the subset, power set and cardinality ideas correctly;
- find the union, intersection, difference, complement and Cartesian product of sets;
- count the subsets of a set;
- solve two-set and three-set survey problems with a Venn diagram.
Sets
A set is a well-defined collection. We write A = {1, 2, 3, 4}, and 3 ∈ A means 3 is an element of A.
"Well-defined" means that for any object, everyone agrees whether it belongs. The vowels of the English alphabet form a set: a, e, i, o and u, and nothing else. "The good singers in the class" is not a set, because people disagree on who is good. Sets are the foundation of modern mathematics: numbers, functions and probability are all built on them.
1. Describing a set
There are two common ways to write a set.
- Roster form lists the elements inside braces: V = {a, e, i, o, u}. Order does not matter and repeats are not counted, so {1, 2, 2, 3} is the same set as {3, 2, 1}.
- Set-builder form states the rule an element must satisfy: E = {x | x is an even natural number less than 12}, read "the set of all x such that x is an even natural number less than 12". In roster form E = {2, 4, 6, 8, 10}.
Use the roster form for small sets and the set-builder form when the list is long or endless.
Kinds of sets
| Kind | Meaning | Sample |
|---|---|---|
| Finite | Its elements can be counted to an end | The months of the year |
| Infinite | Its elements never run out | ℕ = {1, 2, 3, …} |
| Empty, written ∅ or { } | Has no elements | Months with 32 days |
| Universal, written U | Contains every element under discussion | All students of a school, in a school survey |
The number of elements of a finite set A is its cardinality, written n(A). For V = {a, e, i, o, u}, n(V) = 5. The empty set has cardinality 0. Note that {0} is not empty: it has one element, the number 0.
Equal and equivalent sets
Two sets are equal when they have exactly the same elements: {1, 2, 3} = {3, 1, 2}. They are equivalent when they have the same number of elements: {1, 2, 3} and {x, y, z} are equivalent but not equal.
2. Subsets
A is a subset of B, written A ⊆ B, when every element of A is also in B. {2, 4} ⊆ {1, 2, 3, 4}. Every set is a subset of itself, and the empty set is a subset of every set.
A is a proper subset of B, written A ⊂ B, when A ⊆ B and A ≠ B. So {2, 4} ⊂ {1, 2, 3, 4}, but {1, 2, 3, 4} is not a proper subset of itself.
3. Operations
Let A = {1, 2, 3, 4} and B = {3, 4, 5}.
- Union A ∪ B = {1, 2, 3, 4, 5}: in either set.
- Intersection A ∩ B = {3, 4}: in both sets.
- Difference A − B = {1, 2}: in A but not in B.
- Complement A′: everything in the universal set U that is not in A.
- Cartesian product A × B: all ordered pairs. If A has 2 elements and B has 3, A × B has 6 pairs.
The words help you remember: union means "or", intersection means "and", and difference means "but not". Two sets with no common element, such as the odd and the even numbers, are called disjoint: their intersection is ∅.
The complement
The complement always depends on the universal set. Let U be the days of the week and W = {Saturday, Sunday}. Then W′ = {Monday, Tuesday, Wednesday, Thursday, Friday}, and n(W′) = n(U) − n(W) = 7 − 2 = 5. Change U and the complement changes too.
The Cartesian product
A × B is the set of all ordered pairs (a, b) with a from A and b from B, so n(A × B) = n(A) × n(B). A shirt comes in colours C = {red, blue} and sizes S = {S, M, L}. Then C × S = {(red, S), (red, M), (red, L), (blue, S), (blue, M), (blue, L)}: 2 × 3 = 6 choices. Order matters in a pair, so S × C contains (S, red) instead of (red, S), and A × B ≠ B × A unless the sets are equal.
De Morgan’s laws for sets
Two rules link complements with unions and intersections:
(A ∪ B)′ = A′ ∩ B′ and (A ∩ B)′ = A′ ∪ B′
In words, "not in A or B" is the same as "not in A and not in B". You will meet the same laws again in logic.
4. Counting subsets
A set with n elements has 2n subsets. {a, b, c} has 8. All but the set itself are proper subsets, so it has 7 proper subsets.
The reason is a choice made for each element: in or out. Three elements give 2 × 2 × 2 = 8 choices. Listed, the subsets of {a, b, c} are ∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c} and {a, b, c}.
The set of all subsets of A is its power set, P(A). Its cardinality is 2n(A), so a set with 6 elements has a power set of 64 elements. Note that ∅ and A itself are always in P(A).
5. Counting overlaps
n(A ∪ B) = n(A) + n(B) − n(A ∩ B). If 25 of 40 students take Math, 20 take Science and 10 take both, then 25 + 20 − 10 = 35 take at least one, and 5 take neither.
The subtraction is needed because the 10 students who take both are counted once in the 25 and again in the 20. Taking them away once leaves each student counted exactly once.
Filling in a Venn diagram
Always start in the middle and work outward.
- Write the "both" count in the overlap: 10.
- Subtract it from each set to get the "only" regions: Math only is 25 − 10 = 15, Science only is 20 − 10 = 10.
- Subtract all the regions from the total to get "neither": 40 − 15 − 10 − 10 = 5.
Three sets
For three sets the rule grows:
n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C)
The centre is added back because subtracting the three pairs removes it once too often. In a survey of 100 people, 45 like coffee, 50 like tea and 30 like juice. 20 like coffee and tea, 15 like coffee and juice, 10 like tea and juice, and 5 like all three. Then 45 + 50 + 30 − 20 − 15 − 10 + 5 = 85 like at least one drink, and 100 − 85 = 15 like none. On a diagram, fill the centre with 5 first, then each pair region with its pair count minus 5, then the "only" regions.
Solved examples
Follow each one line by line. The steps stay the same when the numbers change, so cover the steps and try it yourself.
Example 1: Set operations
Question: If A = {2, 4, 6, 8} and B = {4, 8, 12}, find A ∪ B, A ∩ B and A − B.
- Find the overlap first. 4 and 8 are in both sets, so A ∩ B = {4, 8}.
- Union: everything, each element once. A ∪ B = {2, 4, 6, 8, 12}.
- Difference: start with A, remove the overlap. A − B = {2, 6}.
Answer: A ∪ B = {2, 4, 6, 8, 12}, A ∩ B = {4, 8}, A − B = {2, 6}.
Example 2: Counting subsets
Question: How many subsets and how many proper subsets does a set with 6 elements have?
- Spot the pattern. Each element is either in a subset or not, which is 2 choices per element.
- Multiply the choices. 26 = 64 subsets.
- Remove the set itself for proper subsets. 64 − 1 = 63.
Answer: 64 subsets and 63 proper subsets.
Example 3: Two overlapping groups
Question: Of 60 students, 35 play basketball, 28 play volleyball and 13 play both. How many play neither?
- Put the overlap in first. 13 go in the middle of the Venn diagram.
- Fill each circle. Basketball only: 35 − 13 = 22. Volleyball only: 28 − 13 = 15.
- Add the regions. 22 + 13 + 15 = 50 play at least one. The formula agrees: 35 + 28 − 13 = 50.
- Subtract from the total. 60 − 50 = 10.
Answer: 10 students play neither.
Common mistakes
- Adding without subtracting the overlap. 25 + 20 = 45 is larger than the class of 40. People in both sets must be counted once.
- Forgetting ∅ and the set itself. Both are subsets, which is why the count is 2n. Only the set itself is excluded from the proper subsets.
- Mixing up ∈ and ⊆. 3 ∈ {1, 2, 3} because 3 is an element. {3} ⊆ {1, 2, 3} because {3} is a set.
- Treating the "both" count as "only". In "20 take Science, 10 take both", only 10 take Science alone.
- Counting repeated elements. {a, a, b} has cardinality 2, not 3.
Where you will meet this
- Surveys and market research. Venn diagrams sort respondents who chose more than one option.
- Databases. Search filters use union ("or") and intersection ("and").
- Probability. Events are sets of outcomes, and the addition rule is the overlap rule.
- Logic. The next lessons use the same laws for statements.
Key terms
- Set
- A well-defined collection of objects called elements.
- Cardinality
- The number of elements of a finite set, n(A).
- Subset
- A set all of whose elements belong to another set.
- Power set
- The set of all subsets of a set; it has 2n elements.
- Complement
- The elements of the universal set that are not in a given set.
- Cartesian product
- The set of all ordered pairs taking the first entry from one set and the second from another.
Summary
- A set is a well-defined collection, written in roster or set-builder form.
- Union is "or", intersection is "and", difference is "but not", and the complement is relative to U.
- n(A × B) = n(A) × n(B), and order matters in the pairs.
- A set with n elements has 2n subsets and 2n − 1 proper subsets.
- n(A ∪ B) = n(A) + n(B) − n(A ∩ B). Fill Venn diagrams from the centre outward.
Fill a Venn diagram from the inside out: the overlap first, then what is left of each circle.