Question
Question: Show that the function \(f:N\to N\), given by \[f(x)=\left\\{ \begin{matrix} x+1, & \text{if ...
Show that the function f:N→N, given by
x+1, & \text{if }x\text{ is odd} \\\ x-1, & \text{if }x\text{ is even} \\\ \end{matrix} \right.$$ is both one-one and onto.Explanation
Solution
Use the standard procedure to a check whether a function one-one or onto. The test for one-one determines whether a one element from the domain is mapped to exactly one element from the range. The test determines whether all elements of the range are mapped to an element of the domain set. In symbols, if a function f:A→B is one-one, then for some x1,x2∈A and f(x1)=f(x2) then x1=x2. Similarly, if the function f:A→B is onto the for every y∈B, there exists x∈A such that y=f(x).
Complete step by step answer:
The given function sends a natural number to another natural number and is defined as,