WELCOM
To Our
Presentation
Functi
on
Content courtesy (Partial) – Prof. Margaret (Maggie) H.
Dunham
Department of Software Engineering – 0
Discrete Mathematics
Daffodil International University
(DIU)
Department of Software Engineering
(SWE)
Discrete Mathematics Fall 2024
Instructor: Mohammad Azam Khan,
PhD
Department of Software Engineering – 1
Discrete Mathematics
Functions Functions
Functions are special relations.
Functions make up a subset of all relations.
Every set of ordered pairs is a relation, but every relation is
not a function
A function is defined as a relation that is either one to one or
many to one., i.e., no ordered pairs have the same first
element.
Department of Software Engineering – 2
Discrete Mathematics
Functions:
Functions: Formal Formal Definition
Definition
A function f from set A to set B, written as f : A → B, is defined
as a relation where for every element a∈A, there exists a unique
element b∈B such that f(a)=b.
In other words, a function is a relation between two sets that
assigns each element of the first set (called the domain) to
exactly one element of the second set (called the codomain).
Department of Software Engineering – 3
Discrete Mathematics
Functions:
Functions: GraphicalGraphical Representation
Representation
Functions can be represented graphically in several ways:
f
A B
f • • y
• • • •
a b • •
• • x
•
A B
Like Venn Graph Plot
diagrams
Department of Software Engineering – 4
Discrete Mathematics
Functions:
Functions: Key Concepts
Key Concepts
Domain: The set of all possible inputs. For f : A→B,
A is the domain.
Codomain: The set of potential outputs. For f :
A→B, B is the codomain.
Range: The actual set of outputs generated by the
function. It’s a subset of the codomain.
Department of Software Engineering – 5
Discrete Mathematics
Properties of Functions
Properties of Functions
Injective (One-to-One)
o Different elements in the domain map to different elements in the
codomain.
Surjective (Onto)
o Every element in the codomain is mapped by at least one
element in the domain.
o The range of f equals the codomain.
Bijective:
o Both injective and surjective
o Forms a one-to-one correspondence between the domain and
codomain.
Department of Software Engineering – 6
Discrete Mathematics
Injective (One-to-One)
Injective (One-to-One) Function Function
An injective function (also called a one-to-one function) is a
function where each output value is linked to only one
unique input value. This means that no two different inputs
can give the same output.
• A = {a, b, c}
• B = {1, 2, 3, 4}
A B
Department of Software Engineering – 7
Discrete Mathematics
Surjective
Surjective (Onto) (Onto) Function
Function
If every element in the function's target set (also called the
codomain) has at least one element from the input set
(domain) mapping to it. In other words, a function
f : A→B is surjective if, for every y in B, there is some x in A
such that f(x)=y
• A = {a, b, c}
• B = {1, 2}
A B
Department of Software Engineering – 8
Discrete Mathematics
Bijective (One-to-One and Onto) Function
Bijective (One-to-One and Onto) Function
It’s a function mixer of both injective and surjective function.
So, a bijective function perfectly "pairs" each input with a
unique output, and every output is covered. In other words,
a bijective function has an inverse function.
• A = {a, b, c}
• B = {1, 2, 3}
A B
Department of Software Engineering – 9
Discrete Mathematics
THANK
Fo r Yo u r
Patien ce