You are on page 1of 27

MATH1081 Discrete Mathematics F. Kuo/T. Britz/D. Chan/D. Trenerry/C.

Greenhill

§1 Sets, Functions, and Sequences


SETS

A set is a well-defined collection of distinct objects.


An element of a set is any object in the set.
∈ - “belongs to” or “is an element of” or “is in”

/ - “does not belong to” or “is not an element of” or “is not in”
The cardinality of a set S, denoted by |S|, is the number of elements in S.

Example. Some commonly-used sets in our number system:


N - the set of natural numbers 0, 1, 2, 3, . . .
Z - the set of integers (whole numbers) . . . , −3, −2, −1, 0, 1, 2, 3, . . .
Q - the set of rational numbers (fractions) . . . , −1, 0, 1, 2, 12 , 3, 31 , 23 , . . .
R - the set of real numbers, which includes all rational
√ numbers
as well as irrational numbers such as π, e, and 2
R+ - the set of all positive real numbers
Example. We can specify a set by listing its elements between curly brackets,
separated by commas:
S = {b, c} .
The elements of S are . Thus |S| = 2.
We can write b ∈ S, c ∈ S, and d ∈
/ S, for instance.

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 S are −2, −1, 0, 1 and 2. Thus |S| = 5.


Also S = {−2, −1, 0, 1, 2}.
We can write −2 ∈ S, −1 ∈ S, 0 ∈ S, 1 ∈ S, and 4 ∈/ S, for instance.
Exercise. Let A = {{a}, a}. What are the elements of A? What is |A|?
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. |∅| =

Exercise. Are any of the following sets equal?


A = {2, 3, 4, 5}, C = {2, 2, 3, 3, 4, 5},
B = {5, 4, 3, 2}, D = {x ∈ N | 2 ≤ x ≤ 5}.

Exercise. What is the difference between the sets ∅, {∅} and {∅, {∅}}?

Loosely speaking, a subset is a part of a set. More precisely, a set S is a


subset of a set T if and only if each element of S is also an element of T.
⊆ - “is a subset of”, 6⊆ - “is not a subset of”
⋆ S = T if and only if S ⊆ T and T ⊆ S.
A set S is a proper subset of a set T iff S is a subset of T and S 6= T .
We then write S ( T (or sometimes S ⊂ T ).
⋆ ∅ is a proper subset of any non-empty set.
⋆ Any non-empty set is an improper subset of itself.
The power set P (S) of a set S is the set of all possible subsets of S.
⋆ For any set S, we have ∅ ⊆ S and S ⊆ S.
⋆ For any set S, we have ∅ ∈ P (S) and S ∈ P (S).
If |S| is finite then the number of subsets of S is |P (S)| = 2|S| . (Why? )

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

Exercise. For B = {∅, 0, {1}}, are the following statements true or false?
1. ∅∈B 8. {{0}} ⊆ P (B)
2. ∅⊆B 9. 1∈B
3. {∅} ∈ B 10. {1} ⊆ B
4. {∅} ⊆ P (B) 11. {1} ∈ P (B)
5. {0} ∈ P (B) 12. {{1}} ⊆ P (B)
6. {∅} ( B 13. ∅ ∈ P (P (P (P (B))))
7. {∅} ∈ P (B)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 1 - 8.


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

Set operations and set algebra: ∼ illustrated by Venn diagrams ∼


difference (−,\) - “but not” U
A − B = A \ B = {x ∈ U | x ∈ A and x 6∈ B} B A

complement (c , ) - “not” U

Ac = A = U \ A = {x ∈ U | x ∈
/ A} A

union (∪) - “or” meaning “one or other or both” U


A ∪ B = {x ∈ U | x ∈ A or x ∈ B} B A

intersection (∩) - “and” U


A ∩ B = {x ∈ U | x ∈ A and x ∈ B} B A

Two sets A and B are disjoint if A ∩ B = ∅.


The Inclusion-Exclusion Principle: |A ∪ B| = |A| + |B| − |A ∩ B|.

Example. Set U = {1, 2, 3, 4, 5, 6}, A = {1, 3, 5}, and B = {1, 2}.


Then

Ac = {2, 4, 6} A ∩ B = {1} A ∪ B = {1, 2, 3, 5} A − B = {3, 5} .


Exercise. Given U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9},
A = {x ∈ U | x is odd}
B = {x ∈ U | x is even}
C = {x ∈ U | x is a multiple of 3}
D = {x ∈ U | x is prime}
determine the following sets:
A∩C
B−D
B∪D
Ac
(A ∩ C) − D

Exercise. Determine the sets A and B, where


A − B = {a, c}, B − A = {b, f, g}, and A ∩ B = {d, e}.

Example. In a survey of 100 students majoring in computer science,


the following information was obtained:
17 can program in C++ , Java, and Python.
22 can program in C++ and Java, but not Python.
9 can program in C++ and Python, but not Java.
2 can program in Java and Python, but not C++ .
19 can program in C++ , but not Python or Java.
21 can program in Python, but not C++ or Java.
Also, all of the 100 students can program in at least one of these three languages.
How many students can program in Java, but not C++ or Python?

C++

Python Java
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.
a) How many people like apples or bananas?
b) How many people like exactly one of these fruit?
c) How many people like none of these fruit?

