Math1081 Topic1 Notes
Math1081 Topic1 Notes
Math1081 Topic1 Notes
Greenhill
Example. We can specify a set by some property that all elements must have:
S = {x Z | x2 4}
(or S = {x Z : x2 4} ) .
The elements of A are a, {a}. Note: A set within a set represents 1 element.
So |B| = 2.
Two sets S and T are equal, denoted by S = T , if and only if (written iff)
(i) every element of S is also an element of T , and
(ii) every element of T is also an element of S .
i.e., when they have precisely the same elements.
The empty set, denoted by , is a set which has no elements. || = 0.
- has no elements.
- {} is a set containing just one element, namely, the empty set .
- {, {}} is a set containing two elements, namely, and {}.
Example. N Z Q R
Example. Let S = {a, b, c}. The subsets of S are:
, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}.
S has 8 subsets. We can write S, {b} S, {a, c} S, {a, b, c} S, etc.
The power set of S is
P (S) = {, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
and |P (S)| = 23 = 8.
We can write P (S), {b} P (S), {a, c} P (S), {a, b, c} P (S), etc.
Exercise. Let A = P (P ({1})). Find A and |A|.
3. {} B F 10. {1} B F
7. {} P (B) T
It is often convenient to work inside a specified universal set, denoted by U ,
which is assumed to contain everything that is relevant.
Venn diagrams are visualizations of sets as regions in the plane.
For instance, here is a Venn diagram of a universal set U containing a set A:
U
A
complement (c , ) - not U
Ac = A = U \ A = {x U | x
/ A} A
intersection () - and U
A B = {x U | x A and x B} B A
A = {a, c, d, e}
B = {b, d, e, f, g}
100
C++
0 19
22
9 17
21 2
Python Java
100 = 0 + 22 + 19 + 21 + 17 + 9 + 2 + x
= 90 + x
So x = 10.
Exercise. In a survey of 200 people asked about whether they like
apples (A), bananas (B), and cherries (C), the following data was obtained:
|A| = 112, |B| = 89, |C| = 71,
|A B| = 32, |A C| = 26, |B C| = 43,
|A B C| = 20.
By inclusion-exclusion, |AUB| = |A| + |B| - |AB|
a) How many people like apples or bananas? = 112 + 89 - 32 = 169.
b) How many people like exactly one of these fruit? 74 + 34 + 22 = 130.
c) How many people like none of these fruit? |AUBUC| = 112 + 34 + 23 + 22 = 191.
200
A 18 34 B
74
20 23
6
22
Let x A.
Therefore, x B C. So A B C, as required.
Exercise. Prove that if A B, then A B = A.
Therefore x A B.
Observe that A B B (true for all sets A, B). Let x A. Then x A B by assumption.
Exercise. Is the statement A(B C) = (AB)C true (for all sets A, B, C)?
Provide a proof if it is true or give a counter example if it is false.
Then A - (B - C) = A - = A,
While (A - B) - C = - C = A = {a}.
Laws of set algebra:
Commutative laws AB =BA
AB =BA
Associative laws A (B C) = (A B) C
A (B C) = (A B) C
Distributive laws A (B C) = (A B) (A C)
A (B C) = (A B) (A C)
Absorption laws A (A B) = A
A (A B) = A
Identity laws AU =U A=A
A=A=A
Idempotent laws AA=A
AA=A
Double complement law (Ac )c = A
Difference law A B = A Bc
Domination or universal bound laws A=A=
AU =U A=U
Intersection and union with complement A Ac = Ac A =
A Ac = Ac A = U
De Morgans Laws (A B)c = Ac B c (A B)c = Ac B c
U U Exampl
B A B A
Solution:
S = {A U | A
/ A}.
Is S an element of itself?
i) If S S, then the definition of S implies that S
/ S, a contradiction.
ii) If S
/ S, then the definition of S implies that S S, also a contradiction.
Hence neither S S nor S
/ S.
Usual Solution:
Key Point: Set theory is very subtle, and the notion of set must be carefully
defined. In this course, we can mostly ignore these subtleties.
When X and Y are small finite sets, we can use an arrow diagram to represent
a subset S of X Y : we list the elements of X and the elements of Y , and
then we draw an arrow from x to y for each pair (x, y) S.
Example. Let X = {a, b, c}, Y = {1, 2, 3, 4}, and S = {(a, 2), (a, 3), (c, 1)}
which is a subset of X Y , then the arrow diagram for S is
1
a
2
b
3
c
4
FUNCTIONS
Ahmed f
1
Belinda
2
Changhao
3
Dan
4
Eve
X Y
Exercise. What are the ranges of the floor and ceiling functions?
Plot the graphs of the floor and the ceiling functions.
a
1
b
2
c
3
d
4
e
The image of {a, b, e} under f is f ({a, b, e}) = {f (a), f (b), f (e)} = {2, 3}.
The inverse image of {1, 2} under f is f 1 ({1, 2}) = {b, d}.
Exercise. Let f : R R be given by f (x) = x2 . Find
(a) The image of the set {2, 2, , 2} under f .
(b) The inverse image of the set {9, 9, } under f
(c) The inverse image of the set {2, 9} under f .
a. {4, pi^2, 2}
b. {3, -3, sqrt(pi), -sqrt(pi)}
c. Empty Set.
a 1 a 1 a 1
2 2 2
b b b
c 3 c 3 c 3
f1 4 f2 4 f3 4
a 1 a a 1
1
2 2
b b 2 b
c 3 c c 3
3
f4 4 f5 f6 4
a a a a
1 1 1
b b b b 1
c 2 c 2 c 2 c
f7 f8 f9 f10
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
function
one-to-one
onto
bijection
Plot the graph in each case, and give reasons for your answers.
f1 f2 f3 f4 f5 f6
function
one-to-one
onto
bijection
For functions f : X Y and g : Y Z, the composite of f and g is the
function g f : X Z defined by (g f )(x) = g(f (x)) for all x X.
In general, g f and f g are not the same composite functions.
Associativity of composition (assuming all composites exist):
h (g f ) = (h g) f .
(f g)(y) = f (g(y)) = f (y 2 ) = y 2 + 3.
Exercise. For each of the following functions, find its inverse if it is invertible.
f : R Z, f (x) = x
g : R R+ , g(x) = e3x2
h : {1, 2, 3} {a, b, c}, h = {(1, b), (2, c), (3, a)}.
Every element of the codomain of h has exactly one arrow coming in.
So h is a bijection with inverse:
h^(-1)(a) = 3, h^(-1)(b) = 1, h^(-1)(c) = 2 | h^(-1) : {a, b, c} -> {1, 2, 3}
Example. Prove that a function has at most one inverse.
Proof. Suppose that f : X Y has two inverses g1 : Y X and g2 : Y X.
Then
g1 = g1 idY by property of identity
= g1 (f g2 ) by definition of inverse
= (g1 f ) g2 by associativity of composition
= idX g2 by definition of inverse
= g2 by property of identity
Hence, if f has an inverse, then it is unique.
Exercise. Prove that a function has an inverse if and only if it is bijective.
Exercise. Prove that if f : X Y and g : Y Z are invertible,
then so is g f : X Z, and the inverse of g f is f 1 g 1 .
SEQUENCES
a0 , a1 , a2 , . . . , ak , . . . ,
where each object ak is called a term, and the subscript k is called an index
(typically starting from 0 or 1). We denote the sequence by {ak }.
If all terms ak lie in a set A, we can think of the sequence as a function
a : N A : k 7 ak .
Example.
An arithmetic progression is a sequence {bk } where bk = a + kd for all k N
for some fixed numbers a R and d R. Its terms are
a, a + d, a + 2d, a + 3d, . . . .
Properties of summation:
n
X n
X n
X n
X n
X
(ak + bk ) = ak + bk and ( ak ) = ak ,
k=m k=m k=m k=m k=m
but in general ! !
n
X n
X n
X
ak bk 6= ak bk .
k=m k=m k=m
Example. The sum of the first n+1 terms of the arithmetic progression {a+kd}
is
n
X (2a+nd)(n+1)
(a+kd) = a + (a+d) + (a+2d) + + (a+nd) = .
k=0
2
Why?
Example. The sum of the first n + 1 terms of the geometric progression {ark }
is n
X
k 2 n a(rn+1 1)
ar = a + ar + ar + + ar = .
k=0
r 1
Why?
Exercise. Given the formulas
n n
X n(n + 1) X n(n + 1)(2n + 1)
k = and k2 = ,
k=1
2 k=1
6
evaluate
10
X
(k 3)(k + 2)
k=1
For example,
3
X 4
X 2
X
a1 + a2 + a3 = ak = aj1 = a+1 = .
k=1 j=2 =0
Exercise. Simplify
n+1
X n1
X n1
X
k2 k
x x + xk+1
k=2 k=1 k=0
Example. (A telescoping sum)
3 1 1
Using the identity = for k 1, we can write
k(k + 3) k k+3
n n
X 3 X 1 1
=
k=1
k(k + 3) k=1
k k+3
1 1 1 1 1 1 1 1 1
= 1 + + + + + .
4 2 5 3 6 4 7 n n+3
X
This is an example of a telescoping sum: ak , where ak = bk bk+d .
By changing the summation index, we see that
n n n n n+3
X 3 X 1 X 1 X 1 X1
= =
k=1
k(k + 3) k=1
k k=1
k + 3 k=1
k j=4
j
3 n
! n n+3
!
X 1 X 1 X 1 X 1
= + +
k=1
k k=4
k j=4
j j=n+1 j
1 1 1 1 1
= 1+ + .
2 3 n+1 n+2 n+3
2 1 2 1
Exercise. Use the identity = + for k 1
k(k + 1)(k + 2) k k+1 k+2
to simplify
n
X 2
k=1
k(k + 1)(k + 2)
Product notation: for m n,
n
Y
ak = am am+1 am+2 an .
k=m
Properties of product:
n n
! n
! n n n
Y Y Y Y Y Y
ak bk = ak bk but (ak + bk ) 6= ak + bk .
k=m k=m k=m k=m k=m k=m
Exercise. Simplify
n
Y k
k=1
k+3