While reading about greatest integer function from a book, I found a question as $\left \lfloor{x}\right \rfloor+\left \lfloor{-x}\right \rfloor$ ?
I attempted it as follows:
We know:
$x-1<\left \lfloor{x}\right \rfloor< x\tag1$
Also then: $-x-1 < \left \lfloor{-x}\right \rfloor < -x\tag2$
Adding $(1)$ & $(2)$, we get
$-2< \left \lfloor{x}\right \rfloor+\left \lfloor{-x}\right \rfloor<0$.
This is the answer which I got, but the actual answer was $\left \lfloor{x}\right \rfloor+\left \lfloor{-x}\right \rfloor= -1$. I am not getting this. Where my method has gone wrong? Please help me.
We have $x=\lfloor x\rfloor+\{x\}$.
As you can draw integer numbers out the floors,
$$\lfloor x\rfloor+\lfloor-x\rfloor=\lfloor\lfloor x\rfloor+\{x\}\rfloor+\lfloor-\lfloor x\rfloor-\{x\}\rfloor=\lfloor x\rfloor+\lfloor\{x\}\rfloor-\lfloor x\rfloor+\lfloor-\{x\}\rfloor$$ and the integer parts cancel out.
Now,
$$\lfloor x\rfloor+\lfloor-x\rfloor=\lfloor\{x\}\rfloor+\lfloor-\{x\}\rfloor$$
which is one of $0$ or $-1$ (see why), and the original claim is wrong.