60 FUNCTIONS AND ALGORITHMS [CHAP. 3
SolvedProblems
FUNCTIONS
3.1. LetX={ 1 , 2 , 3 , 4 }. Determine whether each relation onXis a function fromXintoX.
(a) f={( 2 , 3 ), ( 1 , 4 ), ( 2 , 1 ), ( 3. 2 ), ( 4 , 4 )}
(b) g={( 3 , 1 ), ( 4 , 2 ), ( 1 , 1 )}
(c) h={( 2 , 1 ), ( 3 , 4 ), ( 1 , 4 ), ( 2 , 1 ), ( 4 , 4 )}
Recall that a subsetfofX×Xis a functionf:X→Xif and only if eacha∈Xappears as the first coordinate
in exactly one ordered pair inf.
(a) No. Two different ordered pairs (2, 3) and (2, 1) infhave the same number 2 as their first coordinate.
(b) No. The element 2∈Xdoes not appear as the first coordinate in any ordered pair ing.
(c) Yes. Although 2∈Xappears as the first coordinate in two ordered pairs inh, these two ordered pairs are equal.
3.2. Sketch the graph of: (a)f(x)=x^2 +x−6; (b)g(x)=x^3 − 3 x^2 −x+3.
Set up a table of values forxand then find the corresponding values of the function. Since the functions are polynomials,
plot the points in a coordinate diagram and then draw a smooth continuous curve through the points. See Fig. 3-8.
Fig. 3-8
3.3. LetA={a, b, c},B={x,y,z},C={r, s, t}. Letf:A→Bandg:B→Cbe defined by:
f={(a, y)(b, x), (c, y)} and g={(x, s), (y, t), (z, r)}.
Find: (a) composition functiong◦f:A→C;(b)Im(f ),Im(g),Im(g◦f).
(a) Use the definition of the composition function to compute:
(g◦f )(a)=g(f (a))=g(y)=t
(g◦f )(b)=g(f (b))=g(x)=s
(g◦f )(c)=g(f (c))=g(y)=t
That isg◦f={(a, t), (b, s), (c, t)}.
(b) Find the image points (or second coordinates):
Im(f )={x, y}, Im(g)={r, s, t}, Im(g◦f)={s, t}