2
$\begingroup$

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.

  • 1
    Is $[x]$ the floor function?2017-02-10
  • 0
    $[ ]$ denotes greatest integer function.2017-02-10
  • 1
    Your (1) and (2) just hold for $x \notin \mathbb{Z}.$2017-02-10
  • 2
    How many integers are there between $-2$ and $0$ non-inclusive?2017-02-10
  • 0
    Also, you should specify that $x$ is not an integer.2017-02-10
  • 0
    Well if it's integer greater than $-2$ and less than $0$ then it's $-1$.2017-02-10
  • 0
    As @lulu hinted at: $[x]$ is only ever an integer, and the sum of two integers is again an integer. So what must $[x]+[-x]$ be, given that it lies strictly between $-2$ and $0$?2017-02-10
  • 0
    Does this means that my answer $-2<[x]+[-x]<0 was right, just because the answer should be an integer and there is only one integer between -2 to 0 .i.e -1. So the answer was written as -12017-02-10
  • 0
    @Avi Sort of. If $x\in\mathbb{Z}$ then $\lfloor x\rfloor + \lfloor -x\rfloor = 0$. The problem with your reasoning is that that $\lfloor x\rfloor < x$ holds only for $x\not\in\mathbb{Z}$, actually $\lfloor x\rfloor = x$ if and only if $x\in\mathbb{Z}$. Other then that yes, there is only one integer in open interval $(-2, 0)$.2017-02-10
  • 0
    So if in the question it is given that $x \notin \mathbb{Z}$ then my answer is right, isn't it?2017-02-10
  • 0
    Sorry for asking such a silly question, and thanks for answering it2017-02-10
  • 0
    Your question was not silly at all. You nicely exposed your own efforts and the missing link has been handed over to you now. Good case!2017-02-10
  • 0
    You *may not* add the equations (1) and (2) because the two $x$'s aren't the same !2017-02-10
  • 0
    $\left \lfloor0\right \rfloor+\left \lfloor-0\right \rfloor= 0$2017-02-10

2 Answers 2

0

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.

0

$\lfloor x\rfloor = \begin{cases}x&, x\in \mathbb{Z}\\ x-r(x) &, x\not \in \mathbb{Z}\end{cases}$

Where $r(x)$ is the smallest positive number such that $x-r(x)\in\mathbb{Z}$. See, that for $x\not\in\mathbb{Z}$ $r(-x)=1-r(x)$.

Because $x\in \mathbb{Z} \Rightarrow -x\in\mathbb{Z}$, we have

$\lfloor x\rfloor + \lfloor -x\rfloor = \begin{cases}x&-x&, x\in \mathbb{Z}\\ x-r(x) &-x-1+r(x) &, x\not \in \mathbb{Z}\end{cases} =\begin{cases}0&, x\in \mathbb{Z}\\ -1 &, x\not \in \mathbb{Z}\end{cases}$