07/04/25 1
…
… andthe following mathematical
and the following mathematical
appetizer is about…
appetizer is about…
Functions
Functions
2.
07/04/25 2
Functions
Functions
A
A function
functionf from a set A to a set B is an
f from a set A to a set B is an
assignment
assignment of exactly one element of B to each
of exactly one element of B to each
element of A.
element of A.
We write
We write
f(a) = b
f(a) = b
if b is the unique element of B assigned by the
if b is the unique element of B assigned by the
function f to the element a of A.
function f to the element a of A.
If f is a function from A to B, we write
If f is a function from A to B, we write
f: A
f: A
B
B
(note: Here, “
(note: Here, “
“ has nothing to do with if… then)
“ has nothing to do with if… then)
3.
07/04/25 3
Functions
Functions
If f:A
Iff:A
B, we say that A is the
B, we say that A is the domain
domain of f and B
of f and B
is the
is the codomain
codomain of f.
of f.
If f(a) = b, we say that b is the
If f(a) = b, we say that b is the image
image of a and a is
of a and a is
the
the pre-image
pre-image of b.
of b.
The
The range
range of f:A
of f:A
B is the set of all images of
B is the set of all images of
elements of A.
elements of A.
We say that f:A
We say that f:A
B
B maps
maps A to B.
A to B.
4.
07/04/25 4
Functions
Functions
Let ustake a look at the function f:P
Let us take a look at the function f:P
C with
C with
P = {Linda, Max, Kathy, Peter}
P = {Linda, Max, Kathy, Peter}
C = {Boston, New York, Hong Kong, Moscow}
C = {Boston, New York, Hong Kong, Moscow}
f(Linda) = Moscow
f(Linda) = Moscow
f(Max) = Boston
f(Max) = Boston
f(Kathy) = Hong Kong
f(Kathy) = Hong Kong
f(Peter) = New York
f(Peter) = New York
Here, the range of f is C.
Here, the range of f is C.
5.
07/04/25 5
Functions
Functions
Let usre-specify f as follows:
Let us re-specify f as follows:
f(Linda) = Moscow
f(Linda) = Moscow
f(Max) = Boston
f(Max) = Boston
f(Kathy) = Hong Kong
f(Kathy) = Hong Kong
f(Peter) = Boston
f(Peter) = Boston
Is f still a function?
Is f still a function? yes
yes
{Moscow, Boston, Hong Kong}
{Moscow, Boston, Hong Kong}
What is its range?
What is its range?
6.
07/04/25 6
Functions
Functions
Other waysto represent f:
Other ways to represent f:
Boston
Boston
Peter
Peter
Hong
Hong
Kong
Kong
Kathy
Kathy
Boston
Boston
Max
Max
Moscow
Moscow
Linda
Linda
f(x)
f(x)
x
x Linda
Linda
Max
Max
Kathy
Kathy
Peter
Peter
Boston
Boston
New York
New York
Hong Kong
Hong Kong
Moscow
Moscow
7.
07/04/25 7
Functions
Functions
If thedomain of our function f is large, it is
If the domain of our function f is large, it is
convenient to specify f with a
convenient to specify f with a formula
formula, e.g.:
, e.g.:
f:
f:R
R
R
R
f(x) = 2x
f(x) = 2x
This leads to:
This leads to:
f(1) = 2
f(1) = 2
f(3) = 6
f(3) = 6
f(-3) = -6
f(-3) = -6
…
…
8.
07/04/25 8
Functions
Functions
Let f
Letf1
1 and f
and f2
2 be functions from A to
be functions from A to R
R.
.
Then the
Then the sum
sum and the
and the product
product of f
of f1
1 and f
and f2
2 are also
are also
functions from A to
functions from A to R
R defined by:
defined by:
(f
(f1
1 + f
+ f2
2)(x) = f
)(x) = f1
1(x) + f
(x) + f2
2(x)
(x)
(f
(f1
1f
f2
2)(x) = f
)(x) = f1
1(x) f
(x) f2
2(x)
(x)
Example:
Example:
f
f1
1(x) = 3x, f
(x) = 3x, f2
2(x) = x + 5
(x) = x + 5
(f
(f1
1 + f
+ f2
2)(x) = f
)(x) = f1
1(x) + f
(x) + f2
2(x) = 3x + x + 5 = 4x + 5
(x) = 3x + x + 5 = 4x + 5
(f
(f1
1f
f2
2)(x) = f
)(x) = f1
1(x) f
(x) f2
2(x) = 3x (x + 5) = 3x
(x) = 3x (x + 5) = 3x2
2
+ 15x
+ 15x
9.
07/04/25 9
Functions
Functions
We alreadyknow that the
We already know that the range
range of a function
of a function
f:A
f:A
B is the set of all images of elements a
B is the set of all images of elements a
A.
A.
If we only regard a
If we only regard a subset
subset S
S
A, the set of all
A, the set of all
images of elements s
images of elements s
S is called the
S is called the image
image of S.
of S.
We denote the image of S by f(S):
We denote the image of S by f(S):
f(S) = {f(s) | s
f(S) = {f(s) | s
S}
S}
10.
07/04/25 10
Functions
Functions
Let uslook at the following well-known function:
Let us look at the following well-known function:
f(Linda) = Moscow
f(Linda) = Moscow
f(Max) = Boston
f(Max) = Boston
f(Kathy) = Hong Kong
f(Kathy) = Hong Kong
f(Peter) = Boston
f(Peter) = Boston
What is the image of S = {Linda, Max} ?
What is the image of S = {Linda, Max} ?
f(S) = {Moscow, Boston}
f(S) = {Moscow, Boston}
What is the image of S = {Max, Peter} ?
What is the image of S = {Max, Peter} ?
f(S) = {Boston}
f(S) = {Boston}
11.
07/04/25 11
Properties ofFunctions
Properties of Functions
A function f:A
A function f:A
B is said to be
B is said to be one-to-one
one-to-one (or
(or
injective
injective), if and only if
), if and only if
x, y
x, y
A (f(x) = f(y)
A (f(x) = f(y)
x = y)
x = y)
In other words:
In other words: f is one-to-one if and only if it
f is one-to-one if and only if it
does not map two distinct elements of A onto the
does not map two distinct elements of A onto the
same element of B.
same element of B.
12.
07/04/25 12
Properties ofFunctions
Properties of Functions
And again…
And again…
f(Linda) = Moscow
f(Linda) = Moscow
f(Max) = Boston
f(Max) = Boston
f(Kathy) = Hong Kong
f(Kathy) = Hong Kong
f(Peter) = Boston
f(Peter) = Boston
Is f one-to-one?
Is f one-to-one?
No, Max and Peter are
No, Max and Peter are
mapped onto the same
mapped onto the same
element of the image.
element of the image.
g(Linda) = Moscow
g(Linda) = Moscow
g(Max) = Boston
g(Max) = Boston
g(Kathy) = Hong Kong
g(Kathy) = Hong Kong
g(Peter) = New York
g(Peter) = New York
Is g one-to-one?
Is g one-to-one?
Yes, each element is
Yes, each element is
assigned a unique
assigned a unique
element of the image.
element of the image.
13.
07/04/25 13
Properties ofFunctions
Properties of Functions
How can we prove that a function f is one-to-one?
How can we prove that a function f is one-to-one?
Whenever you want to prove something, first take
Whenever you want to prove something, first take
a look at the relevant definition(s):
a look at the relevant definition(s):
x, y
x, y
A (f(x) = f(y)
A (f(x) = f(y)
x = y)
x = y)
Example:
Example:
f:
f:R
R
R
R
f(x) = x
f(x) = x2
2
Disproof by counterexample:
f(3) = f(-3), but 3
f(3) = f(-3), but 3
-3, so f is not one-to-one.
-3, so f is not one-to-one.
14.
07/04/25 14
Properties ofFunctions
Properties of Functions
…
… and yet another example:
and yet another example:
f:
f:R
R
R
R
f(x) = 3x
f(x) = 3x
One-to-one:
One-to-one:
x, y
x, y
A (f(x) = f(y)
A (f(x) = f(y)
x = y)
x = y)
To show:
To show: f(x)
f(x)
f(y) whenever x
f(y) whenever x
y
y
x
x
y
y
3x
3x
3y
3y
f(x)
f(x)
f(y),
f(y),
so if x
so if x
y, then f(x)
y, then f(x)
f(y), that is, f is one-to-one.
f(y), that is, f is one-to-one.
15.
07/04/25 15
Properties ofFunctions
Properties of Functions
A function f:A
A function f:A
B with A,B
B with A,B
R is called
R is called strictly
strictly
increasing
increasing, if
, if
x,y
x,y
A (x < y
A (x < y
f(x) < f(y)),
f(x) < f(y)),
and
and strictly decreasing
strictly decreasing, if
, if
x,y
x,y
A (x < y
A (x < y
f(x) > f(y)).
f(x) > f(y)).
Obviously, a function that is either strictly
Obviously, a function that is either strictly
increasing or strictly decreasing is
increasing or strictly decreasing is one-to-one
one-to-one.
.
16.
07/04/25 16
Properties ofFunctions
Properties of Functions
A function f:A
A function f:A
B is called
B is called onto
onto, or
, or surjective
surjective, if
, if
and only if for every element b
and only if for every element b
B there is an
B there is an
element a
element a
A with f(a) = b.
A with f(a) = b.
In other words, f is onto if and only if its
In other words, f is onto if and only if its range
range is
is
its
its entire codomain
entire codomain.
.
A function f: A
A function f: A
B is a
B is a one-to-one correspondence
one-to-one correspondence,
,
or a
or a bijection
bijection, if and only if it is both one-to-one
, if and only if it is both one-to-one
and onto.
and onto.
Obviously, if f is a bijection and A and B are finite
Obviously, if f is a bijection and A and B are finite
sets, then |A| = |B|.
sets, then |A| = |B|.
17.
07/04/25 17
Properties ofFunctions
Properties of Functions
Examples:
Examples:
In the following examples, we use the arrow
In the following examples, we use the arrow
representation to illustrate functions f:A
representation to illustrate functions f:A
B.
B.
In each example, the complete sets A and B are
In each example, the complete sets A and B are
shown.
shown.
18.
07/04/25 18
Properties ofFunctions
Properties of Functions
Is f injective?
Is f injective?
No.
No.
Is f surjective?
Is f surjective?
No.
No.
Is f bijective?
Is f bijective?
No.
No.
Linda
Linda
Max
Max
Kathy
Kathy
Peter
Peter
Boston
Boston
New York
New York
Hong Kong
Hong Kong
Moscow
Moscow
19.
07/04/25 19
Properties ofFunctions
Properties of Functions
Is f injective?
Is f injective?
No.
No.
Is f surjective?
Is f surjective?
Yes.
Yes.
Is f bijective?
Is f bijective?
No.
No.
Linda
Linda
Max
Max
Kathy
Kathy
Peter
Peter
Boston
Boston
New York
New York
Hong Kong
Hong Kong
Moscow
Moscow
Paul
Paul
20.
07/04/25 20
Properties ofFunctions
Properties of Functions
Is f injective?
Is f injective?
Yes.
Yes.
Is f surjective?
Is f surjective?
No.
No.
Is f bijective?
Is f bijective?
No.
No.
Linda
Linda
Max
Max
Kathy
Kathy
Peter
Peter
Boston
Boston
New York
New York
Hong Kong
Hong Kong
Moscow
Moscow
L
Lü
übeck
beck
21.
07/04/25 21
Properties ofFunctions
Properties of Functions
Is f injective?
Is f injective?
No! f is not even
No! f is not even
a function!
a function!
Linda
Linda
Max
Max
Kathy
Kathy
Peter
Peter
Boston
Boston
New York
New York
Hong Kong
Hong Kong
Moscow
Moscow
L
Lü
übeck
beck
22.
07/04/25 22
Properties ofFunctions
Properties of Functions
Is f injective?
Is f injective?
Yes.
Yes.
Is f surjective?
Is f surjective?
Yes.
Yes.
Is f bijective?
Is f bijective?
Yes.
Yes.
Linda
Linda
Max
Max
Kathy
Kathy
Peter
Peter
Boston
Boston
New York
New York
Hong Kong
Hong Kong
Moscow
Moscow
L
Lü
übeck
beck
Helena
Helena
23.
07/04/25 23
Inversion
Inversion
An interestingproperty of bijections is that
An interesting property of bijections is that
they have an
they have an inverse function
inverse function.
.
The
The inverse function
inverse function of the bijection f:A
of the bijection f:A
B is
B is
the function f
the function f-1
-1
:B
:B
A with
A with
f
f-1
-1
(b) = a whenever f(a) = b.
(b) = a whenever f(a) = b.
24.
07/04/25 24
Inversion
Inversion
Example:
Example:
f(Linda) =Moscow
f(Linda) = Moscow
f(Max) = Boston
f(Max) = Boston
f(Kathy) = Hong Kong
f(Kathy) = Hong Kong
f(Peter) = L
f(Peter) = Lü
übeck
beck
f(Helena) = New York
f(Helena) = New York
Clearly, f is bijective.
Clearly, f is bijective.
The inverse function f
The inverse function f-
-
1
1
is given by:
is given by:
f
f-1
-1
(Moscow) = Linda
(Moscow) = Linda
f
f-1
-1
(Boston) = Max
(Boston) = Max
f
f-1
-1
(Hong Kong) = Kathy
(Hong Kong) = Kathy
f
f-1
-1
(L
(Lü
übeck) = Peter
beck) = Peter
f
f-1
-1
(New York) = Helena
(New York) = Helena
Inversion is only
Inversion is only
possible for bijections
possible for bijections
(= invertible functions)
(= invertible functions)
25.
07/04/25 25
Inversion
Inversion
Linda
Linda
Max
Max
Kathy
Kathy
Peter
Peter
Boston
Boston
New York
NewYork
Hong Kong
Hong Kong
Moscow
Moscow
L
Lü
übeck
beck
Helena
Helena
f
f
f
f-1
-1
f
f-1
-1
:C
:C
P is no
P is no
function, because
function, because
it is not defined
it is not defined
for all elements of
for all elements of
C and assigns two
C and assigns two
images to the pre-
images to the pre-
image New York.
image New York.
26.
07/04/25 26
Composition
Composition
The
The composition
compositionof two functions g:A
of two functions g:A
B and
B and
f:B
f:B
C, denoted by f
C, denoted by f
g, is defined by
g, is defined by
(f
(f
g)(a) = f(g(a))
g)(a) = f(g(a))
This means that
This means that
• first
first, function g is applied to element a
, function g is applied to element a
A,
A,
mapping it onto an element of B,
mapping it onto an element of B,
• then
then, function f is applied to this element of
, function f is applied to this element of
B, mapping it onto an element of C.
B, mapping it onto an element of C.
• Therefore
Therefore, the composite function maps
, the composite function maps
from A to C.
from A to C.
07/04/25 28
Composition
Composition
Composition ofa function and its inverse:
Composition of a function and its inverse:
(f
(f-1
-1
f)(x) = f
f)(x) = f-1
-1
(f(x)) = x
(f(x)) = x
The composition of a function and its inverse
The composition of a function and its inverse
is the
is the identity function
identity function i(x) = x.
i(x) = x.
29.
07/04/25 29
Graphs
Graphs
The
The graph
graphof a function
of a function f:A
f:A
B is the set of
B is the set of
ordered pairs {(a, b) | a
ordered pairs {(a, b) | a
A and f(a) = b}.
A and f(a) = b}.
The graph is a subset of A
The graph is a subset of A
B that can be
B that can be
used to visualize f in a two-dimensional
used to visualize f in a two-dimensional
coordinate system.
coordinate system.
30.
07/04/25 30
Floor andCeiling Functions
Floor and Ceiling Functions
The
The floor
floor and
and ceiling
ceiling functions map the real
functions map the real
numbers onto the integers (
numbers onto the integers (R
R
Z
Z).
).
The
The floor
floor function assigns to r
function assigns to r
R
R the largest
the largest
z
z
Z
Z with z
with z
r, denoted by
r, denoted by
r
r
.
.
Examples:
Examples:
2.3
2.3
= 2,
= 2,
2
2
= 2,
= 2,
0.5
0.5
= 0,
= 0,
-3.5
-3.5
= -4
= -4
The
The ceiling
ceiling function assigns to r
function assigns to r
R
R the smallest
the smallest
z
z
Z
Z with z
with z
r, denoted by
r, denoted by
r
r
.
.
Examples:
Examples:
2.3
2.3
= 3,
= 3,
2
2
= 2,
= 2,
0.5
0.5
= 1,
= 1,
-3.5
-3.5
= -3
= -3