0% found this document useful (0 votes)
66 views

Types of Functions: Lecture # 12

The document discusses different types of functions: 1) One-to-one (injective) functions map distinct elements of the domain to distinct elements of the codomain. 2) Onto (surjective) functions map elements of the domain onto every element of the codomain. 3) Bijective functions are both one-to-one and onto, providing a perfect match between domain and codomain elements. Examples are provided to illustrate these concepts along with exercises to determine if functions are one-to-one, onto or neither.

Uploaded by

Rajaa21321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Types of Functions: Lecture # 12

The document discusses different types of functions: 1) One-to-one (injective) functions map distinct elements of the domain to distinct elements of the codomain. 2) Onto (surjective) functions map elements of the domain onto every element of the codomain. 3) Bijective functions are both one-to-one and onto, providing a perfect match between domain and codomain elements. Examples are provided to illustrate these concepts along with exercises to determine if functions are one-to-one, onto or neither.

Uploaded by

Rajaa21321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 43

TYPES OF FUNCTIONS

Lecture # 12
TYPES OF FUNCTION
 One – to – One / Injective Function

 Onto / Surjective Function

 Bijective Function
ONE-TO-ONE FUNCTION / INJECTIVE
FUNCTION
 Let f: X  Y be a function. f is injective or
one-to-one if, and only if,  x1, x2  X, if x1 
x2 then f(x1)  f(x2).

 That is, f is one-to-one if it maps distinct


points of the domainfinto the distinct
points of the co-domain.
x1 f(x1)

x2 f(x2)
FUNCTION NOT ONE-TO-ONE
 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


f
found in domain of f then they have the same
function value.
x1

f(x1)=f(x2) Y=co-domain of f
X=domain of f

x2
EXAMPLE
 Which of the arrow diagrams define one-to-
one functions?
f g

a 1 1
a
b 2 2
b
3 3
c c
4 4

X Y X Y
f isImage of (c) =3
(a) function
(b)
one-to-one 2
1 f is NOT one-to-one function
EXERCISE
 Find all one-to-one functions from X = { a, b } to Y =
{ u, v }
 SOLUTION:
 There are two one-to-one functions from X to Y defined
by the arrow diagrams.

We have only two one-to-one functions.


EXERCISE
 How many one-to-one functions are there
from a set with three elements to a set with
four elements.
 SOLUTION
Let X = { x1, x2, x3} and Y = { y1, y2, y3, y4 }

x1 may be mapped to any of the 4 elements


of Y. Then x2 may be mapped to any of the
remaining 3 elements of Y & finally x3 may be
mapped to any of the remaining 2 elements of
Y.
Hence, total no. of one-to-one functions from
EXERCISE
 How many one-to-one functions are there from a set
with three elements to a set with two elements.

 SOLUTION

 Let X = {x1, x2, x3} and Y = {y1, y2}

 Two elements in X could be mapped to the two


elements in Y separately. But there is no new element
in Y to which the third element in X could be mapped.
Accordingly there is no one-to-one function from a set
with three elements to a set with two elements.
EXERCISE
 How many one-to-one functions are there from a set
with three elements to a set with two elements.
SOLUTION:
Let X = {x1, x2, x3} and Y = {y1, y2}

Two elements in X could be mapped to the two


elements in Y separately. But there is no new element
in Y to which the third element in X could be mapped.
Accordingly there is no one-to-one function from a set
with three elements to a set with two elements.
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.
EXAMPLE
y y=x2

y x

(-2,4) (2,4)

0 x -2 0 +2 x

ONE-TO-ONE FUNCTION NOT ONE-TO-ONE FUNCTION


from R+ to R From R to R+
ALTERNATIVE DEFINITION OF ONE-
TO-ONE FUNCTION
 Let f: X  Y be a function. f is injective or
one-to-one if, and only if,  x1, x2  X, IF x1 
x2 THEN f(x1)  f(x2).

 The contra-positive of definition is:

If f(x1) = f(x2) then x1 = x2

If the contrapositive of the definition is also


satisfied then the function is also one-to-one.
EXAMPLE
 Define f: R  R by the rule

