Lecture 11
Lecture 11
َّحيم
َّحم ِن الر ِ
سم ہللاِ الر ٰ بِ ِ
ُشروع ہللَا کے پاک نام سے جو بڑا مہر بان نہايت رحم واال ہے
Discrete Structures
COSC-1103
x1
f(x1)=f(x2) Y=co-domain of f
X=domain of f
x2
• A function f: X Y is not one-to-one iff there exist elements x1 and x2 such that
x1 x2 but f(x1) = f(x2).
• That is, if distinct elements x1 and x2 can found in domain of f then they have
the same function value.
f
Comparison
f g g
a 1 a 1 1 1
a a
b 2 b 2 2 2
b b
3 3 3 3
c c c4 c
4 4 4
X Y X XY Y X Y
• f is clearly one-to-one function, • g is not one-to-one because the
because no two different elements of elements a and c are mapped
X are mapped onto the same element onto the same element 2 of Y
of Y
Graph of One-to-One Function
• A graph of a function f is one-to-one iff every horizontal line intersects
the graph in at most one point.
y
y=x2 y
y=x2
y
y
y x
y x
(-2,4) (2,4)
(-2,4) (2,4)
0 x -2 0 +2 x 0 x -2 0 +2 x
ONE-TO-ONE FUNCTION NOT ONE-TO-ONE FUNCTION
ONE-TO-ONE FUNCTION NOT ONE-TO-ONE FUNCTION
from R+ to R From R to R+
from R+ to R From R to R+
Surjective Function
• Let f: XY be a function. f is surjective
or onto if, and only if, y Y, x X
such that f(x) = y.
X Y X X YY X Y
Graph Of Onto Function
y y=ex y y=ex
y = |x| y = |x|
y y
• A graph of a function ‘f’
is onto iff every
horizontal line intersects
the graph in at least one
O x point.O Ox x O x
c .3
X Y
Graph Of Bijective Function
y y=x3
y y=x3
• A graph of a function ‘f’ is
bijective iff every horizontal line
intersects (0,5)
the graph at exactly (0,5)
one point.
x (5,0) O(0,0)
0
x (5,0) O(0,0)
0
BIJECTIVE FUNCTION
BIJECTIVE FUNCTION from R to R
BIJECTIVE FUNCTION
from R to R
BIJECTIVE FUNCTION from R to R
from R to R
Constant Function
f
• A function f:XY is a constant X Y
function if it maps (sends) all 1
elements of X to one element of Y .7
i.e. x X, f(x) = c, for some c 2
Y.
3 .8
4 .9
Remark:
1. A constant function is one-to-one iff its domain is a singleton.
2. A constant function is onto iff its co-domain is a singleton.
Equality Of Functions
Suppose ‘f’ and ‘g’ are functions from X to Y.
Then ‘f’ equals ‘g’, written f = g, iff, f(x) = g(x) for all x ε X.
Example:
Define f: R →R and g: R→R by formulas:
f(x) = |x| for all x εR
g(x)= for all x εR
Since the absolute value of a real number equals to square root of its square
i.e., |x| = for all x εR
Therefore f(x) = g(x) for all x εR
Hence f = g
Inverse Of A Function g-1 g-1
g g
.a .a1. 1.
1. .a
1. .a
.b .b2. 2.
2. .b
2. .b
.c .c3. 3.
3. .c
3. .c
Y Y X X
X YX Y
FUNCTION INVERSE INVERSE
FUNCTION
X X Z Z Z Z X X
1. 1.
1. 1. .a .a
.a .a 2. 2.
2. 2. .b .b
.b .b 3. 3.
3. 3.
Y Y X X
X XY Y
INVERSE INVERSE
SURJECTIVE FUNCTION FUNCTION
SURJECTIVE
x=f-1(y) f(x)=y
f-1
X=domain of f Y=co-domain of f
Inverse Function
f f-1
1. .6
.6 1.
2. 7
7 2.
3 8
8 3
4. 9
9 4.
X Y
Composition Of Functions
• Let f: X Y and g: Y Z be functions with the property that the range of f is a
subset of the domain of g i.e. f(X)Y.
• Define a new function gof:X Z as: (gof)(x) = g(f(x)) for all xX
• The function gof is called the composition of f and g.
X Y Z
f
g
x Y g(f(x)) =(gof)(x)
f(x)
gof
Composition Of Functions Defined By Arrow
Diagrams X
f
Y
g
Z
Y
x
Let X = {1,2,3}, Y={a,b,c,d,e} 1
2
a
b y
z
3 c
Y={a,b,c,d}, and Z ={x,y,z}. d
e
Define functions; Then gof f: X Z is represented by the arrow diagram.
arrow diagrams
X Z
x
1
y
2
z
3
Lecture recap
Any question…?
End of
Lecture
11