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

If $f: N \rightarrow Z$ is defined by $f(n)=\begin{cases} 2 & \text{if } n=3k, k \in Z \\ 10 & \text{if } n=3k+1, k \in Z \\ 0 & \text{if } n=3k+2, k \in Z \end{cases}$, then $\{n \in N: f(n)>2\}$ is equal to

If a function $f: R \rightarrow R$ is defined by $f(x)=x^3-x$,then $f$ is

Let $f : R \rightarrow R$ be a function such that $f(x) = \frac{x^2+2x+1}{x^2+1}$. Then

Let $f: N \rightarrow N$ be defined by $f(n) = \begin{cases} \frac{n+1}{2}; & \text{if } n \text{ is odd} \\ \frac{n}{2}; & \text{if } n \text{ is even} \end{cases}$. Then $f$ is:

Let $[t]$ be the greatest integer less than or equal to $t$. Let $A$ be the set of all prime factors of $2310$ and $f: A \rightarrow Z$ be the function $f(x) = \left[\log_2\left(x^2 + \left[\frac{x^3}{5}\right]\right)\right]$. The number of one-to-one functions from $A$ to the range of $f$ is:

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