

InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
1. |
Let N be the set of natural numbers and two functions f and g be defined as f, g : N → N such that,\(f\left( {\rm{n}} \right) = \left\{ {\begin{array}{*{20}{c}}{\frac{{{\rm{n}} + 1}}{2}}&{{\rm{\;if\;n\;is\;odd\;}}}\\{\frac{{\rm{n}}}{2}}&{{\rm{\;if\;n\;is\;even\;}}}\end{array}} \right.\)And g(n) = n - (-1)n. Then fog is:1. Onto but not one-one.2. One-one but not onto.3. Both one-one and onto.4. Neither one-one nor onto. |
Answer» Correct Answer - Option 1 : Onto but not one-one. From question, the function given is: \(f\left( {\rm{n}} \right) = \left\{ {\begin{array}{*{20}{c}}{\frac{{{\rm{n}} + 1}}{2}}&{{\rm{\;if\;n\;is\;odd\;}}}\\{\frac{{\rm{n}}}{2}}&{{\rm{\;if\;n\;is\;even\;}}}\end{array}} \right.\) Another function given is: \(g\left( n \right) = n - {( - 1)^n} = \left\{ {\begin{array}{*{20}{c}}{n + 1,{\rm{\;if\;}}n{\rm{\;is\;odd\;}}}\\{n - 1,{\rm{\;if\;}}n{\rm{\;is\;even\;}}}\end{array}} \right.\) Now, from question, \(\Rightarrow f\left( {g\left( n \right)} \right) = \left\{ {\begin{array}{*{20}{c}}{f\left( {n + 1} \right),{\rm{\;if\;}}n{\rm{\;is\;odd\;}}}\\{f\left( {n - 1} \right),{\rm{\;if\;}}n{\rm{\;is\;even\;}}}\end{array}} \right.\) \(\Rightarrow f\left( {g\left( n \right)} \right) = \left\{ {\begin{array}{*{20}{c}}{\frac{{n + 1}}{2},{\rm{\;if\;}}n{\rm{\;is\;odd\;}}}\\{\frac{{n - 1 + 1}}{2} = \frac{n}{2},{\rm{\;if\;}}n{\rm{\;is\;even\;}}}\end{array}} \right.\) ∴ f(g(n)) = f(x) If n is odd then (n + 1) is even and if n is even then (n - 1) is odd. Clearly, function is not one-one as f(2) = f(1) = 1. For every element y in the codomain Y of ‘f’ there is at least one element x in the domain X of ‘f ‘such that f(x) = y. So, the function is onto function. Thus, the given function is onto but not one-one function. |
|