9 1 (Funxtions)
9 1 (Funxtions)
Structures
Fall 2023
Functions
Application of
Functions
Ali A
Babar B
Umer C
Imran D
Hamza F
Functions
• Let A and B be nonempty sets.
f(4.3)
4.3 4
Babar B “bb“ 2
Chishti C “ccc 3
c” 4
Dawood D
“dd” 5
Ammara F
“e”
Range
a 1
e 2
i 3
o 4
u 5
Functions
“a” 1
“bb“ 2
“cccc” 3
“dd” 4
“e” 5
A B A B
A by:
• (f + g)(x) = f(x) + g(x)
• (f - g)(x) = f(x) - g(x)
• (f *g)(x) = f (x)*g(x)
• (f/g)(x) = f(x)/g(x) given that g(x)≠0
Function
Arithmetic
Let f1 and f2 be functions from R to R such that:
• f1(x) = 2x
• f2(x) = x2
• Find f1 + f2 and f1*f2.
• f1+f2 = (f1+f2)(x) = f1(x)+f2(x) = 2x+x2
• f1*f2 = (f1*f2)(x) = f1(x)*f2(x) = 2x*x2 = 2x3
Function
Arithmetic
• Let f and g be functions from R to R such that:
• f (x) = 3x+2 g (x) = -2x + 1
• What is the function f *g?
• f*g = (f*g) (x) = f (x)*g(x) = (3x+2)*(-2x+1) = -6x2- x
+2
• ∀𝑎∀𝑏 𝑓 𝑎 = 𝑓 𝑏 → 𝑎 = 𝑏 or
equivalently
∀𝑎∀𝑏 𝑎 ≠ 𝑏 → 𝑓(𝑎) ≠ 𝑓 𝑏
a 1
e 2
• Note that there can
i 3
be un-used elements
o 4
in the co-domain
5
A one-to-one function
Example one-to-one
• Determine whether the function 𝑓 from *𝑎, 𝑏,
function
𝑐, 𝑑+ to
*1, 2, 3, 4, 5+ with 𝑓 𝑎 = 4, 𝑓 𝑏 = 5, 𝑓
𝑐 = 1, 𝑎𝑛𝑑
𝑓(𝑑) = 3 is one-to-one.
Onto
Functions
• A function is onto if each element in the co-domain is an
image of some pre-image
• Formal definition: A function f is onto if for all b B,
there exists a A such that f(a) = b.
a 1 a 1
e 2 e 2
i 3 i 3
o 4 o 4
u 5
An onto function
Example onto
• Determine whether the function 𝑓 from *𝑎, 𝑏, 𝑐,
function
𝑑+ to
*1, 2, 3+ defined by 𝑓 𝑎 = 3, 𝑓 𝑏 =
2, 𝑓 𝑐 = 1, 𝑎𝑛𝑑
𝑓(𝑑) = 3. Is 𝑓 an onto function?
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
𝑓: 𝑍 → 𝑍; 𝑓 𝑥 = 𝑥2
of integers to the set of integers is one-to-one.
Exampl
• Determine whether the function f (x) = 𝑥 + 1 from the
e
set
𝑓: 𝑍 → 𝑍; 𝑓 𝑥 = 𝑥 + 1
of integers to the set of integers is onto.
Bijections
• Consider a function that is
both one-to-one and onto:
a 1
• Such a function is a one-to-one b 2
correspondence, or a bijection. c 3
d 4
Exampl
e
• Determine whether the following functions are bijective or
not?
𝑓: 𝑅 → 𝑅; 𝑓 𝑥
= 𝑥3
= �
𝑓: 𝑅 − *0+ → 𝑥+1�
𝑅; 𝑓 𝑥
Floor and
X is the largest integer that is less than or
Ceiling
equal to x and ceiling(x) = X is the smallest integer
• floor(x) =
12/5 = 2.4 2 3
2.7 2 3
−2.7 −3 −2
−2 −2 −2
Identity
Functions
• A function such that the image and the pre-image are
ALWAYS equal
• f(x) = 1*x
• f(x) = x + 0
A B
f
a= f-1(b) f(a)=b
f-1
A=domain of f B=Co-domain of f
Inverse
Functions If f(x) = y, then f-1(y) = x
Let f(x) = 2*x
f(x)=y
R f R
f-1
a 1 a 1
b 2 b 2
c 3 c 3
4 d
(f °g)(𝒂) = f (g(a))
Compositions of
Functions
(f °g)(a) =
f(g(a))
A f °g C
B f
g
g(a) f(b)
a f(g(a))
b = g(a)
(f °g)
(a)
Compositions of
Functions
f°
Let f(x) = 2x+3 Let g(x) = 3x+2
R g
R
g R f
g(1) f(5)
f(g(1))=13
1
g(1)=5
(f ° g)
(1)
Compositions of
Functions
Does f(g(x)) = g(f(x))?
Chapter # 2
Topic # 2.3
Q#1-40(Odd)