f(x) = 4x-1 for all x  R

 Is f one to one?

 Prove or give a counter example.


SOLUTION
 We have to prove the implication.

If f(x1) = f(x2) then x1 = x2

First we suppose that f(x1) = f(x2)


then we will show that x1 = x2
 Let x1, x2  R. such that

f(x1) = f(x2)
 4x1 - 1 = 4 x2 – 1 (by definition of f)
 4 x1 = 4 x2 (adding 1 to both
sides)
 x1 = x2 (dividing both sides by
4)

 Thus we have shown that if f(x1) = f(x2) then


x1= x2
EXAMPLE
 Define g : Z  Z by the rule

g(n) = n2 for all n  Z

 Is g one-to-one?
Prove or give a counter example.
SOLUTION
 Let n1, n2  Z and suppose
g(n1) = g(n2)
 n12 = n22 (by definition of g)
 either n1 = + n2 or n1 = - n2
Thus g(n1) = g(n2)
does not imply n1 = n2 always.
 COUNTER EXAMPLE:
Let n1 = 2 and n2 = -2. Then
g(n1) = g(2) = 22 = 4
g(n2) = g(-2) = (-2) 2 = 4
Hence g(2) = g(-2) where as 2 -2 and so g is not
one-to-one
SURJECTIVE FUNCTION /ONTO
FUNCTION
 Let f: XY be a function. f is surjective or onto
if, and only if,
 y  Y,  x  X such that f(x) = y.

That is, f is onto if every element of Y is the


image of some element of X.

 
 That is, f is onto if every element of its co-
domain is the image of some element(s) of its
domain.
i.e., co-domain of f = range of f
FUNCTION NOT ONTO
 A function f:XY is not onto iff there exists y 
Y such that  x  X, f(x) ≠ y.

 That is, there is some element in Y that is not


the image of any element in X.
f
. .
.
. .

. .

X=domain of f Y=co-do main of f


EXAMPLE
 Which of the arrow diagrams define onto
functions?f
g

a 1
a 1
b 2 b
2
c

c .3 d 3

X Y X Y
 SOLUTION:
 f is not onto because 3  f(x) for any x in X. (3 an
element which is not image of any element of set
X)

 g is clearly onto because each element of Y


equals g(x) for some x in X. (co-domain all
elements are images of some elements of domain)
as
1 = g(c)
2 = g(d)
3 = g(a) = g(b)
Onto vs. one-to-one
 Are the following functions onto, one-to-one,
both, or neither?

a 1 a 1
a 1
b 2 b 2
b 2
c 3 c 3
c 3
4 d 4
4
1-to-1, not onto Both 1-to-1 and onto Not a valid function
a 1 a 1
b 2 b 2
c 3 c 3
d d 4
Onto, not 1-to-1 Neither 1-to-1 nor onto
23
EXAMPLE
 Define f: R  R by the rule

f(x) = 4x-1 for all x  R

 Is f onto?

 Prove or give a counter example.


SOLUTION
 Let y R. We search for an x  R such that

f(x) = y
or 4x-1 = y (by definition of f)

Solving it for x, we find


4x=y+1
y 1
x R
4
Cont…
 Hence for every y R, there exists

y 1
such that x R
4
 y 1
f ( x)  f  
 4 

 y 1
 4.  1  ( y 1) 1  y
 4 
Hence f is
onto.
EXAMPLE
 Define h: Z  Z by the rule

h(n) = 4n - 1 for all n  Z

Is h onto?

Prove or give a counter example.


SOLUTION
 Let m Z. We search for an n  Z such that
h(n) = m.

or 4n - 1 = m (by definition of h)

m 1
n 
Solving it for n, we find
4
m 1
But n  is not always an integer for
all m Z. 4
Cont…
 Let m = 3 then m 1 4
integer  1
4 4
 Let m = 5 then m  1 6

not an integer 4 4

 As a counter example, let m = 0  Z, then


h(n) = 0
 4n-1 = 0
 4n = 1 1
n   
 4

Hence there is no integer n for which h(n) = 0.


Accordingly, h is not onto.
GRAPH OF ONTO FUNCTION
 A graph of a function f is onto iff every
