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?
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?
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 $$
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. $$