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.

$\endgroup$
14
  • 1
    $\begingroup$ Is $[x]$ the floor function? $\endgroup$
    – freakish
    Feb 10, 2017 at 12:31
  • $\begingroup$ $[ ]$ denotes greatest integer function. $\endgroup$
    – Avi
    Feb 10, 2017 at 12:32
  • 1
    $\begingroup$ Your (1) and (2) just hold for $x \notin \mathbb{Z}.$ $\endgroup$
    – User
    Feb 10, 2017 at 12:32
  • 2
    $\begingroup$ How many integers are there between $-2$ and $0$ non-inclusive? $\endgroup$
    – lulu
    Feb 10, 2017 at 12:32
  • $\begingroup$ Also, you should specify that $x$ is not an integer. $\endgroup$
    – lulu
    Feb 10, 2017 at 12:33

3 Answers 3

2
$\begingroup$

$\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}$

$\endgroup$
1
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

$T=\left\lfloor x \right\rfloor + \left\lfloor { - x} \right\rfloor $

When x=n, only integer

$\underbrace {\left\lfloor x \right\rfloor }_n + \underbrace {\left\lfloor { - x} \right\rfloor }_{ - n} \Rightarrow n - n = 0$

When x=n+a, $a\in(0,1)$

$\left\lfloor {n + a} \right\rfloor + \left\lfloor { - n - 1 + 1 - a} \right\rfloor $

$a \in \left( {0,1} \right)$, therefore $a' = 1 - a \in \left( {0,1} \right)$

$\underbrace {\left\lfloor {n + a} \right\rfloor }_n + \underbrace {\left\lfloor { - n - 1 + a'} \right\rfloor }_{ - n - 1} = n - n - 1 = - 1$.

Hence when x is an integer $T=0$, else $T=-1$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .