Lecture 16 Functions
Lecture 16 Functions
Lecture 16 Functions
Lecture - 16
Functions
Application of Functions
f(4.3)
4.3 4
Badar A
Jameel B
Sara C
Ali D
F
Set A Set B
More Functions 1
Domain Co-domain
Alice A
Bob B
Chris C
Dave D
Emma F
A grade function
Range
a 1 “a” 1
e 2 “bb“ 2
i 3 “cccc” 3
o 4 “dd” 4
u 5 “e” 5
Some function…
A B A B
Example:
• Let f1(x) = 2x
• Let 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
One-to-One Function
• A function is one-to-one if each element in the co-domain
has a unique pre-image
• Formal definition: A function f is one-to-one if f(a) = f(b)
implies a = b for all a and b in the domain of f.
a 1 a 1
e 2 e 2
i 3 i 3
o 4 o 4
5 5
• ∀𝑎∀𝑏 𝑓 𝑎 = 𝑓 𝑏 → 𝑎 = 𝑏 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 function
• Determine whether the function 𝑓 from {𝑎, 𝑏, 𝑐, 𝑑} 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 function
• Determine whether the function 𝑓 from {𝑎, 𝑏, 𝑐, 𝑑} 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
b 1
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
𝑓: 𝑅 → 𝑅; 𝑓 𝑥 = 𝑥 3
𝑥+1
𝑓: 𝑅 − {0} → 𝑅; 𝑓 𝑥 =
𝑥
Identity Functions
• 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
f(4.3)
4.3 8.6
f-1(8.6)
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))
f °g
A B C
g f
g(a) f(b)
a f(g(a))
b = g(a)
(f °g)(a)
Compositions of Functions
g(1) f(5)
f(g(1))=13
1
g(1)=5
(f ° g)(1)
Chapter # 2
Topic # 2.3
Questions 1, 10,11,12,18,19,32,33