Hints for proofs:


To prove that S ⊆ T , we assume that x ∈ S and show that x ∈ T .
To prove that S = T , we show that S ⊆ T and T ⊆ S.

Example. We prove that if A ⊆ C and B ⊆ C, then A ∪ B ⊆ C.


Proof. Let A ⊆ C and B ⊆ C and suppose that x ∈ A ∪ B.
Then either x ∈ A or x ∈ B (maybe both).
If x ∈ A, then x ∈ C, because A ⊆ C.
Likewise, if x ∈ B, then x ∈ C, since B ⊆ C.
In all possible cases, we have x ∈ C, which proves that A ∪ B ⊆ C.
Exercise. Prove that if A ⊆ B and A ⊆ C, then A ⊆ B ∩ C.
Exercise. Prove that if A ⊆ B, then A ∩ B = A.

Exercise. Prove that if A ∩ B = A, then A ⊆ B.

Combining these examples, we see that A ∩ B = A if and only if A ⊆ B.

Exercise. Is the statement A∩(B ∪C) = (A∩B)∪C true (for all sets A, B, C)?
Provide a proof if it is true or give a counter example if it is false.

A wrong answer is “False: because LHS is (A ∩ B) ∪ (A ∩ C) not (A ∩ B) ∪ C.”

Exercise. Is the statement A − (B − C) = (A − B) − C true?


Provide a proof if it is true or give a counter example if it is false.

. . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 9–13 and 18.


Laws of set algebra:
Commutative laws A∩B =B∩A
A∪B =B∪A
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 A∩U =U ∩A=A
A∪∅=∅∪A=A
Idempotent laws A∩A=A
A∪A=A
Double complement law (Ac )c = A
Difference law A − B = A ∩ Bc
Domination or universal bound laws A∩∅=∅∩A=∅
A∪U =U ∪A=U
Intersection and union with complement A ∩ Ac = Ac ∩ A = ∅
A ∪ Ac = Ac ∪ A = U
De Morgan’s Laws (A ∪ B)c = Ac ∩ B c (A ∩ B)c = Ac ∪ B c

U U Exampl
B A B A

Proof of De Morgan’s law (A ∪ B)c = Ac ∩ B c :


(i) Suppose that x ∈ (A ∪ B)c . Then we have x ∈
/ A ∪ B, so x ∈
/ A and x ∈
/ B.
c c c c
Thus, x ∈ A and x ∈ B , so x ∈ A ∩ B .
This proves that (A ∪ B)c ⊆ Ac ∩ B c .
(ii) Suppose now that x ∈ Ac∩B c . Then x ∈ Ac and x ∈ B c , so x ∈
/ A and x ∈
/ B.
c
Thus, x ∈
/ A ∪ B, so x ∈ (A ∪ B) .
This proves that Ac ∩ B c ⊆ (A ∪ B)c .
Combining (i) and (ii), we conclude that (A ∪ B)c = Ac ∩ B c .
Example. We can use the laws of set algebra to simplify (Ac ∩ B)c ∪ B:

(Ac ∩ B)c ∪ B = ((Ac )c ∪ B c ) ∪ B De Morgan’s law


= (A ∪ B c ) ∪ B Double complement law
= A ∪ (B c ∪ B) Associative law
= A∪U Union with complement
= U Domination

Exercise. Use the laws of set algebra to simplify (A ∩ (A ∩ B)c ) ∪ B c :

Exercise. Use the laws of set algebra to simplify


([(A ∪ B)c ∪ C] ∪ B c )c

Challenge: Prove the result (uniqueness of complement):


