$\left\lfloor x\right\rfloor + \left\lfloor n - x\right\rfloor = n -1$

90 Views Asked by At

For any integer n and any real number x, if x is not integer then

$$\left\lfloor x\right\rfloor + \left\lfloor n - x\right\rfloor = n -1$$

How to prove this argument?

3

There are 3 best solutions below

0
On

Since $x$ is not an integer, there is an integer $m$ such that $$ m < x < m + 1. $$ It follows additionally that $$ n - m - 1 < n - x < n-m. $$ In conclusion, $$ \lfloor x \rfloor + \lfloor n - x \rfloor = (m) + (n - m - 1) = n- 1. $$

0
On

Note that $\lfloor n-x\rfloor = n+\lfloor -x\rfloor$ and it should be easy to complete.

0
On

Denote $x = i.f$ where $i$ is the integral part of $x$ and $f$ is the fraction part. Because $x$ is not an integer, we know $ 0 < 0.f < 1 $. Therefore, $$ \color{blue}{\lfloor x \rfloor} + \color{red}{\lfloor n - x \rfloor} = \color{blue}{\lfloor i.f \rfloor} + \color{red}{\lfloor n - i - 0.f \rfloor} = \color{blue}{i} + \color{red}{n-i-1} = n - 1 $$