9/6/7 Mustf Jrrr: Leture Notes in Disrete Mthemtis. Birzeit University Plestine 05 Funtions 7.. Introdution to Funtions 7. One-to-One Onto Inverse funtions mjrrr 05 Wth this leture nd downlod the slides Course Pge: http://www.jrrr.info/ourses/dmth/ More Online Courses t: http://www.jrrr.info Aknowledgement: This leture is sed on (ut not limited to) to hpter 5 in Disrete Mthemtis with Applitions y Susnn S. Epp (rd Edition).
9/6/7 Mustf Jrrr: Leture Notes in Disrete Mthemtis. Birzeit University Plestine 05 Funtions 7. Introdution to Funtions In this leture: qprt : Wht is funtion qprt : Equlity of Funtions qprt : Exmples of Funtions qprt : Cheking Well Defined Funtions Motivtion Mny issues in life n e mthemtized nd used s funtions: Div(x) mod(x). FtherOf(x) TruthTle (x) In this leture we fous on disrete funtions
9/6/7 Wht is Funtion أبناء Domin اباء Co-domin X f Y x x x x SonOf y y y y y 5 علاقة بین عنصرین كل عنصر في المجال یجب ان یكون لھ صورة واحدة في المجال المقابل. لا یوجد عنصر في المجال لا یوجد لھ صورة في المجال المقابل A funtion Figure is 7.. reltion from X the domin to Y the odomin tht stisfies properties: ) Every element is relted to some element in Y; ) No element in X is relted to more thn one element in Y 5 Definition Funtion Definition A funtion f from set X to set Y denoted f : X Y is reltion from X the domin to Y the o-domin tht stisfies two properties: () every element in X is relted to some element in Y nd()noelementinx is relted to more thn one element in Y.Thusgivennyelementx in X thereisuniqueelementiny tht is relted to x y f.ifwellthiselementy thenwesytht f sends x to y or f mps x to y ndwritex f y or f : x y.theuniqueelementtowhih f sends x is denoted f(x) nd is lled f of x or the output of f for the input x or the vlue of f t x or the imge of x under f. The set of ll vlues of f tken together is lled the rnge of f or the imge of X under f.symolilly rnge of f = imge of X under f = {y Y y = f (x) forsomex in X}. Given n element y in Y theremyexistelementsinx with y s their imge. If f (x) = y thenx is lled preimgeofy or n inverse imge of y. Thesetofll inverse imges of y is lled the inverse imge of y. Symolilly the inverse imge of y ={x X f (x) = y}. 6
9/6/7 Exmple Let X = { } nd Y = {}. Define funtion f from X to Y X f Y Figure 7... Write the domin nd o-domin of f.. Find f () f () nd f ().. Wht is the rnge of f? d. Is n inverse imge of? Is n inverse imge of? e. Find the inverse imges of nd. f. Represent f s set of ordered pirs. 7 Exmple Whih re funtions? () () () Figure 7.. 8
9/6/7 Exmple Whih re funtions? () () () Figure 7.. () is not sent to ny element in of Y () The element isn t sent to unique element of Y () Funtion 9 Mustf Jrrr: Leture Notes in Disrete Mthemtis. Birzeit University Plestine 05 Funtions 7. Introdution to Funtions In this leture: qprt : Wht is funtion qprt : Equlity of Funtions qprt : Exmples of Funtions qprt : Cheking Well Defined Funtions 0 5
9/6/7 Equlity of Funtions Theorem 7.. A Test for Funtion Equlity If F: X Y nd G: X Y re funtions then F = G if nd only if F(x) = G(x) for ll x X. Exmple: Let J = {0 } nd define funtions f nd g from J to J s follows: For ll x in J f(x) = (x + x + ) mod nd g(x) = (x + ) mod. Does f = g? Equl funtions Equlity of Funtions Theorem 7.. A Test for Funtion Equlity If F: X Y nd G: X Y re funtions then F = G if nd only if F(x) = G(x) for ll x X. Exmple: Let F: R R nd G: R R e funtions. Define new funtions F + G: R R nd G + F: R R s follows: For ll x R (F + G)(x) = F(x) + G(x) nd (G + F)(x) = G(x) + F(x). Does F + G = G + F? (F + G)(x) = F(x) + G(x) y definition of F + G = G(x) + F(x) y the ommuttive lw for ddition of rel numers = (G + F)(x) y definition of G + F Hene F + G = G + F. 6
9/6/7 Mustf Jrrr: Leture Notes in Disrete Mthemtis. Birzeit University Plestine 05 Funtions 7. Introdution to Funtions In this leture: qprt : Wht is funtion qprt : Equlity of Funtions qprt : Exmples of Funtions qprt : Cheking Well Defined Funtions Exmples of Funtions Identity Funtion Funtion tht lwys hve the input is the sme s the outputs re lled identity funtions Identity funtion send eh element of X to the element tht is identil to it. I X (x) = x for ll x in X. Exmples of identity funtions? 7
9/6/7 Exmples of Funtions Sequenes An infinite sequene is funtion defined on set of integers tht re greter thn or equl to prtiulr integer. E.g. Define the following sequene s funtion from the set of positive integers to the set of rel numers ()n ' 5 n + 5 Exmples of Funtions Funtion Defined on Power Set Drw n rrow digrm for F s follows: om Setion 5. tht 9(A) F: -({ }) -* Znonneg F(X) = the numer of elements in X. ({ }) Z nonneg {} {} {} { } { } { } { } 0 5 6 8
9/6/7 Exmples of Funtions Crtesin produt M is the multiplition funtion tht sends eh pir of rel numers to the produt of the two. R is the refletion funtion tht sends eh point in the plne tht orresponds to pir of rel numers to the mirror imge of the point ross the vertil xis. 7 g: S à Z Exmples of Funtions String Funtions g(s) = the numer of 's in s. Find the following.. g(). g(). g() d. g() 8 9
( ) 9/6/7 Exmples of Funtions Logrithmi funtions Definition Logrithms nd Logrithmi Funtions Let e positive rel numer with =. For eh positive rel numer x the logrithm with se of x written log x is the exponent to whih must e rised to otin x. Symolilly log x = y y = x. The logrithmi funtion with se is the funtion from R + to R tht tkes eh positive rel numer x to log x. log 9 = euse = 9. log (/) = - euse - = ½. log 0 () = 0 euse 0 0 =. log ( m ) = m euse the exponent to whih must e rised to otin m is m. log m = m euse log m is the exponent to whih must e rised to otin m. 9 Definition Exmples of Funtions Boolen Funtions An (n-ple) Boolen funtion f is funtion whose domin is the set of ll ordered n-tuples of 0 s nd s nd whose o-domin is the set {0 }. Moreformllythe domin of Boolen funtion n e desried s the Crtesin produt of n opies of the set {0 } { whihisdenoted{0 } } n.thus f :{0 } n {0 }. Input Output P Q R S 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 () ( ) ( 0) ( 0 ) ( 0 0) (0 ) (0 0) (0 0 ) (0 0 0) () 0 0 0
9/6/7 Mustf Jrrr: Leture Notes in Disrete Mthemtis. Birzeit University Plestine 05 Funtions 7. Introdution to Funtions In this leture: qprt : Wht is funtion qprt : Equlity of Funtions qprt : Exmples of Funtions qprt : Cheking Well Defined Funtions Well-defined Funtions Cheking Whether Funtion Is Well Defined A funtion is not well defined if it fils to stisfy t lest one of the requirements of eing funtion Exmple: Define funtion f : R R y speifying tht for ll rel numers x f(x) is the rel numer y suh tht x +y =. There re two resons why this funtion is not well defined: For lmost ll vlues of x either () there is no y tht stisfies the given eqution or () there re two different vlues of y tht stisfy the eqution Consider when x= Consider when x=0
9/6/7 Well-defined Funtions Cheking Whether Funtion Is Well Defined Rell tht f : Q Z defines this formul: f ( m ) = m for ll integers m nd n withn = 0. n Is f well defined funtion? No Exmple: Well-defined Funtions Cheking Whether Funtion or not Y= BortherOf(x) Y= Prent Of(x) Y= SonOf(x) Y= FtherOf(x) Y= Wife Of(x)...