InterviewSolution
Saved Bookmarks
| 1. |
Show that the function `f : N to N ` defined by ` f(x) = {[x-1 if x is even], [x +1 if x is odd]}` is one-one and onto. |
|
Answer» Suppose `f(x_(1)) = f(x_(2))` Case 1 when `x_(1) ` is odd and `x_(2)` is even In this case `f(x_(1)) =f(x_(2)) rArr x_(1) +1 =x_(2)-1` `rArr x_(2) - x_(1)=2` This is a codtradication since that difference between an odd interger and an even integer can never be 2. Thus in this case `f(x_(1)) ne f(x_(2))` Similarly when `x_(1)` is even and `x_(2)` is odd then `f(x_(1)) ne f(x_(2))` Case 2 when `x_(1) " and " x_(2)` are both odd In this case `f(x_(1)) =f(x_(2)) rArr x_(1)+ 1 =x_(2) -1` `rArr x_(1) =x_(2)` `:.` f is one-one Case 3 When `x_(1) " and " x_(2)` are both even In this case `f(x_(1)) =f(x_(2)) rArr x_(1) -1 =x_(2) -1` `rArr x_(1)= x_(2)` `:.` f is one-one In order to show that f is onto let `y in N` (the codomain) Case 1 when y is odd In this case `(y +1)` is even `:. f( y+1) =(y+1)-1 =y` Case 2 when y is even In this case `(y-1) ` is odd `:. f (y-1) =y-1 +1=y` Thus each `y in N` (codomain of f) has its pre-image in dom (f) `:. ` f is onto. Hence f is one-one onto. |
|