Slide 2 - Function
Slide 2 - Function
1
Every extraordinary feat began in ordinary circumstances. I will start my journey of success from where I am now.
Function
Definition
• Let A and B be sets. A function f from A to B is an assignment of
exactly one element of B to each element of A.
f maps R to
R Z
Domain Z Co-domain
f
f(4.3
4.3 ) 4
Topu A “a” 1
x B “bb” 2
Nahid C “cccc” 3
y D “dd” 4
z F “e” 5
Range
a 1 “a” 1
e 2 “bb“ 2
i 3 “cccc” 3
o 4 “dd” 4
u 5 “e” 5
• f(x) = x2
• f grading system
• f(x) = 0.1x
One to One Function
One-to-one functions
Definition
A function is one-to-one if elements in the co-domain has a unique pre-
image
a 1 a 1
e 2 e 2
i 3 i 3
o 4 o 4
5 5
A one-to-one function
OneMore
to One Function
on one-to-one
• Determine whether the function f(x) = x+1 from the set of integers to
the set of integers is one-to-one?
Onto functions
Definition
A function is onto if each element in the co-domain is an image of some
pre-image(s).
Onto functions
Definition
A function is onto if each element in the co-domain is an image of some
pre-image
a 1 a 1
e 2 e 2
i 3 i 3
o 4 o 4
u 5
An onto function
Onto functions
More onto
• Determine whether the function f(x) = x+1 from the set of integers to
the set of integers is onto?
Onto vs. one-to-one
Are the following functions onto, one-to-one, both, or neither?
a 1 a 1
a 1
b 2 b 2
b 2
c 3 c 3
c 3
4 d 4
4
1-to-1, not onto Both 1-to-1 and onto Not a valid function
a 1 a 1
b 2 b 2
c 3 c 3
d d 4
Onto, not 1-to-1 Neither 1-to-1 nor onto
Bijections
Definition
• A function that is both one-to-one and onto Such a function is a one-
to-one correspondence, or a bijection.
a 1
• We only can find the inverse of a function if it is a bijection b 2
function. c 3
d 4
Bijections
• f(x) = 1*x
• f(x) = x + 0
R f R
f-1
f(4.3)
4.3 8.6
f-1(8.6)
A B C
g f
g(a) f(b)
a f(g(a))
b = g(a)
(f ○ g)(a)
Compositions of functions
Definition
• Let g be a function from the set A to the set B and let f be a function
from the set B to the set C. The composition of the functions f and g,
denoted f o g is defined by
(f o g)(a) = f(g(a))
Note that the composition f o g can not be defined unless the range of g is a subset
of the domain of f.
Compositions offunctions
Compositions of functions
Let f(x) = 2x+3 f○g
Let g(x) =
3x+2
R R R
g f
g(1) f(5)
f(g(1))=13
1
g(1)=5
(f ○ g)(1)
f(g(x)) = 2(3x+2)+3 =
6x+7
Compositions of
Compositions of functions functions
Does f(g(x)) = g(f(x))?
Let f(x)=2x+1
f(x)
=5
x=
Plot (x, f(x)) 2
This is a plot
of f(x)
Graphs of functions
• Floor: ⎣x⎦ means take the greatest integer less than or equal to the
number
• round(x) = ⎣ x+0.5 ⎦
Floor, Ceiling Examples
• ⎣1.1⎦ 1
• ⎡1.1⎤ 2
• ⎣-0.1⎦ -1
• ⎡-0.1⎤ 0