Relations and Functions: 3/28/2023 Instructor: Shazmina Gull COSC-1103 IUB RYK Campus 3
Relations and Functions: 3/28/2023 Instructor: Shazmina Gull COSC-1103 IUB RYK Campus 3
• EXERCISE:
Which of the relations define functions from X = {2,4,5} to Y={1,2,4,6}.
a. R1 = {(2,4), (4,1)}
b. R2 = {(2,4), (4,1), (4,2), (5,6)}
c. R3 = {(2,4), (4,1), (5,6)}
• SOLUTION :
a. R1 is not a function, because 5 ∈X does not appear as the first element in any ordered pair in R1.
b. R2 is not a function, because the ordered pairs (4,1) and (4,2) have the same first element but
different second elements.
c. R3 defines a function because it satisfy both the conditions of the function that is every element of
X is the first element of some order pair and there is no pair which has the same first order pair but
different second order pair.
NOTE: The unique element y of Y that is related to x by f is denoted f(x) and is called f of x, or the value of f at
x, or the image of x under f
• You can easily note that the above diagram satisfy the two conditions of a function hence a graph of the
function.
• Note that f(a) = 2, f(b) = 4,and f(c) = 2
• The relation given in the diagram (a) is Not a function because there is no arrow coming out of 5∈X to any
element of Y.
• The relation in the diagram (b) is Not a function, because there are two arrows coming out of 4∈X. i.e.,4∈X
is not related to a unique element of Y.
• SOLUTION:
a. f is not well defined since each integer n has two images +n and -n
b. f is not well defined since f(2) and f(-2) are not defined.
c. f is not defined for n < 0 since f then results in imaginary values (not real)
d. f is well defined because each integer has unique (one and only one) image in Runder f.
• 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 domain into the distinct
points of the co-domain.
• SOLUTION:
• f is clearly one-to-one function, because no two different elements of X are mapped onto the same element of
Y.
• g is not one-to-one because the elements a and c are mapped onto the same element 2 of Y.
• SOLUTION:
• f is not onto because 3 ≠ f(x) for any x in X. g is clearly onto because each element of Y equals g(x) for some
x in X. as 1 = g(c);,2 = g(d);3 = g(a) = g(b)
• REMARK:
• 1. A constant function is one-to-one iff its domain is a singleton.
• 2. A constant function is onto iff its co-domain is a singleton.
• Constant (1)
• Logarithmic (lg n)
• Linear (n)
• Linearithmic (n lg n)
• Quadratic (n)
• Cubic (n )
• Exponential (2 )