Set Notation
Set notation is a small alphabet: braces list a set, ∈ says an element belongs to it, ∪ joins two sets, ∩ keeps their overlap, and a prime marks everything else. Each symbol is a region of a Venn diagram.
Last updated
A set is a collection of distinct things, called its elements. Set notation is the handful of symbols for listing a set, saying what belongs to it, and combining two sets into a third. There are fewer than a dozen of them, and each one names a region of a Venn diagram.
Here A is the factors of 12 and B is the even numbers, inside the universal set U = {1, 2, ..., 12}. Pick an operation and watch which region it shades.
- U = {1, 2, ..., 12}
- whole numbers from 1 to 12
- A = {1, 2, 3, 4, 6, 12}
- factors of 12
- B = {2, 4, 6, 8, 10, 12}
- even numbers
A ∪ B = {1, 2, 3, 4, 6, 8, 10, 12}
Say it A union B
Everything in A, in B, or in both.
8 elements
The symbols
| symbol | name | say it as | example with the sets above |
|---|---|---|---|
| { } | braces | "the set of" | A = {1, 2, 3, 4, 6, 12} |
| ∈ | element of | "is in" | 6 ∈ A |
| ∉ | not an element of | "is not in" | 5 ∉ A |
| ⊆ | subset of | "is a subset of" | {2, 4} ⊆ B |
| ∪ | union | "A union B" | A ∪ B = {1, 2, 3, 4, 6, 8, 10, 12} |
| ∩ | intersection | "A intersect B" | A ∩ B = {2, 4, 6, 12} |
| \ | difference | "A minus B" | A \ B = {1, 3} |
| A′ | complement | "A complement" or "not A" | A′ = {5, 7, 8, 9, 10, 11} |
| △ | symmetric difference | "A symmetric difference B" | A △ B = {1, 3, 8, 10} |
| ∅ | empty set | "the empty set" | A ∩ {5, 7} = ∅ |
| U | universal set | "the universal set" | everything under discussion |
Every answer in the last column can be checked in the diagram above, and it is worth doing once by hand: list A and B, then read each operation off the two lists.
Writing a set down
Roster notation lists the elements between braces: A = {1, 2, 3, 4, 6, 12}. Two rules come with it. Order does not matter, and neither do repeats, so {1, 2, 3}, {3, 2, 1} and {1, 1, 2, 3} are the same set.
Set-builder notation describes the elements by a rule instead:
A = {x ∈ ℕ | 12/x ∈ ℕ}
Read it as "the set of natural numbers x such that 12 divided by x is also a natural number". The vertical bar means "such that"; some books use a colon instead. Set-builder is the only way to write a set with infinitely many elements, such as {x ∈ ℝ | x > 3}, which interval notation shortens to (3, ∞).
The number systems have their own letters: ℕ for the natural numbers, ℤ for the integers, ℚ for the rationals and ℝ for the real numbers.
Combining two sets
Four operations cover almost every question:
- Union, A ∪ B: everything in A or in B, or in both. It is the word "or". Nothing is listed twice, so 2, 4, 6 and 12 appear once even though they are in both sets.
- Intersection, A ∩ B: only what is in both sets at once. It is the word "and".
- Difference, A \ B: what is in A but not in B. Order matters, because B \ A = {8, 10} while A \ B = {1, 3}. Some books write it with a minus sign.
- Complement, A′: everything in the universal set that is not in A. Without a universal set the complement is not defined, which is why every Venn diagram has a rectangle around it.
The symmetric difference, A △ B, is the union with the intersection taken out: the elements in exactly one of the two sets.
Element of, or subset of
These two are the most often confused symbols in the topic, because both answer "is it in there?".
- ∈ relates an element to a set: 2 ∈ A.
- ⊆ relates a set to a set: {2} ⊆ A.
Writing "2 ⊆ A" is wrong, because 2 is a number and not a set, and writing "{2} ∈ A" is wrong for the opposite reason, because A contains the number 2 and not the set {2}.
A set is a subset of another when every one of its elements is in the other. One element missing is enough to make it false: A is not a subset of B, because 1 is in A but not in B. The empty set is a subset of every set, since it has no element that could be missing.
Counting with a Venn diagram
The number of elements in a set is written with vertical bars: |A| = 6. To count a union, add the two sets and take away the overlap, which was counted twice:
|A ∪ B| = |A| + |B| − |A ∩ B|
With the sets above, that is 6 + 6 minus 4, which gives 8, the same as counting the union directly. This is the inclusion-exclusion principle, and it is how survey questions such as "how many students take French or Spanish" are answered.
The answer is 18 + 12 minus 5, which is 25. If you got 30, the 5 students who play both were counted twice.
Sets and logic are the same thing
Union is "or", intersection is "and" and complement is "not". That is not a loose analogy: an element is in A ∩ B exactly when the statement "it is in A and it is in B" is true. The discrete math page builds the truth tables for those words, and the same Venn diagram shades both.
Common questions
- What does ∈ mean?
- ∈ means "is an element of". 3 ∈ A says that 3 is one of the members of the set A. With a slash through it, ∉ means "is not an element of", so 5 ∉ A says that 5 is not in A. The symbol is a stylised Greek epsilon, for the word element.
- What is the difference between ∈ and ⊆?
- ∈ connects an element to a set, and ⊆ connects a set to a set. If A = {1, 2, 3}, then 2 ∈ A and {2} ⊆ A are both true, but 2 ⊆ A is wrong, because 2 is a number and not a set. Read ⊆ as "is a subset of": every element of the left-hand set is also in the right-hand set.
- What is set-builder notation?
- A way to describe a set by a rule instead of a list. {x | x > 3} is read "the set of all x such that x is greater than 3". The vertical bar, or a colon in some books, means "such that". It is the only practical way to write a set with infinitely many elements.
- What is the difference between union and intersection?
- The union A ∪ B contains everything that is in A or in B or in both. The intersection A ∩ B contains only what is in A and in B at the same time. On a Venn diagram the union is both circles together and the intersection is the lens where they overlap, so the intersection is always inside the union.
- How do you write the complement of a set?
- Most books write A′ (A prime), Aᶜ or A with a bar over it. All three mean the same thing: every element of the universal set U that is not in A. The complement depends on U, so always check what the universal set is before you list it.
- What does ∅ mean?
- ∅ is the empty set, the set with no elements. It can also be written {}. It is a subset of every set, because it has no element that could be missing from another set. Note that {∅} is not empty: it is a set with one element, and that element is the empty set.
- What is the difference between ⊂ and ⊆?
- ⊆ means "is a subset of" and allows the two sets to be equal. ⊂ usually means a proper subset, one that is smaller than the other set. Books disagree here: some use ⊂ for any subset and write ⊊ when they mean proper. When it matters, check which convention your course uses.