DM Online Lecture 4
DM Online Lecture 4
Let f1 and f2 be functions from A to R. Then f1 + f2 and f1f2 are also functions from A
to R defined for all x ∈ A by(f1 + f2)(x) = f1(x) + f2(x),(f1f2)(x) = f1(x)f2(x).
EXAMPLE 1 Let f1 and f2 be functions from R to R such that f1(x) = x2 and f2(x) = x - x2. What
are the functions f1 + f2 and f1f2?.
Solution: From the definition of the sum and product of functions, it follows that
(f1 + f2)(x) = f1(x) + f2(x) = x2 + (x - x2) = x and (f1f2)(x) = x2(x - x2) = x3 - x4. ▲
EXAMPLE 2 Let A = {a, b, c, d, e} and B = {1, 2, 3, 4} with f (a) = 2, f (b) = 1, f (c) = 4, f (d) = 1,
and f (e) = 1. The image of the subset S = {b, c, d} is the set f (S) = {1, 4}.
EXAMPLE 3 Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with f (a) = 4, f
(b) = 5, f (c) = 1, and f (d) = 3 is one-to-one.
Solution: The function f is one-to-one because f takes on different values at the four elements
of its domain. This is illustrated in Figure 1.
EXAMPLE 4 Determine whether the function f (x) = x2 from the set of integers to the set of
integers is one-to-one.
Page 1|5
Onto Function:
A function f from A to B is called onto, or a surjection, if and only if for every element
b ∈ B there is an element a ∈ A with f (a) = b. A function f is called surjective if it is onto.
Remark: A function f is onto if ∀y∃x(f (x) = y), where the domain for x is the domain of the
function and the domain for y is the codomain of the function.
EXAMPLE 5 Is the function f (x) = x2 from the set of integers to the set of integers onto?
Solution: The function f is not onto because there is no integer x with x2 = -1, for instance.
Page 2|5
Figure 4: The Function f-1 Is the Inverse of Function f.
EXAMPLE 6 Let f be the function from {a, b, c} to {1, 2, 3} such that f (a) = 2, f (b) = 3, and f (c)
= 1. Is f invertible, and if it is, what is its inverse?
Solution: Because f (-2) = f (2) = 4, f is not one-to-one. If an inverse function were defined,
it would have to assign two elements to 4. Hence, f is not invertible.
Let g be a function from the set A to the set B and let f be a function from the set B to
the set C. The composition of the functions f and g, denoted for all a ∈ A by f ◦ g, is
defined by (f ◦ g)(a) = f (g(a)).
In other words, f ◦ g is the function that assigns to the element a of A the element assigned
by f to g(a). That is, to find (f ◦ g)(a) we first apply the function g to a to obtain g(a) and
then we apply the function f to the result g(a) to obtain (f ◦ g)(a) = f (g(a)). Note that the
composition f ◦ g cannot be defined unless the range of g is a subset of the domain of f . In
Figure 5 the composition of functions is shown.
Page 3|5
Figure 5: The Composition of the Functions f and g.
EXAMPLE 8 Let g be the function from the set {a, b, c} to itself such that g(a) = b, g(b) = c, and
g(c) = a. Let f be the function from the set {a, b, c} to the set {1, 2, 3} such that f (a) = 3, f (b) = 2,
and f (c) = 1. What is the composition of f and g, and what is the composition of g and f ?
(f ◦ g)(a) = f (g(a)) = f (b) = 2, (f ◦ g) (b) = f (g(b)) = f (c) = 1, and (f ◦ g)(c) = f (g(c)) = f (a) = 3.
Note that g ◦ f is not defined, because the range of f is not a subset of the domain of g. ▲
EXAMPLE 9 Let f and g be the functions from the set of integers to the set of integers defined
by f (x) = 2x + 3 and g(x) = 3x + 2. What is the composition of f and g? What is the composition
of g and f ?
Page 4|5
Lecture Prepared by
Page 5|5