Sets
Sets
Sets
Set Theory
1.1
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.
Denition 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
Example 1.1.2. 16 Z,
Example 1.1.3. 3
/ 2Z.
/Q
Example 1.1.4. 3
So far, we have been dening sets by describing them in words. We can also specify
some sets by listing their elements. For example, dene the set T by writing
T = {a, b, c, d, e}.
When dening a set by listing, always use the brackets {, }. Another set that we can dene
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 dene 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 species 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 denition:
Denition 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} = { } = .
Denition 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
As we have seen from our examples, sets may contain a nite number of elements, or
an innite number of elements. Examples of nite sets include T from Example 1.1.5, and
also the set of students enrolled in Math 103. Examples of innite sets are Z and R.
Denition 4. If a set S is nite, 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. Lets 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}, lets 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
0
1
2
3
4
subsets
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.
1.3
Let U be a set. Given two subsets A and B of U we dene 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 dene 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:
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 remember 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).
Figure 1.3: (A B) C
A (B C)
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 satises the following rules:
1. (A ) = A
2. U = and = U
3. A A = U
4. A A =
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 lets nd 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 Morgans 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 .
A B
10
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 dene the dierence 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
foodstus in the supermarket with added sugar, then S T is the set of all juices in the
market without added sugar.
1.4
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 ll 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. Lets 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, lets ll in more of the diagram:
12
1.5
13
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 denition involving ordered pairs: Given two sets A, B
we dene 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 nite 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 rst 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:
(2,
1)
(2,
2)
(2,
3)
(2,
4)
(2,
5)
(2,
6)
14
1.6
Excercises
1.6.
EXCERCISES
15
(b) (A B) C
7. Denote the set A = {x|x Z and x < 3} by the listing method.
8. A proper subset of a set A is one that is not equal to the set A itself. If a set has 6
elements, how many proper subsets does it have?
9. Describe the shaded region using , , , :
a)
b)
c)
d)
e)
f)
16
10. One hundred students were surveyed and asked if they are currently taking math
(M), English (E) and/or History (H) The survey ndings are summarized here:
Table 1.2: Survey Results
n(M ) = 45
n(E) = 41
n(H) = 40
n[(M E) (M H) (E H)] = 36
n(M E) = 15
n(M H) = 18
n(M E H) = 7
1.6.
EXCERCISES
(c) The empty set is a subset of every set.
(d) 1 is an element of {3, 2, 1, 4}.
(e) {1} is an element of {3, 2, 1, 4}.
(f) {1} is a proper subset of {3, 2, 1, 4}
(g) {3, 2, 1, 4} = {1, 2, 3, 4}
(h) (0, 1/2) is an element of Q Z
(i) (0, 1/2) is an element of Z Q
(j) (7/8, 0) is an element of Q Q
(k) (7/8, 0) is an element of Z Z
17
18
1.7
1.
2.
3.
4.
Solutions to exercises
6.
7. { , 4, 3, 2, 1, 0, 1, 2}
8. 63
9. a) (A B) (B A) b) (A B) (A B) c) B A d) A (A B C)
e) [(A B) (A C) (B A)] [A B C] f) [(A B) (A B)] (B C)
10. b) 19
11. b) 19
12. 18 + 6 4 = 20
13. a) {A, K}, {A, K, Q}, {A, K, J}, {A, K, Q, J}. b) 250 .
14. a) True, b) False, c) True, d) True, e) False, f) True, g) True, h) False, i) True, j) True,
k) False