Functions
Logic & Problem Solving
Lecture Week 11
Functions
Agenda:
Review of week 9 and 10
Week 11 lecture coverage
– Concept of function
– Types of functions
– Composite function
– Invertible functions
– Inverse of a function
2
AMAZING TRICKS..
Review of Week 9 and 10 :
Question:
Let A = {1, 2, 3, 4, 5} and let R be a relation on set A defined by ,
R = {(1, 2), (1, 3), (1, 4), (2, 2), (3, 1), (4, 2),(4, 5),(2, 5),(5, 5)}
Construct Digraph and Matrix representation of R.
Also check for all seven properties of relations.
4
Any Questions?
5
INTRODUCTION TO FUNCTIONS:
A function is an association between set of input and set of output in
which each input of one set (called Domain) has exactly one output in
another set (called Codomain).
• This means there must be one arrow linking each point in the Domain set to
unique element in the Codomain set.
• Also, that there can be no more than one arrow leaving each point in the
Domain set.
ELEMENTS OF A FUNCTION:
We write f : A B to indicate that f is a function from A to B.
• The set A is called the domain of f.
• The set B is called the co-domain of f.
The range of f denoted by f [A], is the set of all images; that is,
f [ A] { f ( x ) : x A}
The pre-image or inverse image of a set B contained in the range of f is
denoted by f 1 ( B) and is the subset of the domain whose members have
images in B.
7
ELEMENTS OF A FUNCTION:
In the previous example, we have f : A B
to indicate that f is a function from A to B.
• The domain of f = {a, b, c}
• The co-domain of f = {p, q, r, s}
• The range of f = {p, q , s}
8
Functions and Correspondences:
• Equations are used to represent functions.
• An equation determines a correspondence between two sets of real
numbers, x and y:
For example,
Equation: y = x2 + 1
Correspondence: Each value of x leads to exactly one value of y.
Rule: Square x and add 1.
9
Variables:
• For equation y = x2 + 1, we are free to choose whatever value of x
we like. The value of y will be determined by the equation.
• The value of y depends on the value of x.
• We call y the dependent variable.
• We call x the independent variable.
10
Variables (Contd.):
• The idea of inputs and outputs can be illustrated by diagram:
Input (x) Rule of Output (y)
correspondence
y = x2 +1
Try input x = 2: x=2 y = (2)2 + 1 y=5
x = -3 y = (-3)2 + 1 y = 10
Try input x = -3:
11
Graphing a function:
• We can graph equation y = x2 + 1:
x y
-2 5
y -1 2
5 0 1
1 2
2 5
x
-2 2
• On the graph, input x = -2 and 2 gives output y = 5.
• Note that two different inputs can give the same output.
12
Examples of Functions:
Example: 1
• Let X = {a, b, c} and Y = {p , q, r, s}
• We can define a function by selecting the elements of X one by one
associating with each a unique element of Y.
• For example, f(a) = q, f(b) = s and f(c) = p is a valid function definition, and
range (f) = { q, s, p}.
13
Examples (Contd.):
Note that the same function could be defined by an arrow diagram:
For such a diagram to be valid function definition there must be one and
only one arrow from every element x X
14
Examples (Contd.):
Example 2 : Neither of the diagrams provide proper function definitions since
A B A B
(i) f(b) is not defined
(ii) f(c) is not uniquely defined.
15
Examples (Contd.):
Example 3: Let X = {0, 1, 2, 3}, Y = {4, 5, 6, 7}
The following are proper definitions of functions from X to Y:
i. { (0, 6), (1, 4), (2, 5), (3, 7) }
ii. { (2, 6), (3, 6), (1, 6), (0, 6) }
but the following are not:
iii. { (3, 7), (0, 4), (2, 5) }
iv. { (0, 6), (1, 4), (3, 4), (2, 7),(2,4) }
v. { (0, 4), (1, 7), (5, 5), (2, 6), (3, 6) }
vi. { (0, 4), (1, 8), (2, 6), (3, 5) }
16
Any Questions?
17
Function Notation (1):
• To indicate that y is a function of x, we use function notation and write
y = f(x)
• When x = a, where a is a real number, the value of y is written as f(a)
• For example, given that y = f(x) = x2 + 2
When x = 4, the value of y is written as f(4):
Substitute x = 4 f(4) = (4)2 + 2
= 18
Function Notation (2):
• For a function f(x), the input x can be either numbers or other variables.
• For example, let f(x) = x2 + 2x -1
f(2) = (2)2 + 2(2) – 1
=7
f(k) = (k)2 + 2(k) – 1
= k2 + 2k – 1
f(3k) = (3k)2 + 2(3k) – 1
= 9k2 + 6k – 1
19
Domain (1):
• For a function f(x), x is the input and y = f(x) is the output.
• The set of input values x is called the domain of the function.
• The set of output values y is called the range of the function.
• Some functions have restriction on values of x and hence the domain does not
contain all real numbers.
20
Domain (2):
Consider a polynomial equation such as
y = x3 + 2x2 – 5x + 3
There is no restriction on x because any real number can be cubed, squared,
multiplied and combined.
The domain is a set of all real numbers.
This means that the value of input can be chosen to be any real number.
21
Domain (3):
Consider the case where input x is under the square root such as
y x 1
There is a restriction on x because the number placed under the square root cannot be negative.
Therefore, x – 1 ≥ 0
x≥1
This means that the possible values of inputs are any real number that is greater
than or equal to 1.
22
Domain (4):
Consider when the input x is in the denominator such as
1
y
x6
There is a restriction on x since the denominator cannot be zero.
Hence, x - 6 0,
x6
The domain is any real number except 6.
23
Exercise:
Try this by yourself.
Find the domain of the function defined by each equation:
(a) y x 2 x 5
7x
(b) y
5x 3
a.There is no restriction on x outside square root.
b.There is no restriction on x in numerator.
24
Exercise:
Try this by yourself.
Let 4x 2
f ( x)
( x 3)( x 2)
(a) Find the domain of f(x) (b) Evaluate f(2)
a. The denominator is zero when x = 3, -2.
The domain is any real number except 3 and -2.
25
Any Questions?
26
Composite Functions (1):
• Often one quantity is a function of a second quantity that depends, in
turn, on a third quantity.
• For example, the cost of car trip is a function of the gasoline consumed.
The amount of gasoline consumed, in turn, is a function of the number of
miles driven.
• The chains of dependence are known as composition of
functions.
27
Composite Functions (2):
• Suppose that y = f(x) and y = g(x) define two functions.
• A value of x inserted in function g will produce an output g(x).
• This output g(x) is then inserted in function ‘f’ to produce an output f(g(x))
• The final outcome f(g(x)) is written as
( f g )( x) Composite function
28
Composite Functions (3):
Another way of illustrating composite function:
f g
g f
x f(g(x))
g(x)
f(g(x))
Domain of Range of f
g Range of g,
Domain of f
29
Composite Functions (4):
To illustrate this, let f(x) = 5x + 1 and g(x) = 4x – 3
By definition,
( f g )( x) f ( g ( x))
( f g )( x) f ( g ( x)) ( g f )( x) g ( f ( x))
f (4 x 3) g (5 x 1)
5(4 x 3) 1 4(5 x 1) 3
20 x 14 20 x 1
(f g)(x) (g f)(x)
30
Composite Functions (5):
Example: ( f g )( x)
If f(x) = 2x2 + 1 and g(x) = x + 1, then find ( f and
g )(3)
By definition,
( f g )( x) f ( g ( x))
f ( x 1)
2( x 1) 2 1
2( x 2 2 x 1) 1
2x2 4x 3
Hence,
( f g )(3) 2(3) 2 4(3) 3
33 31
Any Questions?
32
Types of function…
33
INJECTIONS:
• Let f : A B be a function. The function f is called an injective function,
or an injection, if x, y A, f( x ) f(y) implies x = y.
• Graphically this means that if two arrows arrive at the same point in B, they
must come from the same point in A, and therefore they are the same.
• An injective function is also called a one-to-one function, or
a 1 1 function.
34
INJECTIONS (Contd.):
1 a
• Example :
Graph represent an injective function 2 b
3 c
d
one-to-one function
35
SURJECTIONS:
• The function f is called a Surjective Function, or a Surjection,
y B x A f ( x) y
if for all
• Graphically this means there must be an arrow arriving at each point of B.
• A surjective function is also called an onto function.
• If the co-domain set is equal to range set, then the function is surjective.
36
SURJECTIONS (Contd.):
• Example : 1
Graph represent a surjective function a
2 b
3
onto function
37
BIJECTIONS:
• A function can also be neither 1 - 1 nor onto, or it can be both 1 - 1 and onto.
• If a function is both 1 - 1 and onto it is called a Bijection or Bijective
Function.
38
BIJECTIONS (Contd.):
• Example : Graph represent a Bijective Function
a x
b y
c z
39
BIJECTIONS (Contd.):
• Example : Graph represent a function that is neither 1- 1 nor onto
a x
b y
c z
40
Any Questions?
41
Inverse Functions (1):
x1 y1
• Function f maps each number in the domain x2 y2
of f to the corresponding number in the x3 y3
range of f. Domain Range
• Inverse function, symbol f-1, reverses x1 f-1 y1
the correspondence and maps each number x2 y2
in the range of f to the number in the x3 y3
Domain Range
domain.
42
Inverse Functions (2):
• To find f-1, we follow these steps:
1.Replace f(x) with y
2.Interchange variables x and y
3.Solve the resulting equation for y
4.Replace y with f-1(x)
43
Inverse Functions (3):
Example: Find the inverse of f(x) = 3x + 2.
• Step 1: Replace f(x) with y.
• Step 2: Interchange variables y and x.
• Step 3: Solve the resulting equation for y.
• Step 4: Replace y with f-1(x).
f-1(x)
44
Inverse Functions (4):
• From the previous example,
f(x) = 3x + 2 gives f-1(x)
Consider,
( f f 1 )( x) f ( f 1 ( x)) ( f 1 f )( x) f 1 ( f ( x))
x2 (3 x 2) 2
3 2
3 3
x x
( f f 1 )( x) ( f 1 f )( x) x
Hence,
If the inverse of any function f(x) is again a function, then f(x) is known as
Invertible Function.
45
Exercise:
Try this by yourself.
Let f(x) = x2 – 3. Find f-1(x).
y x 3 2
Replacing f(x) with y
x y 3 2
Interchanging x and y
y 2
x3
y x3 Solving for y
f 1
( x ) x3 Replacing y with f-1(x)
46
Any Questions?
47
Summary: Week 11 Lecture
• Concept of function
• Types of functions
• Composite function
• Invertible functions
• Inverse of a function
48
What to Expect: Week 11 Tutorials
• Review and practice Function's problems through in-class assignments to
actually acquire them.
• Practice problems to know how concept of functions can be useful in
solving various mathematical problems.
49
Thank you