1
$\begingroup$

Prove that $f(n)=(-1)^n\lceil{\frac{n}{2}}\rceil$ is bijective.

Where $f:\mathbb{N}\mapsto\mathbb{Z}$ and $\lceil x\rceil$ is the ceiling function.

I started by trying to prove that $f$ is injective.

\begin{align} f(a)&=f(b)\\ (-1)^a\left\lceil\frac{a}{2}\right\rceil&=(-1)^b\left[\frac{b}{2}\right]\\ (-1)^{a-b}\left\lceil\frac{a}{2}\right\rceil&=\left\lceil\frac{b}{2}\right\rceil \end{align}

if $a-b$ is even, then clearly $a=b$, but if it is odd then $a+b=-1$ which is indeed impossible.

Does that mean that this function is not injective?

So I don't know how to tackle this problem.

  • 1
    It's nicer to write $\lceil x \rceil$, since the characters exist: `\lceil` and `\rceil`.2017-02-28
  • 1
    Hint: $\lceil \frac{n}{2} \rceil = m \iff n=2m\,$ or $\,n=2m-1\,$.2017-02-28
  • 0
    @dxiv That's how I got $a+b=-1$ but I don't see the relation.2017-02-28

2 Answers 2

2

Check out the pattern: $(f(0),f(1),f(2),\ldots)=(0,-1,1,-2,2,-3,3,\ldots)$. The nonpositive integer outputs come from even inputs, and the negative integer outputs come from the odd inputs.

This leads to realizing that the following function undoes $f$. Define $g:\mathbb Z\to\mathbb N$ by $g(n)=2n$ when $n\geq 0$, and $g(n)=-2n-1$ if $n$ is odd. This is the inverse function of $f$. You can show this by showing that $f(g(n))=n$ for all $n\in\mathbb Z$, and $g(f(n))=n$ for all $n\in\mathbb N$. These equations imply that $f$ is bijective.

(This is an alternative approach to your equivalent approach of verifying directly from the definitions that $f$ is injective (and then surjective), and Mengchun Zhang had already answered your question of how to complete your attempt at showing injectivity.)

1

Since the domain is $\mathbb N$, we have $a\geq0,\ b\geq0$, and so $\lceil\frac a2\rceil\geq0,\ \lceil\frac b2\rceil\geq0$

If $\,a-b\,$ is odd, then $$\lceil\frac a2\rceil\ =\ -\lceil\frac b2\rceil$$

The equality holds only if $\,a=b=0$, but that is a contradiction of $a-b$ being odd

So $a-b$ must be even and that gives $a=b$, which is the result you have gotten

  • 0
    So this states that both $a$ and $b$ must be even, but then, for $a=2m+1$, $f(a)\neq f(k)$ which is indeed not injective?2017-02-28
  • 0
    Since $a-b$ is even, $a$ and $b$ can be both even or both odd, so if $a$ is odd, then b is odd2017-02-28