What it is
A set is a collection of distinct objects, called its elements. The elements are written between braces: A = {1, 2, 3}. Two things characterise a set. Order does not matter, so {1, 2, 3} = {3, 2, 1}. And an element is either in or out: it is not counted twice.
Examples of sets:
- {2, 3, 5, 7}, the primes below 10.
- The solutions of x² = 9, that is {−3, 3}.
- The even numbers {…, −2, 0, 2, 4, …}.
- The empty set ∅, which has no elements. The equation x² = −1 has no solution among the real numbers, so its solution set is ∅.
Not sets, or not what they first look like:
- {1, 1, 2} is the set {1, 2}. Three symbols written, two elements.
- (1, 2) is an ordered pair, not a set, because (1, 2) and (2, 1) differ while {1, 2} and {2, 1} are equal.
- “Numbers close to 5” is not a set until “close” is defined. A set must settle whether an object is in or out.
- {0} is not the empty set. It has one element, the number 0.
With two sets A = {1, 2, 3} and B = {2, 3, 4}:
| Operation | Written | Result |
|---|---|---|
| Union (in A or B) | A ∪ B | {1, 2, 3, 4} |
| Intersection (in both A and B) | A ∩ B | {2, 3} |
| Difference (in A but not in B) | A ∖ B | {1} |
That 2 is an element of A is written 2 ∈ A. That {2, 3} is a subset of A is written {2, 3} ⊆ A. All the symbols are in the table of set notation.
Why it matters
Sets are the language other mathematics is written in. An interval is a set, a solution is a set, and an event in probability is a set of outcomes.
- An interval like [2, 5) is the set of all real x with 2 ≤ x < 5.
- In probability an event is a set of outcomes. Roll a die: A = {2, 4, 6} (even) and B = {4, 5, 6} (at least 4). Then A ∪ B = {2, 4, 5, 6} has 4 outcomes, so P(A ∪ B) = 4/6 = 2/3. The addition rule gives the same: 1/2 + 1/2 − P(A ∩ B) with A ∩ B = {4, 6}, that is 1/2 + 1/2 − 1/3 = 2/3.
- That the elements of A ∩ B are counted twice if you just add the sizes is the reason for the minus term: |A ∪ B| = 3 + 3 − 2 = 4 for the sets above.
- The complement rule is about what is not in a set.
Common misconceptions
- “Element and subset are the same.” 2 ∈ A says the number 2 is in A. {2} ⊆ A says the set containing just 2 is inside A. They are different kinds of statement.
- “Union adds the sizes.” |A ∪ B| is not |A| + |B|. With A and B above, 3 + 3 = 6 but A ∪ B has 4 elements, because 2 and 3 are counted once.
- “An element can be in a set several times.” Then it is a list or a multiset, not a set.
Common questions
How many subsets does {1, 2, 3} have?
Eight: ∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3} and {1, 2, 3}. Each element is either in or out, so a set with n
elements has 2ⁿ subsets, here 2³ = 8.
Is the empty set a subset of every set?
Yes. There is no element of ∅ that is missing from the other set, so the condition for being a subset is met.