This question of mine is a soft question. In this question I would like to ask
Is there a General formula for $\lfloor a+b\rfloor$?
In this question both $a,b \in \Bbb Z$ and $\lfloor \quad \rfloor$ is the floor function. I tried searching online for this but found none. Any help/hint is appreciated
Thanks in advance :)
Edit : Can $\lfloor a+b \rfloor = \lfloor a\rfloor + \lfloor a + b -\lfloor a\rfloor \rfloor$?
I tried to prove it in this way.
We know that $$\lfloor x+n\rfloor = \lfloor x\rfloor + n$$ if $n\in \Bbb Z$
So, $$\lfloor a \rfloor + \lfloor a+b-\lfloor a\rfloor \rfloor = \lfloor a \rfloor + \lfloor a+b\rfloor - \lfloor a \rfloor = \lfloor a+b\rfloor$$
Is this correct?
In response to your request to solve for $\lfloor a + b\rfloor$ for $a, b \in\mathbb{R}$ from principal-ideal-domain 's answer, we have $\lfloor a\rfloor + \lfloor b\rfloor + \lfloor a + b - \lfloor a \rfloor - \lfloor b\rfloor\rfloor$.
For $a,b \in \mathbb{Z}$, the formula simplifies to $\lfloor a\rfloor + \lfloor b\rfloor$.
Before anything else, let $\{n\}$ be the fractional part of $n$ where $\{n\} = n - \lfloor n\rfloor$. However, we will just use this in
The reason why we added $\lfloor \{a\} + \{b\}\rfloor$ is because there may be a case where $\{a\} + \{b\} \geq 1$. When this happens, there are several cases. For $a, b \geq 0$ or $a, b \leq 0$, we are correcting the undercounted the integer parts. For either $a < 0$, $b > 0$ or $a > 0$, $b < 0$, we are correcting the overcounted integer parts.
I know that this is not a proof, but merely the essence why it is like that.