If A ∪ B = U and A ∩ B = ∅ then B = Ac .
Principal of Duality:
For a set identity involving only unions, intersections and complements, its
dual is obtained by replacing ∩ with ∪, ∪ with ∩, ∅ with U , and U with ∅.
As all the relevant laws of set algebra come in dual pairs, then
the dual of any true set identity is also true.

The duals of the last 3 examples are:

. . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 15–17 and 19, 20.


Generalized set operations:
n
[ n
\
Ai = A1 ∪ A2 ∪ · · · ∪ An and Ai = A1 ∩ A2 ∩ · · · ∩ An
i=1 i=1

Example. If Ak = {k, k + 1} for every positive integer k, then


3
[
Ak = A1 ∪ A2 ∪ A3 = {1, 2} ∪ {2, 3} ∪ {3, 4} = {1, 2, 3, 4}
k=1
\3
Ak =
k=1

Let I be an (index) set. For each i ∈ I, let Ai be a subset of a given set A.


[ S
Ai = i∈I Ai = {a ∈ A | a ∈ Ai for some i ∈ I}
i∈I
\ T
Ai = i∈I Ai = {a ∈ A | a ∈ Ai for every i ∈ I}
i∈I
Example.
Let I = {1, 2, 3, . . .} be the index set. For each i ∈ I let
Ai = [0, 1i ] ⊆ R be the set of real numbers between
1
0 and i
including 0 and 1i .

Ai = [0, 1] ∪ [0, 21 ] ∪ [0, 13 ] ∪ · · · =


S
i∈I

Ai = [0, 1] ∩ [0, 21 ] ∩ [0, 13 ] ∩ · · · =


T
i∈I

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 22, 23.


Example. (The Barber Puzzle) In a certain town there is a barber
(*) who shaves all those men, and only those, who do not shave themselves.
Does the barber shave himself?

Problem: If he shaves himself, (*) =⇒ he doesn’t shave himself.


If he doesn’t shave himself, (*) =⇒ he shaves himself.
CONTRADICTION!

Solution:

The paradox occurred because a self-referential statement was used.


The “themself” in (*) could also refer to the barber, which causes problems.
This is avoided if we assume that the barber is from out of town.
Example. (Russell’s Paradox)
Let U be the set of all sets.
First weird phenomenon: then U ∈ U .
Even worse, we have Russell’s paradox. Let

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.

An ordered pair is a collection of two objects in a specified order.


We use round brackets to denote ordered pairs; e.g., (a, b) is an ordered pair.
Note that (a, b) and (b, a) are different ordered pairs,
whereas {a, b} and {b, a} are the same set.
An ordered n-tuple is a collection of n objects in a specified order;
e.g., (a1 , a2 , . . . , an ) is an ordered n-tuple.
Two ordered n-tuples (a1 , a2 , . . . , an ) and (b1 , b2 , . . . , bn ) are equal
if and only if ai = bi for all i = 1, 2, . . . , n.
The Cartesian product of two sets A and B, denoted by A × B,
is the set of all ordered pairs, the first from A, the second from B:
A × B = {(a, b) | a ∈ A and b ∈ B}

⋆ If |A| = m and |B| = n, then we have |A × B| =


The Cartesian product of n sets A1 , A2 , . . . , An is the set of all
ordered n-tuples (a1 , a2 , . . . , an ) such that ai ∈ Ai for all i = 1, 2, . . . , n:
A1 ×A2 ×· · ·×An = {(a1 , a2 , . . . , an ) | ai ∈ Ai for all i = 1, 2, . . . , n}
Example. Let A = {a, b} and B = {1, 2, 3}. Then
A × B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)} .

Exercise. For A in the above example, find A × A.

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

. . . . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 14 and 21.


FUNCTIONS

A function f from a set X to a set Y is a subset of X × Y such that


for every x ∈ X there is exactly one y ∈ Y for which (x, y) belongs to f .
We write f : X → Y and say that “f is a function from X to Y ”.
X is the domain of f , Y is the codomain of f .
For any x ∈ X, there is a unique y ∈ Y for which (x, y) belongs to f .
We write f (x) = y or f : x 7→ y.
We call y “the image of x under f ” or “the value of f at x”.
The range of f is the set of all values of f , that is
f (X) = {y ∈ Y | y = f (x) for some x ∈ X}.
This definition of a function corresponds to what is normally thought of as
the graph of a function, with an x-axis and a y-axis.
How does this relate to the definition of a function given in Calculus in
MATH1131/1141/1151?
Example. Ahmed, Belinda, Changhao, Dan and Eve were each given a mark
out of 4. Their marks define a function f : X → Y as follows:
domain X = {Ahmed, Belinda, Changhao, Dan, Eve}
codomain Y = {1, 2, 3, 4},
and suppose f = {(Ahmed, 3), (Belinda, 2), (Changhao, 4), (Dan, 2), (Eve, 3)}.

The arrow diagram for this function is

Ahmed f
1
Belinda
2
Changhao
3
Dan
4
Eve

X Y

This is a function because every person has exactly one mark.


The range of this function is {2, 3, 4}.
Exercise. Let X = {a, b, c} and Y = {1, 2, 3, 4, 5}.
Determine whether or not each of the following is a function from X to Y .
If it is, then write down its range.
f = {(a, 2), (a, 4), (b, 3), (c, 5)},
g = {(b, 1), (c, 3)},
h = {(a, 5), (b, 2), (c, 2)}.

Example. The square function f : R → R is defined by set of the pairs


{(x, y) ∈ R × R | y = x2 }.
The function f : R → R can also be specified by
f (x) = x2 or f : x 7→ x2 .
The domain of f is R; the codomain of f is R; and the range of f is
{y ∈ R | y = x2 for some x ∈ R} = {y ∈ R | y ≥ 0} = R+ ∪ {0}.

The floor function: (round down)


for any x ∈ R, we denote by ⌊x⌋ the largest integer less than or equal to x.
The ceiling function: (round up)
for any x ∈ R, we denote by ⌈x⌉ the smallest integer greater than or equal to x.

Exercise. Evaluate the following:


⌊3.7⌋ = ⌊−3.7⌋ = ⌊3⌋ = ⌊−3⌋ =
⌈3.7⌉ = ⌈−3.7⌉ = ⌈3⌉ = ⌈−3⌉ =

Exercise. What are the ranges of the floor and ceiling functions?
Plot the graphs of the floor and the ceiling functions.
Exercise. Determine whether or not each of the following definitions
corresponds to a function. If it does, then write down its range.
1
f : R → R, f (x) = x
g : R+ → R, g(x) = 1
x
h : R → R, h(x) = ⌊x2 − x⌋
j : R → Z j(x) = 2x

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 24–26.

The image of a set A ⊆ X under a function f : X → Y is


f (A) = {y ∈ Y | y = f (x) for some x ∈ A} = {f (x) | x ∈ A} ⊆ Y .
The inverse image of a set B ⊆ Y under a function f : X → Y is
f −1 (B) = {x ∈ X | f (x) ∈ B} ⊆ X.

Example. Let the function f be defined by the arrow diagram

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 .

. . . . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 36 and 38.


Recall that if f is a function from X to Y , then
for every x ∈ X, there is exactly one y ∈ Y such that f (x) = y.
We say that a function f : X → Y is one-to-one or injective iff
for every y ∈ Y , there is at most one x ∈ X such that f (x) = y.
OR equivalently, for all x1 , x2 ∈ X, if f (x1 ) = f (x2 ) then x1 = x2 .
OR equivalently, for all x1 , x2 ∈ X, if x1 6= x2 then f (x1 ) 6= f (x2 ).
We say that a function f : X → Y is onto or surjective iff
for every y ∈ Y , there is at least one x ∈ X such that f (x) = y.
the range of f is the same as the codomain of f .
We say that a function f : X → Y is a bijection (or is a bijective function) iff
f is both one-to-one and onto (injective and surjective).
for every y ∈ Y , there is exactly one x ∈ X such that f (x) = y.

In terms of arrow diagrams and graphs...

The arrow diagram for f : X → Y The graph for f : R → R


function has exactly one outgoing arrow intersects each vertical line
for each element of X in exactly one point
one-to-one has at most one incoming arrow intersects each horizontal line
injective for each element of Y in at most one point
onto has at least one incoming arrow intersects each horizontal line
surjective for each element of Y in at least one point
a bijection has exactly one incoming arrow intersects each horizontal line
for each element of Y in exactly one point

Example. The function f : R → R, f (x) = x2 is neither one-to-one nor onto.


Exercise. Determine whether or not each of the following arrow diagrams
corresponds to a function. If it does, then determine whether or not it is one-
to-one, onto, or a bijection.

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
Exercise. Which of the following definitions correspond to functions?
Which of the functions are one-to-one? onto? a bijection?

f1 : R → R, f1 (x) = x
f2 : R → R, f2 (x) = x2
f3 : R → (R+ ∪ {0}), f3 (x) = x2
f4 : R+ → R+ , f4 (x) = x2
f5 : (R − {0}) → R, f5 (x) = x1
f6 : R → R, f6 (x) = x2 − 2x − 2

Plot the graph in each case, and give reasons for your answers.
f1 f2 f3 f4 f5 f6
function
one-to-one
onto
bijection

. . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 27–31 and 37.


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 .

Example. Let f and g be functions defined by

f : N → Z, f (x) = x + 3 and g : Z → Z, g(y) = y 2 .

Then the composite function g ◦ f : N → Z exists because


codomain of f = Z = domain of g.
It is given by

(g ◦ f )(x) = g(f (x)) = g(x + 3) = (x + 3)2 = x2 + 6x + 9 .

Note, f ◦ g is not defined as codomain of g = Z 6= N = domain of f .


But the range of g is a subset of N, so we can re-define g to be closely related
function g : Z → N : y 7→ y 2 . Then f ◦ g is defined and

(f ◦ g)(y) = f (g(y)) = f (y 2 ) = y 2 + 3.

Note f ◦ g 6= g ◦ f . In particular, these two functions have different domains.


Exercise. Let A = {1, 2} and f : A → A be defined by

f = {(1, 2), (2, 1)}.

Find the composite f ◦ f : A −→ A.

The identity function on a set X is the function idX : X → X, idX (x) = x.


For any function f : X → Y , we have f ◦ idX = f = idY ◦ f .
A function g : Y → X is an inverse of f : X → Y if and only if

g(f (x)) = x for all x ∈ X, and f (g(y)) = y for all y ∈ Y,

or equivalently, g ◦ f = idX and f ◦ g = idY .


Thus x = g(y) “solves” f (x) = y
THEOREM: A function can have at most one inverse.
If f : X → Y has an inverse, then we say that f is invertible, and we denote
the inverse of f by f −1 . Thus, f −1 ◦ f = idX and f ◦ f −1 = idY .
If g is the inverse of f , then f is the inverse of g. Thus, (f −1 )−1 = f .
THEOREM: A function is invertible if and only if it is bijective.
THEOREM: 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 .
Example. Let f : R → R be defined by f (x) = 2x − 5.
To find the inverse f −1 , solve the equation y = f (x) with respect to x:
y+5
y = 2x − 5 ⇒ x= 2
.
y+5
Thus, f −1 : R → R is given by f −1 (y) = 2
.

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) = e3x−2
h : {1, 2, 3} → {a, b, c}, h = {(1, b), (2, c), (3, a)}.

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 .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 32–35.


