Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store
seo-qna
SearchIcon
banner

Show that the function $f:N\to N$, given by
\[f(x)=\left\{ \begin{matrix}
   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.

Answer
VerifiedVerified
510.6k+ views
Hint: 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\to B$ is one-one, then for some $\text{ }{{x}_{1}},{{x}_{2}}\in A$ and $f\left( {{x}_{1}} \right)=f\left( {{x}_{2}} \right)$ then ${{x}_{1}}={{x}_{2}}$. Similarly, if the function $f:A\to B$ is onto the for every $y\in B$, there exists $x\in A$ such that $y=f\left( x \right)$.

Complete step by step answer:
The given function sends a natural number to another natural number and is defined as,
\[f(x)=\left\{ \begin{matrix}
   x+1, & \text{if }x\text{ is odd} \\
   x-1, & \text{if }x\text{ is even} \\
\end{matrix} \right.\]
Case-1: when $x$ is odd
Testing one-one using standard procedure, for some odd ${{x}_{1}},{{x}_{2}}\in N$ we assume \[f\left( {{x}_{1}} \right)=f\left( {{x}_{2}} \right)\] then,
\[\begin{align}
  & f\left( {{x}_{1}} \right)=f\left( {{x}_{2}} \right) \\
 & \Rightarrow {{x}_{1}}+1={{x}_{2}}+1 \\
 & \Rightarrow {{x}_{1}}={{x}_{2}} \\
\end{align}\]
So $f$ is one-one for all odd $x$.
Testing onto with using standard procedure,
 Let $y=f\left( x \right)$ for some $y\in N$ and for some odd $x\in N$ .Then,
\[\begin{align}
  & y=f(x) \\
 & \Rightarrow y=x+1 \\
 & \Rightarrow x=y-1 \\
\end{align}\]
So for every $y\in N$, we can find an odd natural number $x\in N$ such that $y=f(x)$ in the form of $y-1$. Hence $f$ is onto.\[\]
Case-2: when $x$ is even \[\]
Testing one-one using standard procedure, for some odd ${{x}_{1}},{{x}_{2}}\in N$ we assume $f\left( {{x}_{1}} \right)=f\left( {{x}_{2}} \right)$ then,
\[\begin{align}
  & f\left( {{x}_{1}} \right)=f\left( {{x}_{2}} \right) \\
 & \Rightarrow {{x}_{1}}-1={{x}_{2}}-1 \\
 & \Rightarrow {{x}_{1}}={{x}_{2}} \\
\end{align}\]
So $f$ is one-one for all even $x$.
Testing onto with using standard procedure,
 Let $y=f\left( x \right)$ for some $y\in N$ and for some even $x\in N$ .Then,
\[\begin{align}
  & y=f(x) \\
 & \Rightarrow y=x-1 \\
 & \Rightarrow x=y+1 \\
\end{align}\]
So for every $y\in N$, we can find an even natural number $x\in N$ such that $y=f(x)$ in the form of $y+1$. Hence $f$ is onto.
From case-1 and case-2 we can conclude that $f$ is both one-one and onto for all $x\in N$.

Note: The questions tests your basic knowledge of one-one and onto functions. The other name of one-one is injective and the other name of onto is surjective. You need to be careful when you apply the standard tests. A function which is both one-one and onto is called bijective function. The question can also be directly framed as to test bijectivity of the function.