Set Theory
Set Theory
Set Theory
Set Theory
u ∈ A.
u∈
/ A.
Some sets that you may have encountered in mathematics courses before are:
• The integers Z
3
4 CHAPTER 1. SET THEORY
Example 1.1.2. 16 ∈ Z,
Example 1.1.3. 3 ∈
/ 2Z.
√
Example 1.1.4. 3 ∈ /Q
So far, we have been defining sets by describing them in words. We can also specify
some sets by listing their elements. For example, define the set T by writing
T = {a, b, c, d, e}.
When defining a set by listing, always use the brackets {, }. Another set that we can define
by listing is the set of natural numbers
N = {0, 1, 2, 3, 4, · · · },
We read the above as “S equals the set of all x such that x is a real number and x is greater
than or equal to −1, and less than or equal to 1.” What happens if someone specifies a set
by a rule like “x is a negative integer greater than 1000”? What should we do? There are
no numbers that are negative and greater than 1000. We allow examples of rules of this
kind, and make the following definition:
Definition 2. The empty set is the set with no elements, and is denoted by the symbol
φ, or by { }.
Definition 3. Two sets are equal if they have exactly the same elements, denoted
A = B.
Example 1.1.5. Let T = {a, b, c, d, e} and let R = {e, d, a, c, b}. We can check that T and
R have exactly the same elements, so T = R.
Example 1.1.6. Let S = {x|x ∈ Z and x ≤ 0}, and let A = {3n|n ∈ Z}. We can see that
S #= A because A consists of all integer multiples of 3, hence 3 ∈ A but 3 ∈
/ S. This shows
S #= A.
1.2. SUBSETS 5
As we have seen from our examples, sets may contain a finite number of elements, or
an infinite number of elements. Examples of finite sets include T from Example 1.1.5, and
also the set of students enrolled in Math 103. Examples of infinite sets are Z and R.
Definition 4. If a set S is finite, we let n(S) denote the number of elements in S.
Example 1.1.7. Let T be as in Example 1.1.5, then n(T ) = 5.
1.2 Subsets
One important relation between sets is the idea of a subset. Given sets A and B, we say
B is a subset of A if every element of B is also an element of A. We denote this as
B ⊆ A.
{a, b, c, d}, {a, b, c, e}, {a, b, d, e}, {a, c, d, e}, {b, c, d, e}.
For any set A, since every element of A is in A we have A ⊆ A. This says that a set
is always a subset of itself. We also consider the empty set to be a subset of any set A,
φ ⊆ A.
Let S = {a, b, c, d}, let’s list all subsets of the set S = {a, b, c, d}. To organize our work,
we will list them by size.
We have listed all of the subets of S. Notice that there are 16 of them. In fact, one can
prove the following theorem by using methods of counting covered later in this course.
Theorem 1.2.4. Let S be a set having N elements. Then there are 2N subsets of S.
6 CHAPTER 1. SET THEORY
S ∪ T = {2, 4, 5, 6, 7, 8, 10}.
We often use what is known as a Venn diagram to illustrate sets. In a Venn diagram
circles are used to represent subsets of a set U (denoted by a large rectangle). Here is a
Venn diagram illustrating A ∪ B.
Figure 1.1: A ∪ B
A ∩ B.
Figure 1.2: A ∩ B
Example 1.3.2. If U , S and T are given as in Example 1.3.1 above, then S ∩ T = {6, 8}.
1. A ∩ φ = φ
2. A ∩ A = A
3. A ∩ B = B ∩ A
4. (A ∩ B) ∩ C = A ∩ (B ∩ C)
Given the two operations ∪, ∩ we can apply them in combination, as long as we re-
member to use parenthesis to indicate in what order the operations should be performed.
Example 1.3.3. Let U = {a, b, c, d, e, f, g}, let S = {a, e}, H = {a, b, c, d}, K = {a, c, e, f }.
Then
(S ∩ H) ∪ K = {a} ∪ K = {a, c, e, f },
S ∩ (H ∪ K) = S ∩ {a, b, c, d, e, f } = {a, e},
(S ∩ H) ∩ K = {a}.
Figure 1.3: (A ∪ B) ∩ C A ∪ (B ∩ C)
Figure 1.4: A′
1. (A′ )′ = A
2. U ′ = φ and φ′ = U
3. A ∪ A′ = U
4. A ∩ A′ = φ
1.3. UNION, INTERSECTION, AND COMPLEMENT 9
Example 1.3.5. Let D be the set of a standard deck of cards. Let R be the subset of red
cards, let F be the subset of face cards. (The face cards include all suits of K, Q, J.) Find
the following sets: (R ∪ F )′ , R′ ∩ F ′ , R′ ∪ F ′ .
The set
R ∪ F = {A♥, A♦, 2♥, 2♦, · · · K♥, K♦, K♠, K♣, Q♠, Q♣, J♠, J♣}
i.e. consists of all cards that are either red, or black face cards. The complement of R ∪ F
consists of the cards not listed above and is
The set R′ is the set of black cards, the set F ′ is the set of non-face cards (of any suit), so
the intersection is the set of black non-face cards:
This is the same set as (R ∪ F )′ . Now let’s find R′ ∪ F ′ the union of the black cards and
the non-face cards.
R′ ∪ F ′ = {A♥, A♦, 2♥, 2♦, · · · 10♥, 10♦, A♣, A♠, 2♣, 2♠, · · · J♣, J♠, Q♣, Q♠, K♣, K♠}.
(A ∪ B)′ = A′ ∩ B ′
(A ∩ B)′ = A′ ∪ B ′
Example 1.3.7. Fill in the Venn diagrams for (A ∪ B)′ , and for A′ ∩ B ′ .
If we are interested in elements of a set A that are not contained in a set B, we can
write this set as A ∩ B ′ . This concept comes up so often we define the difference of two
sets A and B:
A − B = A ∩ B′,
Figure 1.6: A − B
For example, if S is the set of all juices in the supermarket, and T is the set of all
foodstuffs in the supermarket with added sugar, then S − T is the set of all juices in the
market without added sugar.
To see how this theorem works, lets consider our set D. Let the set of all red cards be
denoted R, and let the set of face cards be denoted F . How many elements are in R ∪ F ?
We can count them as listed in Example 1.3.5, or we can use the formula. The intersection
consists of the six red face cards: {K♥, K♦, Q♥, Q♦, J♥, J♦}. Using the formula gives
What we should not do is simply add the number of red cards to the number of face cards,
if we do that we have counted the red face cards twice.
We can use our formula for the number of elements to analyze surveys.
Example 1.4.3. Suppose Walter’s online music store conducts a customer survey to de-
termine the preferences of its customers. Customers are asked what type of music they
1.4. CARDINALITY AND SURVEY PROBLEMS 11
like. They may choose from the following categories: Pop (P), Jazz (J), Classical (C), and
none of the above (N). Of 100 customers some of the results are as follows:
44 like Classical
27 like all three
15 like only Pop
10 like Jazz and Classical, but not Pop
How many like Classical but not Jazz? We can fill in the Venn diagram below to keep
track of the numbers. There are n(C) = 44 total that like Classical, and n(C ∩ J) =
27 + 10 = 37 that like both Jazz and Classical, so 44 − 37 = 7 like Classical but not Jazz.
Example 1.4.4. Let’s look at some more survey results from Example 1.4.3:
78 customers like Jazz or Pop (or possibly both).
19 customers marked “None of the above” when asked what they like.
12 like Jazz and Pop, but not classsical.
How many like only Jazz?
To answer this, let’s fill in more of the diagram:
12 CHAPTER 1. SET THEORY
78 − 10 − 27 − 12 − 15 − 10 = 4.
1.5. CARTESIAN PRODUCTS 13
Example 1.5.1.
{2, 3, 4} × {7, 9, 10} = {(2, 7), (2, 9), (2, 10), (3, 7), (3, 9), (3, 10), (4, 7), (4, 9), (4, 10)}
Theorem 1.5.2. If A and B are two finite sets, then the number of elements in the
Cartesian product A × B is given by
Example 1.5.3. If we roll two dice, and create a set of all possible results. How many
elements are there?
We can think of the possible results of rolling dice as a set of ordered pairs. Let D1
denote the set of possible results of rolling the first die D1 = {1, 2, · · · 6}, and let D2 denote
the set of possible results of rolling the second die, D2 = {1, 2, · · · 6}. There are 6 × 6 = 36
possible results from rolling the pair:
(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)
(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)
(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)
(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)
(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)
(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)
Example 1.5.4. Write out the subset of D1 × D2 that represents cases where the sum of
the numbers showing is either 7 or 11. How many elements are in this set?
The subset we are looking for is
{(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)} ∪ {(5, 6), (6, 5)}
= {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1), (5, 6), (6, 5)}.
and the number of elements is 6 + 2 = 8.