0 General Instructions 1 Sets

CS245 Tutorial
Week 0 (September 9, 2016)
0
General Instructions
1. ISAs, please insert appropriate examples/exercises at will, and as time
permits.
2. Please send your favourite examples/exercises back for inclusion in
these notes after the tutorials.
3. Use your judgment and feedback from the class to decide what from
these notes to present during the tutorial (you likely cannot present
all of this material in one hour).
1
Sets
Definition 1.1 A set is a collection of similar but distinct objects.
Examples:
1. N = {0, 1, 2, 3, . . .}, the set of natural numbers.
2. Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . .}, the set of integers.
3. Q, the set of rational numbers.
4. R, the set of real numbers.
5. the set, S, of all residents of Canada.
6. the set, U , of all undergraduates registered at the University of Waterloo.
7. and many more . . .
Definition 1.2 Let S be a set. One of the like objects, x, that belongs to S
(denoted x ∈ S) is called an element of S.
Definition 1.3 Let S be a set. Then a set T is a subset of S (denoted
T ⊆ S) if whenever x ∈ T , it follows that x ∈ S.
Examples:
1
1. the set, P , of all subsets of a fixed set X (see Definition 1.3). The
elements of P are sets.
Note: ISAs, please emphasize the difference between Definitions 1.2 and
1.3.
Remarks:
1. Every set is a subset of itself.
2. The empty set, ∅ is a subset of every set.
3. Sets X and Y are equal (denoted X = Y ) if and only if X ⊆ Y and
Y ⊆ X.
Definition 1.4 Let S, T be sets. Then the intersection of S and T , (denoted S ∩ T ) is the set of elements common to both S and T , in detail,
S ∩ T = {x | x ∈ S and x ∈ T }.
Definition 1.5 Let S, T be sets. Then the union of S and T , (denoted
S ∪ T ) is the set of elements belonging to either or both of S and T , in
detail,
S ∪ T = {x | x ∈ S or x ∈ T }.
Definition 1.6 Let X be a set. Let S ⊆ X. Then the complement of S
in X, (denoted S or S 0 or X \ S) is the set of elements of X that do not
belong to S, in detail,
X \ S = {x | x ∈ X and x ∈
/ S}.
Note: ISAs, please draw some Venn diagrams to illustrate Definitions 1.4,
1.5 and 1.6.
Remarks:
1. Intersection and union are binary operations on the set of sets.
2. Once the universe X is fixed, complement is a unary operation on the
set of subsets of X.
2
2
Cartesian Products
Definition 2.1 Let S be a set. Let k be a positive integer. Then the k-fold
Cartesian product of S (denoted S k ) is the set of k-tuples where each
co-ordinate belongs to S, in detail,
Sk = S
· · × S} .
| × ·{z
k copies
Remarks:
1. S k is a set.
2. The most common example of a Cartesian product is the x − y-plane,
R2 .
3
Functions
Definition 3.1 Let X and Y be sets. A function f : X → Y is a rule that
takes an argument x ∈ X, and returns an outputy ∈ Y , such that whenever
x1 = x2 , it follows that f (x1 ) = f (x2 ) (i.e. the output depends only on the
input).
Function Notation:
f
: X → Y
x 7→ f (x)
ISAs, please explain the difference between → and 7→ here. This notation
has caused much confusion in the past.
4
Induction
1. Problem: Prove, for all positive integers n ≥ 1, that
n
X
i=1
i2 =
n(n + 1)(2n + 1)
n3 n2 n
=
+
+
6
3
2
6
Solution: It is an exercise to verify the algebraic identity
n(n + 1)(2n + 1)
n3 n2 n
=
+
+ .
6
3
2
6
The rest of the proof is my induction on n ≥ 1.
3
Base (n = 1): We note that
1
X
i2 = 12
i=1
13
3
+
12
2
+
1
6
= 1, and
2+3+1
=
6
= 1.
Induction (n > 1): The induction hypothesis is
n−1
X
i=1
i2 =
(n − 1)3 (n − 1)2 (n − 1)
+
+
.
3
2
6
Then we compute
n
X
i2
=
i=1
n−1
X
i 2 + n2
i=1
=
|{z}
I.H.
=
=
=
(n − 1)3 (n − 1)2 (n − 1)
+
+
+ n2
3
2
6
n3 − 3n2 + 3n − 1 n2 − 2n + 1 n − 1
+
+
+ n2
3
2
6
1
1
1
1 1 1
n3 + −1 + + 1 n2 + 1 + −1 +
n+ − + −
3
2
6
3 2 6
2
3
n
n
n
+
+ .
3
2
6
This completes the induction, and the proof.
5
5.1
Proof Techniques
Proof by Contradiction
Problem: Prove that there are infinitely many primes.
Solution: For a contradiction, assume that there are only finitely many
primes, say p1 , . . . , pk for some positive integer k. Then consider the positive
integer N = 1 + p1 · · · pk . N not prime, since it is larger than each of the pi .
However by construction, no pi can divide N , for if it did, then it would also
4
divide 1, which cannot occur. Therefore N cannot be written as a product of
primes. This contradicts the Theorem from Math 135 which says that every
positive integer can be written as a product of primes. This contradiction
completes the proof.
5