Functions and Relations
Definition 1: A relation is any set of ordered
pairs.
Example 1 : G = { ( 2, 1 ),( 3, 0 ),( -1 ,4 ),( 5, -
1 )}
The set of all first elements(x-component) is called
the domain
• The set of all second elements(y-component) is
called the range
Example 2 : K = { ( a, b ) , ( 1, 0 ) , ( a , z ) , ( 3 ,-2 ) }
What is the domain of K?
answer: domain = { a , 1 , 3}
What is the range of K?
answer: range = { b , 0 , z , -2 }
Definition 2: A function is a relation or a set of
ordered pairs in which for every first element
there corresponds exactly one and only one
second element. Otherwise, it is simply a relation.
Example 3 : T = { ( 1, 2 ),( 2, 3 ) ,( 6 , 3 ) ,( -1 , 1 ) }
Tip : NO two ordered pairs have the same first
element
Which of the following set of ordered pairs is a
function and which one is a relation.
W={(2,-1) , (-1, 2 ), ( 3,4), ( 4, 3), ( -2,1)}
function
F = {(1,0), ( -2, -2 ), ( 0, 0), (1, 4) , (2, -2 )}
relation
H = {(Mar, Ann) , ( Bob, Rea), ( Mar, Emz),
( Lex, Gee)}
relation
S = {(B,D),( F,R),(Q,L ), (K,R)}
function
Determining Whether an Equation
is a Function or a Relation
Like the ordered pairs, to determine if an
equation is a function , it must not contain
same value of x with different values of y.
Example. Which of the following equations is a
function and which is a relation?
1) 2x + y = 3 2) y2 - x2 =
16
Solution. Here ,we assign values to x and solve for y
• 2x
y2 -+xy2 ==316
yy=2 3=-16
2x + x2
x y
x 0 y3
3 -1 +5 5 , -5
0 2 -1 +4 , -4
-1 +√17 , -√17
Here,we
Here, weget 2 values
get uniqueofvalue
y for every value of x
of y for every
Hence, value of xiswe
this equation a relation.
assign. Hence, this
equation is a function
• 2x
y2 -+xy2 = 316
y2==316-2x
+ x2
when
whenx =x =-1
3, y2, =y=?16 + 32
y = 3 - 2(-= 16+9 =25
1) y = + 5 , -5
x=0 , y2 = 16 -0y =32
= +2
16
=5 y = +4 , - 4
• Example 1: Identify the domain and
the range of f(x) = 5x – 4
Solution:
assume f(x) as y . That is,
f(x) = 5x - 4
y = 5x - 4
• assign different values to x then solve for y.
That is
if x = 2 then y = 5(2) - 4 = 6
if x = 0 then y = 5(0) - 4 = -4
if x = -1 then y = 5(-1) - 4 = -9
if x = 1/5 then y = 5(1/5) - 4 = -
3
Domain: All real numbers
Range : All real numbers
Evaluating a Function
Example 1.Evaluate the function f(x) = 2x2 + 3x – 1
at a) f( 0 ) b) f(-2) c) f( ½ ) d) f ( a)
Solution:
a) f(0) = 2(0)2+3(0)-1 b) f(-2) = 2(-
2)2+3(-2) -1
= -1
= 8 -6-1 = 1
c) f( ½ )=2( ½)2+3( ½)-1 d)f(a) = 2(a)2+3(a)-1
= 1/2 +3/2 -1
2
Example 2. Evaluate f(x) = x2 - 3x + 5
at a) f (1) b) f ( -2 ) c) f (4)
solution:
a) f(1) = 12 - 3(1) + 5 = 1 - 3 + 5 = -2 + 5 = 3
b) f(-2) = (-2)2 - 3(-2) + 5 = 4 +6 +5 = 15
c) f(4) = 42 - 3(4) + 5 = 16 -12 + 5 = 4 + 5 = 9
Piece-wise functions
A piece -wise function is a function defined
by more than one sub-functions where each
sub-function has a particular domain.
Example.
4+x if x <
-1
f(x) =
|x -2| if x ≥ -1
Example 1
4+x if x
< -1
f(x) =
|x -2| if x ≥ -
1
Evaluate the above piece -wise function at
a) f(-2) b) f (0) c) (-1)
solution:
a) f(-2) = 4 + x
= 4 + ( -2 ) = 4 - 2 = 2
b) f(0) = | x - 2|
= | 0 - 2| = |-2 | = 2
c) f(-1) = |x - 2 |
= |- 1 - 2 | = | -3 | = 3
Example 2.
x-1 , x>2
f(x) =
2 – x2 , x≤ 2
Evaluate the above piece-wise function at
a)f(5) and b) f(2) c) f ( 3)
Solution:
a) f(x) = x – 1 b) f(x ) = 2 – x2
f(5) = 5 – 1 f(2) = 2 - 22
= 4
= 2 - 4 = -2
c) f(x) = x - 1
f(3) = 3 - 1
= 2