CSIT DS Functions
CSIT DS Functions
Compiled By
Ujjwal Rijal
rijalujjwal09@gmail.com
rijalujjwal09@gmail.com 1
Basic Concept of Function
rijalujjwal09@gmail.com 2
Basic Concept of Function
rijalujjwal09@gmail.com 3
Basic Concept of Function
rijalujjwal09@gmail.com 4
Basic Concept of Function
rijalujjwal09@gmail.com 5
Basic Concept of Function
rijalujjwal09@gmail.com 6
Equal Function
Definition:
✓ Let A and B be the two sets and f: A → B and g: B → A
be the two functions. We say that f and g are equal
functions and write f = g iff f(a) = g(a) for all a ∈ A.
Here, iff denotes if and only if.
✓ If f and g are not equal functions, then we write f ≠ g.
In general sense,
✓ Two functions are equal if they have the same
domain and co-domain and their values are the same
for all the elements of the domain.
rijalujjwal09@gmail.com 7
Identity Function
Definition:
✓ The function f: A → A is called the identity function if each
element of set A has an image on itself i.e. f(a) = a for all a ∈
A.
✓ It is denoted by IA .
Example: Consider set A = {1, 2, 3, 4, 5} and f: A → A
such that f = {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)}.
rijalujjwal09@gmail.com 8
Real-valued Function
Definition:
✓A function f: A → R such that f(a) = R, a ∈ A, is called
a real valued function.
In general sense,
✓A real valued function is a function whose values are real
numbers. In other words, it is a function that assigns a
real number to each member of its domain.
✓In other words, if the domain and range of a function f
are the subsets of R (set of real numbers), then f is said
to be the real valued function of real variables or simply a
real function.
rijalujjwal09@gmail.com 9
Integer-valued Function
rijalujjwal09@gmail.com 10
Types of Function
rijalujjwal09@gmail.com 11
Injective Function
(One-to-One)
o A function f from A to B (A → B) is one-to-one if for all
x1, x2 ∈ A such that f(x1) = f(x2) implies x1 = x2.
o We can express the one to one function f by using the
quantifiers as follows:
∀x1∀x2 ((f(x1) = f(x2)) → (x1 = x2)), where universe
of discourse is the domain of the function.
o In other words, a function “f” from A to B is called
injective if it maps distinct elements of A to the distinct
elements of B.
rijalujjwal09@gmail.com 12
Injective Function
(One-to-One)
rijalujjwal09@gmail.com 14
Surjective Function
(Onto Function)
o A function f from A to B (A → B) is an onto function if
every element of B is the image of some elements in A.
o We can express that “f” is surjective function using
quantifiers as follows:
∀y ∃x (f(x) = y)
o In other words, a function “f” from A to B is called
surjective if for every y in the co-domain B, there exists
at least one x in the domain A.
rijalujjwal09@gmail.com 15
Surjective Function
(Onto Function)
rijalujjwal09@gmail.com 16
Surjective Function
(Onto Function)
rijalujjwal09@gmail.com 17
Bijective Function
(One-to-One Correspondence)
rijalujjwal09@gmail.com 18
Bijective Function
(One-to-One Correspondence)
rijalujjwal09@gmail.com 19
Inverse of Function
rijalujjwal09@gmail.com 20
Inverse of Function
rijalujjwal09@gmail.com 21
Inverse of Function
➢ Here, we can see that f-1 is not a function, since f-1(a) = {1, 2}.
rijalujjwal09@gmail.com 22
Inverse of Function
𝐲 −𝐛
i.e. x = ∈ R
𝐚
𝐲 −𝐛 𝐲 −𝐛
and, f( =a) ( +b)
𝐚 𝐚
=y–b+b
=y
𝐲 −𝐛
∴ y is the image of .
𝐚
Thus, f is onto.
Hence, f is one-to-one and onto both, therefore, f-1 exists
𝐲 −𝐛
and is defined by f (y) =
-1 . Here, y is just a dummy
𝐚
variable and can be replaced by x, then the inverse of
𝐱 −𝐛
function f is given by, f-1(x) = .
𝐚
rijalujjwal09@gmail.com 24
Composite Function
rijalujjwal09@gmail.com 25
Composite Function
rijalujjwal09@gmail.com 26
Composite Function
rijalujjwal09@gmail.com 27
Composite Function
rijalujjwal09@gmail.com 28
Composite Function
(Test Yourself)
rijalujjwal09@gmail.com 31
Composite Function
(i). gof(x)
(ii). gof-1of(x)
(iii). hogof(x)
(Test Yourself)
rijalujjwal09@gmail.com 32
Graph of Functions
rijalujjwal09@gmail.com 33
Graph of Functions
rijalujjwal09@gmail.com 34
rijalujjwal09@gmail.com 35
rijalujjwal09@gmail.com 36
rijalujjwal09@gmail.com 37
rijalujjwal09@gmail.com 38
rijalujjwal09@gmail.com 39
rijalujjwal09@gmail.com 40
rijalujjwal09@gmail.com 41
rijalujjwal09@gmail.com 42
rijalujjwal09@gmail.com 43
rijalujjwal09@gmail.com 44
rijalujjwal09@gmail.com 45
rijalujjwal09@gmail.com 46
rijalujjwal09@gmail.com 47
rijalujjwal09@gmail.com 48
rijalujjwal09@gmail.com 49
rijalujjwal09@gmail.com 50