If the sum of $-10.5$ and $+15.0$ is rounded down, it becomes $4$. How to distribute the effect of rounding among the summands?

113 Views Asked by At

This may seem a simple stupid question but its driving me crazy for 4 hours.

I have two values $-10.5$ and $+15.0$

These values sum $4.5$. For whatever reason that doesn't matter the end result must be floored. The final value in this case must be $4$.

The $0.5$ difference must be distributed on the first two values.

What is the mathematical equation to apply to the first two values for they to sum $4$?

1

There are 1 best solutions below

0
On

In this particular case you can just floor the two values: $\lfloor-10.5\rfloor+\lfloor15.0\rfloor=-11+15=4$.

This doesn't work in general though, since $$\lfloor-10.5\rfloor+\lfloor14.5\rfloor=-11+14=3\ne\lfloor-10.5+14.5\rfloor=4.$$

Let's try to find a function $f$ such that $\lfloor a+b\rfloor=f(a)+f(b)$. Setting $a=b=0$ gives $$0=\lfloor 0+0\rfloor=f(0)+f(0)=2f(0)\implies f(0)=0.$$ Now we can set $b=0$ while letting $a$ be any number. This gives $f(a)=\lfloor a\rfloor$, which we already concluded did not work in general. Thus it is impossible to find a function that works in the general case.