# Problem about $[x]$

$$[x]-2[x/2]\leq 1$$ Equivalently, $[x]-2[x/2]$ assumes only the values 0 and 1.

It seems easy, but I don't know how to prove it...

-
If $x$ is an integer, then your inequality is the same as saying $x \bmod 2 \leq 1$ – J. M. Nov 21 '11 at 14:35

Let $f(x)=[x]-2[x/2]$.

Then $$f(x+2)= [x+2]-2[(x+2)/2]=[x]+2-2[x/2+1]=[x]+2-2[x/2]-2=f(x) \,.$$

Thus $f$ is periodic with period $2$. It suffices to prove that $f(x) \leq1$ for all $x \in [0,2)$. But this is obvious since then $[x] \leq 1, [x/2] \geq 0$.

-
+1 Very neat. :-) – Srivatsan Nov 21 '11 at 16:41

Say $x=n+r$, with $0\leq r\lt 1$, and $n\in\mathbb{Z}$.

If $n=2k$ is even, then $\frac{x}{2} = k+(r/2)$, $0\leq (r/2)\lt 1$, so $[x]=2k$, $[x/2]=k$, and $[x]-2[x/2] = 2k-2k = 0$.

If $n=2k+1$ is odd, then $x/2 = k+(0.5+(r/2))$. Since $0\leq r\lt 1$, then $0\leq \frac{r}{2}\lt 0.5$, so $[x/2] = k$. Hence $[x]-2[x/2] = 2k+1 - 2k = 1$.

-
It should be $n=2k+1$ is odd? – Kou Nov 21 '11 at 14:31
@Kou: Indeed; fixed. Thanks! – Arturo Magidin Nov 21 '11 at 14:33

Let $y = \frac{x}{2}$ i.e. $x = 2y$. We then have $y = [y] + r$, where $0 \leq r <1$ and $[y] \in \mathbb{Z}$.

If $0 \leq r < \frac12$, then $0 \leq 2r<1$ and $2y = 2[y] + 2r$, where $2[y] \in \mathbb{Z}$.

Hence, $[2y] = 2[y] \implies [x] = 2 \left[\frac{x}2\right]$.

If $\frac12 \leq r < 1$, then $0 \leq 2r-1 <1$ and $2y = 2[y] + 1 + 2r-1$, where $2[y] + 1 \in \mathbb{Z}$.

Hence, $[2y] = 2[y] + 1 \implies [x] = 2 \left[\frac{x}2\right] + 1$.

Hence, $[x]- 2 \left[ \frac{x}2\right] \in \{0,1\}$.

-