Sub topic 1
Sets, elements and notation
Prerequisites
You should be comfortable with whole numbers, basic arithmetic, and simple linear equations. You should also be able to read a word problem that gives counts and percentages. No prior set theory is needed.
Sets and elements
A set is a collection of distinct objects. Each object in a set is an element. We write x ∈ A to mean x is an element of A, and x ∉ A when it is not.
Two notations describe a set:
- Roster notation lists the elements: A = {1, 2, 3, 4}.
- Set-builder notation states a rule: B = {x | x is an integer and 0 < x < 5}.
Order and repetition do not matter, so {1, 2, 2, 3} equals {3, 2, 1}. The count of elements in A is written n(A). Here n(A) = 4.
Subsets, the universal set and the empty set
Set B is a subset of A, written B ⊆ A, when every element of B is also in A. The empty set, written ∅, has no elements and is a subset of every set.
In counting problems, the universal set U holds every element under consideration. The complement of A, written A', is the set of elements in U that are not in A.
Union, intersection, difference and complement
For sets A and B:
| Operation | Notation | Meaning |
|---|---|---|
| Union | A ∪ B | in A, in B, or in both |
| Intersection | A ∩ B | in both A and B |
| Difference | A − B | in A but not in B |
| Complement | A' | in U but not in A |
A = {1, 2, 3, 4}
B = {3, 4, 5}
U = {1, 2, 3, 4, 5, 6}
print(A | B) # union: {1, 2, 3, 4, 5}
print(A & B) # intersection: {3, 4}
print(A - B) # difference: {1, 2}
print(U - A) # complement of A: {5, 6}Drawing and reading two-set Venn diagrams
A Venn diagram draws the universal set as a rectangle and each set as a circle inside it. The overlap of the circles is A ∩ B. The part of circle A outside B is A − B. The area outside both circles is the "neither" group.
Worked example: 40 students play cricket (C) and 25 play football (F). If 10 play both, then only cricket is 40 − 10 = 30, and only football is 25 − 10 = 15. The union is 30 + 10 + 15 = 55 students.
Exercise
If n(A) = 12, n(B) = 9 and n(A ∩ B) = 4, how many elements are only in A?
Show answer
8, because 12 − 4 = 8.