horizontal line intersects the graph in at
least one point within the codomain.
EXAMPLE y y=ex
y = |x|
y

O x O x

ONTO FUNCTION NOT ONTO FUNCTION FROM


from R to R+ R to R
EXERCISE
 Let X = {1, 5, 9} and Y = {3, 4, 7}.

Define g: X Y by specifying that

g(1) = 7, g(5) = 3, g(9) = 4

Is g one-to-one? Is g onto?
SOLUTION
X = {1, 5, 9} and Y = {3, 4, 7}.

g(1) = 7, g(5) = 3, g(9) = 4

g is one-to-one because each of the three


elements of X are mapped to a different
elements of Y by g.

 g is onto as well, because each of the three


elements of co-domain Y of g is the image of
some element of the domain of g.
3 = g(5), 4 = g(9), 7 = g(1)
EXERCISE
 Determine if each of the functions is injective
or surjective:

a. f: Z Z+ define as f(x) = |x|


b. g: Z+  Z+  Z+ defined as g(x) = (x, x+1)
SOLUTION
a) f is not injective, because distinct element
have same images.
f(1) = |1| = 1 and f(-1) = |-1| = 1
i.e., f(1) = f(-1) but 1  -1
(clearly not onto, because distinct elements have
same images)
f is onto, because for every a  Z+,
there exist –a and +a in Z such that

f(-a) = |-a| = a
and f(a) = |a| = a
Cont…
b) g: Z+  Z+  Z+ defined as
g(x) = (x, x+1)
Let g(x1) = g(x2) for x1, x2 Z+
 (x1, x1 +1) = (x2, x2+1) (by definition of g)

 x1 = x2 and x1 + 1 = x2 + 1
(by equality of ordered pairs)
 x1 = x2
Thus if g(x1) = g(x2) then x1 = x2
Hence g is one-to-one.
 g is not onto because (1,1) Z+Z+ is not
the image of any element of Z+.

 Counter Example:
Let x = 1 then g(x) = (1, 2)
Let x = 2 then g(x) = (2, 3)
Let x = 3 then g(x) = (3, 4) …

Clearly, (1,1), (2,2), (2,4) etc which are the


elements of co-domain Z+Z+ are not images
of any elements of Z+.
BIJECTIVE FUNCTION
 A function f: XY that is both one-to-one
(injective) and onto (surjective) is called a
bijective function or a one-to-one
correspondence.
EXAMPLE
 The function f: XY defined by the arrow
diagram is both one-to-one and onto; hence a
bijective function. f
a 1

b 2

c .3

X Y
EXERCISE
 Let f: R  R be defined by the rule f(x) = x³.
Show that f is a bijective or one-to-one correspondence?
SOLUTION

f is one-to-one
Let f(x1) = f(x2) forx1, x2R
 x1³ = x2 ³ (by definition of f(x))
 x1³ - x2³ = 0
 (x1 -x2) (x1² + x1x2 + x2²) = 0
 x1 - x2 = 0 or x1² + x1x2 + x2² = 0
 x1 = x2 (the second equation gives no real solution)
Accordingly f is one-to-one.
Cont…
 f is onto
Let y  R. We search for a x R such that
f(x) = y
 x³ = y (by definition of f)
or x = (y)¹/³

Hence for y R, there exists x = (y)¹/³  R


such that
f(x) = f((y)¹/³)
= ((y)¹/³)³ = y
Accordingly f is onto. Thus, f is a bijective.
GRAPH OF BIJECTIVE FUNCTION
 A graph of a function f is bijective iff every
horizontal line intersects the graph at exactly
one point.
y y=x 3

(0,5)

x (5,0) O(0,0)
0

BIJECTIVE FUNCTION
BIJECTIVE FUNCTION from R to R
from R to R
IDENTITY FUNCTION ON A SET
 Given a set X, define a function ix from X to
X by
ix(x) = x from all x  X.

 The function ix is called the identity


function on X because it sends each
element of X mapped to itself.
EXAMPLE
 Let X = {1, 2, 3, 4}. The identity function ix on
X is represented by the arrow diagram.

You might also like