Professional Documents
Culture Documents
Sub-topic
Introduction
Partial Function
Total Function
Further kinds of function
Surjective function
Injective function
Bijective function
Sub-topic
Operation on functions
Inverse of a function
Composition function
Overriding function
Functions
Example
Let consider :
Functions
Partial function
The relation borrowedBy : no element of the
source should be related to more than one
element of the target.
General ;
A partial function from X to Y is a relation from
X to Y such that each element x in X is
related to at most one y in Y.
Declare as :
f: A B
Partial function
Definition :
consider :
No
Functions
Total function
A function in which every element in the
domain is mapped to some element in the
range.
Declare as :
f: A B
-
dom f = A
Total Function
Total Function
Example :
Each person is relate to only one number.
Every PERSON has an age.
So the domain of this function is the whole
of the source set, PERSON.
This means the function is total.
Relation relating each PERSON to their
age in years ;
Surjective functions
12
Surjective Functions
Denoted by:
: Partial surjective function
13
Surjective Functions
Example :
Let say we have a set of lecturers, LECTURER
and the courses, COURSE which taught by the
lecturers. A relation is teaches between
LECTURER and COURSE.
Lecturers are too busy to teach more than one
course. We wish to specify that there is at least
one lecturer teaching each course.
14
Declaration
of relation??
Surjective Functions
Example 2:
Let say we have a set of lecturers, LECTURER
and the courses, COURSE which taught by the
lecturers. A relation is teaches between
LECTURER and COURSE.
We wish to specify that there is every lecturer
must teach a course.
Declaration
of relation??
15
Injective Functions
A function in which each element of the range
is mapped to by only one element.
Denoted by :
: Partial Injective function
: Total Injective function
16
Injective Functions
Example :
17
Declaration
of function??
Injective Functions
Example :
Declaration
of function??
18
Bijective Functions
If function, f, from X to Y is both a total
surjection and a total injection then f is
bijective function.
Denoted by :
: Bijective function
19
Inverse Functions
The inverse relation is always a relation, but..
the inverse function is not always a function.
Example :
ageOf = {sue
30, joy
Denoted by : ageOf
20
21, jane
21, val
29}
Function composition
simply relation composition where the relations
involved happen to be function.
21
Functions overriding
applied to any two function f and g, of the same
type, and the result is another function.
the expression :
f g
22
Functions overriding
Example 1:
f, g ; N
23
Functions overriding
Example 2:
f, g ; N
f ={0
1, 1
1}
g={0
2,2
1}
So; f g= ????
24
Functions overriding
Example 3;
Let say a relation: shopprice: ITEM
????
25
Functions overriding
Example 3;
Let say a relation: shopprice: ITEM
????
26