Everything not in A
A class has 20 students, the universal set. The 7 who walk to school make the set A. The other 13 do not walk, and they make the complement of A, written A': everything in the universal set that is not in A.
So . On a Venn diagram, A' is the part of the box outside the circle.
A' shaded: the 13 students in the box outside A.
A set and its complement make the whole
Every element of the universal set is either in A or in A', and never in both. In symbols, and . That is why the two counts add to the whole: 7 + 13 = 20.
The complement of A' is A again, (A')' = A: the students who are not among those who do not walk are the ones who walk.
For a student picked at random, P(A') = 1 − P(A): the chance of not walking is . When the complement is easier to count, count it and subtract from the whole.
The complement depends on the universal set
Let A be the even numbers from 2 to 10. If is the whole numbers from 1 to 10, then A' = {1, 3, 5, 7, 9}, 5 elements. If is the whole numbers from 1 to 20, then A' also contains 11, 12, 13 and every other number up to 20 except the five in A, 15 elements. A complement is only defined once the universal set is.
Complements of a union and an intersection
Take to be the whole numbers from 1 to 10, A = {2, 4, 6, 8} and B = {1, 2, 3, 4, 5}. The numbers in neither set are {7, 9, 10}.
Now take the two complements, A' = {1, 3, 5, 7, 9, 10} and B' = {6, 7, 8, 9, 10}. Their intersection, the numbers in both, is {7, 9, 10}, the same set. "Not in A or B" means "not in A and not in B": .
In the same way, . Here {2, 4}, so is the other 8 numbers, and {1, 3, 5, 6, 7, 8, 9, 10}, 8 numbers.
shaded: the numbers outside both circles, 7, 9 and 10. They are exactly the numbers outside A and also outside B.
Subsets
B is a subset of A, written , when every element of B is also an element of A. Let A = {2, 4, 6, 8, 10}, the even numbers up to 10, and B = {4, 8}, the multiples of 4 up to 10. Both elements of B are in A, so .
On a Venn diagram the "B only" region is empty: nothing is in B without also being in A. Some diagrams draw B as a circle inside A instead.
B = {4, 8} and A = {2, 4, 6, 8, 10}. The B only region holds nothing, so every element of B is in A.
What a subset does to the union and the intersection
When , the overlap is the whole of B and the union is the whole of A: and . Here {4, 8} and {2, 4, 6, 8, 10}.
The direction matters. does not mean : 2 is in A and not in B. And the complements go the other way round: gives , since anything outside A is certainly outside B.
Every set, and the empty set
Every set is a subset of itself, , since every element of A is in A. A subset that is not the whole set is a proper subset, written .
The empty set is a subset of every set: it has no elements, so none of them can fail to be in A.
How many subsets a set has
To make a subset of {a, b}, decide for each element whether it is in or out. a can be in or out, and so can b, which gives 2 × 2 = 4 subsets: {a, b}, {a}, {b} and .
For {a, b, c} there are 2 × 2 × 2 = 8: , {a}, {b}, {c}, {a, b}, {a, c}, {b, c} and {a, b, c}. A set of n elements has subsets, counting the empty set and the set itself.
Each element of {a, b} is in or out. The four paths through the tree are the four subsets, the last of them the empty set.
The usual mistakes
Giving the whole universal set as the complement. With 20 in and 7 in A, the complement leaves out the 7: it has 13 members, not 20.
Giving the members of A itself. A' is everyone else, 13 of the 20.
Reading backward. It says B sits inside A, not the other way round.
Leaving out the empty set, or the set itself, when counting subsets. {a, b, c} has 8 subsets, not 6 or 7.
Eight toppings
In the application below, a pizza is a subset of 8 toppings, so there are of them, including the plain pizza, which is the empty set. The pizzas with at least two toppings are counted by taking away those with fewer.
Worked example: Every Pizza a Shop Can Make from Eight Toppings
Question A pizza shop offers 8 different toppings, and a customer may choose any selection of them, including none at all for a plain cheese pizza. Each topping is used at most once. (a) How many different pizzas can be ordered? (b) How many of these pizzas have at least two toppings?
1.For each of the 8 toppings there are 2 choices: put it on or leave it off.
Each of the 8 toppings is on the pizza or off it: 2 choices each. 2.(a) The choices multiply: 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 28 = 256 different pizzas, counting the plain one.
(a) The choices multiply: 28 = 256 pizzas, counting the plain one. 3.The pizzas with fewer than two toppings are the plain pizza, 1, and the pizzas with exactly one topping, 81 = 8.
Fewer than two toppings: the plain pizza, 1, and one topping, 81 = 8. 4.(b) At least two toppings: 256 − 1 − 8 = 247 pizzas. Check by adding the sizes: 82 + 83 + … + 88 = 28 + 56 + 70 + 56 + 28 + 8 + 1 = 247.
(b) At least two toppings: 256 − 1 − 8 = 247 pizzas.
Answer: (a) 256 pizzas; (b) 247 pizzas
Common mistakes
- Answering (a) with 8! = 40320. That counts the orders in which the toppings could be put on, but a pizza with ham then olives is the same pizza as one with olives then ham.
- Answering (a) with 28 − 1 = 255. The question counts the plain cheese pizza, which is the empty subset, so all 256 subsets are pizzas here.