To find whether $f:\mathbb{N}\to\mathbb{N}$ defined with $f(x)=\left\lfloor\frac{x+1}{2}\right\rfloor$ is one-one and onto

922 Views Asked by At

$f$ is a function from $\mathbb{N}$ to $\mathbb{N}$. $$ f(x)= \begin{cases} x+1 & \text{ if } x \text{ is odd} \\ x-1 & \text{ if } x \text{ is even} \end{cases} $$

I have proved it one-one by taking $x_1$ and $x_2$ either even or odd and putting $f(x_1)=f(x_2)$, which gives $x_1=x_2$. And for onto, I took $f(x)=y$, for both cases, and then found its inverse, which is defined for all $x$ belonging to $\mathbb{N}$.

There is another function from $\mathbb{N}$ to $\mathbb{N}$ $$ f(x)= \begin{cases} \frac{x+1}{2} & \text{ if } x \text{ is odd} \\ \frac{x}{2} & \text{ if } x \text{ is even} \end{cases} $$ To find: whether it is bijective or not. I followed the same procedure as above but it gives that it is bijective. But the answer is that it's not one-one but it's onto. Someone suggested to take one more case as $x_1$ is odd and $x_2$ as even while finding the proof for one-one, and here I got totally stuck.

1

There are 1 best solutions below

4
On

If I understand correctly, your function $f$ from $\mathbb R$ to $\mathbb R$ being defined just for integers, we have to interpolate in order to get a bijection.

It is clear that $f$ must be necessarily non-continuous because of intermediate values theorem.

There are a lot of possibilities for such an $f$ as suggested by the figure below. The analytic expression of an example can be given by $$f(x)=\begin{cases} x-1\space\text{for}\space 2n+1\lt x\le 2n\\x+1\space \text{ for}\space 2n\lt x\le 2n+1\end{cases}$$ in which the black arcs in the figure are just segments of the given lines $y=x-1$ and $y=x+1$

enter image description here