Chapter2 - Part2_Functions
Chapter2 - Part2_Functions
2. Cartesian product
3. Venn diagram
CCS3003_DRNS_SEM1_2024/2025 2
Functions
• One-to-one and onto Functions
• Inverse Function
• Function Composition
• Floor, Ceiling, Factorial
CCS3003_DRNS_SEM1_2024/2025 3
Functions
Definition: Let A and B be nonempty sets. A function f from A to B,
denoted f : A → B is an assignment of each element of A to exactly one
element of B. We write f(a) = b if b is the unique element of B assigned
by the function f to the element a of A.
Students Grades
• Functions are sometimes
A
called mappings or Carlota Rodriguez
B
transformations.
Sandeep Patel C
Jalen Williams D
F
Kathy Scott
CCS3003_DRNS_SEM1_2024/2025 4
Functions
• A function f : A → B can also be defined as a subset of A×B (a relation).
• A function f : A → B , is a relation from A to B that satisfies two properties:
• Every element in A is related to some element in B.
• No element in A is related to more than one element in B.
A B
a
x
b
y
c
d z
CCS3003_DRNS_SEM1_2024/2025 5
Functions
Given a function f: A → B:
• We say f maps A to B or
f is a mapping from A to B.
• A is called the domain of f.
• B is called the codomain of f.
• If f(a) = b,
• then b is called the image of a under f.
• a is called the preimage of b.
• The range of f is the set of all images of points in A under f. We denote
it by f(A).
• Two functions are equal when they have the same domain, the same
codomain and map each element of the domain to the same element
of the codomain.
CCS3003_DRNS_SEM1_2024/2025 6
Questions
f(a) = ? z
A B
The image of d is ? z a
x
The domain of f is ? A b
y
The codomain of f is ? B c
The preimage of y is ? b d z
f(A) = ? {y, z}
The preimage(s) of z is (are) ? {a,c,d}
CCS3003_DRNS_SEM1_2024/2025 7
Injections
Definition: A function f is said to be one-to-one , or injective, if and
only if f(a) = f(b) implies that a = b for all a and b in the domain of f.
A function is said to be an injection if it is one-to-one.
A B
x
a
v
b
y
c
z
d
CCS3003_DRNS_SEM1_2024/2025 8
Surjections
Definition: A function f from A to B is called onto or
surjective, if and only if for every element
there is an element with . A
function f is called a surjection if it is onto.
A B
a x
b
y
c
z
d
CCS3003_DRNS_SEM1_2024/2025 9
Bijections
Definition: A function f is a one-to-one correspondence, or a
bijection, if it is both one-to-one and onto (surjective and injective).
A B
a x
b
y
c
d z
CCS3003_DRNS_SEM1_2024/2025 10
One-to-one and Onto Functions
CCS3003_DRNS_SEM1_2024/2025 11
Functions
CCS3003_DRNS_SEM1_2024/2025 12
Functions
CCS3003_DRNS_SEM1_2024/2025 13
Showing that f is one-to-one or onto
CCS3003_DRNS_SEM1_2024/2025 14
Showing that f is onto function
CCS3003_DRNS_SEM1_2024/2025 15
One-to-one and Onto Functions
Example :
CCS3003_DRNS_SEM1_2024/2025 16
Showing that f is one-to-one and onto
Example 1:
Example 2:
CCS3003_DRNS_SEM1_2024/2025 17
Inverse Functions
Definition: Let f be a bijection from A to B. Then the
inverse of f, denoted , is the function from B to A
defined as
No inverse exists unless f is a bijection. Why?
CCS3003_DRNS_SEM1_2024/2025 18
Inverse Functions
A f
B A B
a V V
a
b b
W W
c c
d X X
d
Y Y
CCS3003_DRNS_SEM1_2024/2025 19
Questions
Example 1: Let f be the function from {a,b,c} to {1,2,3} such
that f(a) = 2, f(b) = 3, and f(c) = 1. Is f invertible and if so what
is its inverse?
CCS3003_DRNS_SEM1_2024/2025 20
Questions
CCS3003_DRNS_SEM1_2024/2025 21
Questions
CCS3003_DRNS_SEM1_2024/2025 22
Composition
Definition: Let f: B → C, g: A → B. The composition of
f with g, denoted is the function from A to C
defined by
CCS3003_DRNS_SEM1_2024/2025 23
Composition
g f
A B C A C
V a
a h h
b i b
W i
c
c
X j
d
d j
Y
CCS3003_DRNS_SEM1_2024/2025 24
Composition
Example 1: If and ,
then
and
CCS3003_DRNS_SEM1_2024/2025 25
Composition Questions
Example 2: Let f and g be functions from the set of integers to the set of
integers defined by f(x) = 2x + 3 and g(x) = 3x + 2.
What is the composition of f and g, and also the composition of g and f ?
Solution:
(f∘g) (x)= f(g(x))
= f(3x + 2) = 2(3x + 2) + 3 = 6x + 7
(g∘f) (x)= g(f(x))
= g(2x + 3) = 3(2x + 3) + 2 = 6x + 11
CCS3003_DRNS_SEM1_2024/2025 26
Function, Inverse and Composition
CCS3003_DRNS_SEM1_2024/2025 27
Identity Function
CCS3003_DRNS_SEM1_2024/2025 28
Equality of Functions
Example:
CCS3003_DRNS_SEM1_2024/2025 29
Equality of Functions
Solution:
CCS3003_DRNS_SEM1_2024/2025 30
Boolean Functions
CCS3003_DRNS_SEM1_2024/2025 31
Solution:
CCS3003_DRNS_SEM1_2024/2025 32
Exercise 1
𝑓 −1 𝑥 = 𝑦
𝑥 3 +1 = 𝑦
𝑥3 = 𝑦 − 1
𝑥 = 3 𝑦−1
3
∴ 𝑓 −1 𝑥 = 𝑥−1
= (𝑥 − 1)1Τ3
CCS3003_DRNS_SEM1_2024/2025 33
Exercise 2
Find 𝑓 ⃘𝑔 and 𝑔 ⃘ 𝑓, where 𝑓 𝑥 = 𝑥 2 + 1 and 𝑔 𝑥 = 𝑥 + 2, are functions from R to R.
• Identify whether f g = g f
𝑓(𝑔 𝑥 ) = 𝑓 𝑥 + 2
= (𝑥 + 2)2 +1
= 𝑥 2 + 4𝑥 + 5
𝑔(𝑓 𝑥 ) = 𝑔 𝑥 2 + 1
= 𝑥2 + 1 + 2
= 𝑥2 + 3
∴𝒇∘𝒈≠ 𝒈∘𝒇
CCS3003_DRNS_SEM1_2024/2025 34
Exercise 3
Find 𝑓 ⃘𝑔 and 𝑔 ⃘ 𝑓, where 𝑓 𝑥 = 𝑥 2 + 1 and 𝑔 𝑥 = 𝑥 + 2, are functions from R to R.
• Identify whether ( f g ) −1 = g −1 f −1
CCS3003_DRNS_SEM1_2024/2025 35
Exercise 4
Find 𝑓 ⃘𝑔 and 𝑔 ⃘ 𝑓, where 𝑓 𝑥 = 𝑥 2 + 1 and 𝑔 𝑥 = 𝑥 + 2, are functions from R to R.
• Identify whether ( g f ) −1 = f −1 g −1
𝑓 𝑥 = 𝑥2 + 1 = 𝑦
𝑔 𝑓 𝑥 = 𝑥2 + 1 + 2 = 𝑦 𝑥2 = 𝑦 − 1
𝑥2 = 𝑦 − 3 𝑥 = 𝑦 −1
𝑥 = 𝑦 −3 𝑓 −1 𝑥 = 𝑥 − 1
𝑔. 𝑓 −1 (𝑥) = 𝑥 −3 𝑔(𝑥) = 𝑥 + 2 = 𝑦
𝑥 =𝑦 −2
𝑔−1 𝑥 = 𝑥 − 2
𝑓 −1 . 𝑔−1 𝑥 = 𝑥 − 2 − 1
𝑓 −1 . 𝑔−1 𝑥 = 𝑥 − 3
−𝟏
∴ 𝒈. 𝒇 = 𝒇−𝟏 . 𝒈−𝟏
CCS3003_DRNS_SEM1_2024/2025 36
Graphs of Functions
• Let f be a function from the set A to the set B. The graph of the function f
is the set of ordered pairs {(a,b) | a ∈A and f(a) = b}.
CCS3003_DRNS_SEM1_2024/2025 37
Some Important Functions
The floor function, denoted
is the largest integer less than or equal to x.
The ceiling function, denoted
is the smallest integer greater than or equal to x
Example:
CCS3003_DRNS_SEM1_2024/2025 38
Floor and Ceiling Functions
CCS3003_DRNS_SEM1_2024/2025 39
Floor and Ceiling Functions
CCS3003_DRNS_SEM1_2024/2025 40
Factorial Function
Definition: f: N → Z+ , denoted by f(n) = n! is the product of the first n
positive integers when n is a nonnegative integer.
f(n) = 1 ∙ 2 ∙∙∙ (n – 1) ∙ n, f(0) = 0! = 1
Examples:
f(1) = 1! = 1
Stirling’s Formula:
f(2) = 2! = 1 ∙ 2 = 2
f(6) = 6! = 1 ∙ 2 ∙ 3∙ 4∙ 5 ∙ 6 = 720
f(20) = 2,432,902,008,176,640,000.
CCS3003_DRNS_SEM1_2024/2025 41
TERIMA KASIH
THANK YOU
谢谢
Xièxiè
நன்றி
Naṉṟi
شكرا
ً
Shukran
CCS3003_DRNS_SEM1_2024/2025 42