SEQUENCES

Informally speaking, a sequence is an ordered list of objects,

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

A geometric progression is a sequence {ck } defined by ck = ark for all k ∈ N


for some fixed numbers a ∈ R and r ∈ R. Its terms are
a, ar, ar2 , ar3 , . . . .
Summation notation: for m ≤ n,
n
X
ak = am + am+1 + am+2 + · · · + an .
k=m

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?

We find a formula for the sum of the first n positive integers,


by setting a = 0 and d = 1:
n
X n(n + 1)
1 + 2 + ··· + n = 0 + 1 + 2 + ··· + n = k = .
k=0
2

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
Exercise. Use the formula for the geometric progression to evaluate
40
X
(3k + 2)2
k=11

Example. (Change of summation index)


The sum
5
X 1
k=1
k+2
can be transformed by a change of variable like j = k + 2 as follows:
Lower limit: when k = 1, we have j = 1 + 2 = 3.
Upper limit: when k = 5, we have j = 5 + 2 = 7.
1 1
General term: we have = .
k+2 j
Thus, we obtain
5 7
X 1 X 1
= .
k=1
k + 2 j=3
j
Here j is a dummy variable, and could be replaced by any symbol, including k
again:
5 7 7
X 1 X 1 X 1
= = .
k=1
k + 2 j=3
j k=3
k
But it is often clearer to use different dummy symbols after a change of variables.
More generally, for any sequence {ak } and any integer d we have
n
X n+d
X
ak = aj−d .
k=m j=m+d

For example,
3
X 4
X 2
X
a1 + a2 + a3 = ak = aj−1 = aℓ+1 = · · · .
k=1 j=2 ℓ=0

Exercise. Simplify
n+1
X n−1
X n−1
X
k−2 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 k+3
  k=1       
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

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Now try Problem Set 1, Questions 39–44.

You might also like