You and a friend compare your playlists. Some songs you both have, some only you have, some only your friend has. When you want to play something you both like, you are looking for the intersection. When you make one playlist for a party, you make the union. And when you want to send your friend songs they do not know yet, you are looking for the difference.
Sets work exactly like this. In the whole article we use two sets:
A = {1, 2, 3, 4, 5}, B = {4, 5, 6, 7}
Contents
Intersection A ∩ B
The intersection of A and B contains the elements that are in A and in B — in both at the same time.
A ∩ B — read “A intersection B”.
For our sets: A ∩ B = {4, 5}. Only 4 and 5 are in both.
💡 The symbol ∩ looks like an upside-down “U”, like a bowl turned over. Remember: ∩ = “in both”.
Union A ∪ B
The union contains the elements that are in at least one of the sets — in A, in B, or in both.
A ∪ B — read “A union B”.
For our sets: A ∪ B = {1, 2, 3, 4, 5, 6, 7}. We write 4 and 5 only once.
💡 The symbol ∪ looks like a bowl we pour everything into. Remember: ∪ = “in at least one”.
Worked example 1
Find A ∩ B and A ∪ B for A = {x ∈ ℕ | x is a factor of 12} and B = {x ∈ ℕ | x is a factor of 18}.
- List them: A = {1, 2, 3, 4, 6, 12}, B = {1, 2, 3, 6, 9, 18}.
- Intersection — numbers in both: A ∩ B = {1, 2, 3, 6}. These are the common factors of 12 and 18.
- Union — everything, each number once: A ∪ B = {1, 2, 3, 4, 6, 9, 12, 18}.
Difference A ∖ B
The difference A ∖ B contains the elements that are in A but not in B. We take A and “throw out” everything that is also in B.
A ∖ B — read “A minus B”. Some books write A − B.
For our sets: A ∖ B = {1, 2, 3}.
⚠️ The order matters! B ∖ A contains the elements of B that are not in A: B ∖ A = {6, 7}. That is a completely different set.
Complement A′
For the complement we need the universal set U. This is the set of everything we are talking about at the moment — for example all the students in a class, or all the numbers from 1 to 10. In UK exams the universal set is often written ξ (the Greek letter xi).
The complement of A contains the elements of U that are not in A.
A′ — read “A complement” or “not A”. Some books write Aᶜ. It is the same as U ∖ A.
If U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, then A′ = {6, 7, 8, 9, 10}.
💡 A complement makes no sense without U. The complement of a class within the school is the rest of the school; within the town, it is everyone else in the town.
Combined expressions
Operations can be combined. We work out the brackets first, just like with numbers.
Worked example 2
U = {1, 2, …, 10}, A = {1, 2, 3, 4, 5}, B = {4, 5, 6, 7}. Find (A ∪ B)′.
- Brackets: A ∪ B = {1, 2, 3, 4, 5, 6, 7}.
- Complement in U — what is missing from U: (A ∪ B)′ = {8, 9, 10}.
Worked example 3
For the same sets, find A ∩ B′.
- B′ = the elements of U that are not in B: B′ = {1, 2, 3, 8, 9, 10}.
- A ∩ B′ = the elements in A and in B′: {1, 2, 3}.
- Notice: this is the same as A ∖ B. In fact A ∖ B = A ∩ B′ always.
Disjoint sets
If two sets have no element in common, their intersection is empty: A ∩ B = ∅. Such sets are called disjoint.
Examples: even and odd numbers, or rational and irrational numbers.
Sets in probability
In probability, an event is a set of outcomes, and the universal set is the set of all possible outcomes (the sample space). The set operations then have everyday names:
| Event | Set |
|---|
| A and B | A ∩ B |
| A or B (or both) | A ∪ B |
| not A | A′ |
Example: roll a dice. U = {1, 2, 3, 4, 5, 6}, A = “an even number” = {2, 4, 6}, B = “more than 3” = {4, 5, 6}.
- “even and more than 3”: A ∩ B = {4, 6},
- “even or more than 3”: A ∪ B = {2, 4, 5, 6},
- “not even”: A′ = {1, 3, 5}.
Overview
| Operation | Notation | In words | For A = {1,…,5}, B = {4,…,7} |
|---|
| intersection | A ∩ B | in A and in B | {4, 5} |
| union | A ∪ B | in at least one | {1, 2, 3, 4, 5, 6, 7} |
| difference | A ∖ B | in A but not in B | {1, 2, 3} |
| difference | B ∖ A | in B but not in A | {6, 7} |
| complement | A′ | in U but not in A | {6, 7, 8, 9, 10} for U = {1,…,10} |
Common mistakes
- Mixing up ∩ and ∪: ∩ is “in both” (a smaller set), ∪ is “in at least one” (a bigger set).
- Repeating elements in a union: shared elements are written only once.
- A ∖ B = B ∖ A: not true! The order matters.
- Complement without U: always check what the universal set is.
- An empty intersection written as {0}: if there is nothing in common, the answer is ∅.
Summary
- A ∩ B: elements in A and in B.
- A ∪ B: elements in at least one of the sets, each once.
- A ∖ B: elements of A that are not in B. A ∖ B ≠ B ∖ A.
- A′: elements of U that are not in A.
- Brackets first. A ∖ B = A ∩ B′.
Try it yourself
U = {1, 2, 3, 4, 5, 6, 7, 8}, A = {1, 3, 5, 7}, B = {3, 4, 5, 6}.
- A ∩ B
- A ∪ B
- A ∖ B
- B ∖ A
- A′
- (A ∩ B)′
- A′ ∩ B′
Answers
- A ∩ B = {3, 5}
- A ∪ B = {1, 3, 4, 5, 6, 7}
- A ∖ B = {1, 7}
- B ∖ A = {4, 6}
- A′ = {2, 4, 6, 8}
- (A ∩ B)′ = {1, 2, 4, 6, 7, 8}
- A′ = {2, 4, 6, 8}, B′ = {1, 2, 7, 8}, so A′ ∩ B′ = {2, 8}. This is the same as (A ∪ B)′ — the numbers that are in neither A nor B.
Practise
👉 Next article: Venn diagrams with two sets