Set Theory

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Chapter 1

Set Theory

1.1 Basic definitions and notation


A set is a collection of objects. For example, a deck of cards, every student enrolled in
Math 103, the collection of all even integers, these are all examples of sets of things. Each
object in a set is an element of that set. The two of diamonds is an element of the set
consisting of a deck of cards, one particular student is an element of the set of all students
enrolled in Math 103, the number 4 is an element of the set of even integers.
We often use capital letters such as A to denote sets, and lower case letters such as a
to denote the elements.

Definition 1. Given a set A, if u is an element of A we write

u ∈ A.

If the element u is not in the set A we write

u∈
/ A.

Some sets that you may have encountered in mathematics courses before are:

• The integers Z

• The even integers 2Z

• The set of rational numbers Q

• The set of real numbers R.

We can now practice using our element notation:

Example 1.1.1. We have 4 ∈ 2Z.

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, · · · },

where we have indicated a general pattern (hopefully easily regognized!) by writing · · · .


Many sets cannot be listed so easily (or at all for that matter), and in many of these cases
it is convenient to use a rule to specify a set. For example, suppose we want to define a
set S that consists of all real numbers between −1 and 1, inclusive. We use the notation

S = {x|x ∈ R and − 1 ≤ x ≤ 1}.

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 { }.

Thus, the above set {x|x ∈ Z, x < 0 and x > 1000} = { } = φ.

Definition 3. Two sets are equal if they have exactly the same elements, denoted

A = B.

If A and B are not equal, we write 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.

Example 1.2.1. {2, 4, 6} ⊆ 2Z.


Example 1.2.2. Let A = {a, b, c, d, e}, and B = {a, e} then B ⊆ A.
Example 1.2.3. Let’s list all subsets of A from Example 1.2.2 that have four elements:

{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.

Table 1.1: Subsets of S

number of elements subsets


0 φ
1 {a}, {b}, {c}, {d}
2 {a, b}, {a, c}, {a, d}, {b, c}, {b, d}{c, d}
3 {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}
4 {a, b, c, d}

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

1.3 Union, Intersection, and Complement


Let U be a set. Given two subsets A and B of U we define the union of A and B to be
the subset of U that contains all elements that are in A, or in B, or possibly in both. The
union of A and B is denoted
A ∪ B.
In our “rule” notation A ∪ B = {x ∈ U |x ∈ A or x ∈ B, or both}.
Example 1.3.1. Let U = {1, 2, 3, · · · 10}. Let S = {2, 4, 6, 8, 10}, T = {5, 6, 7, 8}. Then

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

We have the following facts about the union:


1. A ∪ φ = A
2. A ∪ A = A
3. A ∪ B = B ∪ A
4. (A ∪ B) ∪ C = A ∪ (B ∪ C)
We define the intersection of subsets A and B of U to be the subset of U that contains
all of the elements that are in both A and B. The intersection of A and B is denoted

A ∩ B.

We have A ∩ B = {x ∈ U |x ∈ A and x ∈ B}.


Here is a Venn diagram illustrating the intersection:
1.3. UNION, INTERSECTION, AND COMPLEMENT 7

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}.

We have the following facts about the intersection:

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}.

Notice that (S ∩ H) ∪ K #= S ∩ (H ∪ K). It is important to always use parenthesis in the


appropriate place when working with three or more sets, statements like “A ∩ B ∪ C ∩ D”
do not have one interpretation so do not actually specify a set. The exception is when
all operations are the same, as in properties (4) of intersection and union. For example
A ∪ B ∪ C = (A ∪ B) ∪ C = A ∪ (B ∪ C).
8 CHAPTER 1. SET THEORY

Example 1.3.4. Venn diagrams illustrating the sets (A ∪ B) ∩ C, and A ∪ (B ∩ C).

Figure 1.3: (A ∪ B) ∩ C A ∪ (B ∩ C)

Given A a subset of U , the complement of A is the subset of U consisting of all


elements not in A. The complement of A is denoted A′ .

Figure 1.4: A′

Example: Let U = {· · · − 4, −3, −2, −1, 0, 1, 2, 3, 4, · · · }, let N = {0, 1, 2, 3 · · · }. Then

N ′ = {−1, −2, −3, −4, · · · }.

The complement satisfies the following rules:

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

(R ∪ F )′ = {A♣, A♠, 2♣, 2♠, · · · , 10♣, 10♠}.

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:

R′ ∩ F ′ = {A♠, A♣, 2♠, 2♣, · · · , 10♠, 10♣}.

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♠}.

We see that R′ ∪ F ′ is not equal to (R ∪ F )′ .

Theorem 1.3.6. De Morgan’s Laws: Given two sets A, B ⊂ U ,

(A ∪ B)′ = A′ ∩ B ′

(A ∩ B)′ = A′ ∪ B ′

Example 1.3.7. Fill in the Venn diagrams for (A ∪ B)′ , and for A′ ∩ B ′ .

Figure 1.5: (A ∪ B)′ A′ ∩ B ′


10 CHAPTER 1. SET THEORY

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.

1.4 Cardinality and Survey Problems


If a set S is finite, recall that n(S) denotes the number of elements in S.

Example 1.4.1. Let D denote a standard deck of cards. n(D) = 52.

Theorem 1.4.2. If A and B are both finite sets, then

n(A ∪ B) = n(A) + n(B) − n(A ∩ B)

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

n(R ∪ F ) = n(R) + n(F ) − n(R ∩ F ) = 26 + 12 − 6 = 32.

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

We have n(C) = 44, n( (P ∪ J ∪ C)′ ) = 19. If we let j be the number of surveyed


customers who like only Jazz, then because there are 100 surveyed customers, we see
19 + 44 + 15 + 12 + j = 100. Solving for j gives j = 10.

How many like Pop and Classical, but not Jazz?


We know that n(P ∪ J) = 78. Using the diagram, the number who like Pop and
Classical, but not Jazz is

78 − 10 − 27 − 12 − 15 − 10 = 4.
1.5. CARTESIAN PRODUCTS 13

1.5 Cartesian Products


You may recall the Cartesian plane R2 which is the set of all points in the plane. This set
consists of ordered pairs of numbers (x, y) where x and y are real numbers. The point
(1, 2) is not the same as (2, 1). We use round brackets (, ) to denote ordered pairs, reserving
the brackets {, } for sets.
We can make a more general definition involving ordered pairs: Given two sets A, B
we define the Cartesian product to be

A × B = {(a, b)|a ∈ A and b ∈ B}.

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

n(A × B) = n(A) × n(B).

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.

You might also like