Show that $f: N \rightarrow N$,given by $f(x) = \begin{cases} x+1, & \text{if } x \text{ is odd} \\ x-1, & \text{if } x \text{ is even} \end{cases}$ is both one-one and onto.

Vedclass pdf generator app on play store
Vedclass iOS app on app store
(A) Suppose $f(x_1) = f(x_2)$.
If $x_1$ is odd and $x_2$ is even,then $x_1+1 = x_2-1$,which implies $x_2-x_1 = 2$. Since $x_1$ is odd and $x_2$ is even,the difference between an even and an odd number is always odd,so $x_2-x_1$ cannot be $2$. Thus,this case is impossible.
Similarly,if $x_1$ is even and $x_2$ is odd,$x_1-1 = x_2+1$,implying $x_1-x_2 = 2$,which is also impossible.
Therefore,$x_1$ and $x_2$ must be both odd or both even.
If both are odd,$f(x_1) = f(x_2) \Rightarrow x_1+1 = x_2+1 \Rightarrow x_1 = x_2$.
If both are even,$f(x_1) = f(x_2) \Rightarrow x_1-1 = x_2-1 \Rightarrow x_1 = x_2$.
Thus,$f$ is one-one.
For onto,consider any $y \in N$. If $y$ is odd,$y = 2r+1$ for some $r \ge 0$. Then $f(2r+2) = (2r+2)-1 = 2r+1 = y$. If $y$ is even,$y = 2r$ for some $r \ge 1$. Then $f(2r-1) = (2r-1)+1 = 2r = y$. Since every $y \in N$ has a pre-image in $N$,$f$ is onto.

Explore More

Similar Questions

Let $f: R \rightarrow R$ be defined by $f(x) = x^{2} - \frac{x^{2}}{1+x^{2}}$ for all $x \in R$. Then,

The function $f: N \rightarrow N$ defined by $f(x) = \begin{cases} x+1, & x \text{ is odd} \\ x-1, & x \text{ is even} \end{cases}$ is . . . . . . .

The mapping $f: R \to R$ defined as $f(x) = \cos x, x \in R$ is:

Which of the following functions is surjective but not injective?

If a set $A$ has $m$ elements and set $B$ has $n$ elements and the number of injections from $A$ to $B$ is $2520$. Then,$m$ is equal to

Vedclass Products

For Students

Vedclass Test Series

Mock tests in real JEE/NEET style with performance analysis. 5-day free trial.

Start Free Trial
For Teachers

Exam Paper Generator

Generate Set A/B/C/D exam papers from 7.5L+ questions in 2 minutes. 3 chapters free.

Try Free
For Institutes

Online Exam Module

Live online exams with unlimited students, 360° analytics & white-label branding.

See Demo