Lecture 05
Lecture 05
Lecture 05
A B
Domain Co-Domain
A function, f: A B
CSCE 235, Spring 2010 Functions 6
More Definitions (1)
• Definition: Let f1 and f2 be two functions from
a set A to R. Then f1+f2 and f1f2 are also
function from A to R defined by:
– (f1+f2)(x) = f1(x) + f2(x)
– f1f2(x)= f1(x)f2(x)
• Example: Let f1(x)=x4+2x2+1 and f2(x)=2-x2
– (f1+f2)(x) = x4+2x2+1+2-x2 = x4+x2+3
– f1f2(x) = (x4+2x2+1)(2-x2)= -x6+3x2+2
A B
a1 b1
a2 b2
a3 b3
a4 b4
A B
a1 b1
a2 b2
a3 b3
a4 b4
• Is this a function
– One-to-one (injective)? Why? No, b1 has 2 preimages
– Onto (surjective)? Why? No, b4 has no preimage
CSCE 235, Spring 2010 Functions 16
Functions: Example 3
A B
a1 b1
a2 b2
a3 b3
b4
• Is this a function
– One-to-one (injective)? Why? Yes, no bi has 2 preimages
– Onto (surjective)? Why? No, b4 has no preimage
CSCE 235, Spring 2010 Functions 17
Functions: Example 4
A B
a1 b1
a2 b2
a3 b3
a4
• Is this a function
– One-to-one (injective)? Why? No, b3 has 2 preimages
– Onto (surjective)? Why? Yes, every bi has a preimage
CSCE 235, Spring 2010 Functions 18
Functions: Example 5
A B
a1 b1
a2 b2
a3 b3
a4 b4
• Is this a function
– One-to-one (injective)? Thus, it is a bijection or a
– Onto (surjective)? one-to-one correspondence
CSCE 235, Spring 2010 Functions 19
Exercice 1
• Let f:ZZ be defined by
f(x)=2x-3
• What is the domain, codomain, range of f?
• Is f one-to-one (injective)?
• Is f onto (surjective)?
• Clearly, dom(f)=Z. To see what the range is, note that:
b rng(f) b=2a-3, with aZ
b=2(a-2)+1
b is odd
CSCE 235, Spring 2010 Functions 20
Exercise 1 (cont’d)
• Thus, the range is the set of all odd integers
• Since the range and the codomain are
different (i.e., rng(f) Z), we can conclude
that f is not onto (surjective)
• However, f is one-to-one injective. Using
simple algebra, we have:
f(x1) = f(x2) 2x1-3 = 2x2-3 x1= x2 QED
f(a)
a b
f -1(b)
A B
Domain Co-Domain
A function and its inverse
CSCE 235, Spring 2010 Functions 33
Inverse Functions: Example 1
• Let f:RR be defined by
f(x) = 2x – 3
• What is f-1?
1. We must verify that f is invertible, that is, is a bijection.
We prove that is one-to-one (injective) and onto
(surjective). It is.
2. To find the inverse, we use the substitution
• Let f-1(y)=x
• And y=2x-3, which we solve for x. Clearly, x= (y+3)/2
• So, f-1(y)= (y+3)/2
g(a) f(g(a))
a g(a) f(g(a))
A B C
x
-5 -4 -3 -2 -1 1 2 3 4 5
-1
-2
-3
x
-5 -4 -3 -2 -1 1 2 3 4 5
-1
-2
-3