Is $\lfloor{\frac{a+b+c+d}{4}}\rfloor=\lfloor\frac{\lfloor{\frac{a+b}{2}}\rfloor+\lfloor{\frac{c+d}{2}}\rfloor}{2}\rfloor$ for $a,b,c,d\in\mathbb R$?

Does the following hold $\forall a,b,c,d\in\mathbb R$? $$\quad\left\lfloor{\frac{a+b+c+d}{4}}\right\rfloor=\left\lfloor\frac{\left\lfloor{\frac{a+b}{2}}\right\rfloor+\left\lfloor{\frac{c+d}{2}}\right\rfloor}{2}\right\rfloor?$$


It seems like it's enough to restrict $a,b,c,d$ to $[0,4)$, and then we can do a case analysis for all possible values of $\left\lfloor{\frac{a+b}{2}}\right\rfloor,\left\lfloor{\frac{c+d}{2}}\right\rfloor$.

Is there a simpler way?


As suggested in a comment, an equivalent questions is whether the following holds for all $x,y\in\mathbb R$:

$$\left\lfloor\frac{x+y}{2}\right\rfloor = \left\lfloor\frac{\left\lfloor x\right\rfloor+\left\lfloor y\right\rfloor}{2}\right\rfloor.$$


As suggested in the answer (and one of the comments), this fails, e.g., for $a=2.5, c=1.5, b,d=0$.

A followup question:

Does the equality hold for all $a,b,c,d\in\mathbb N$?


Solution 1:

The result is false. As pointed out by J.G., we can apply change of variable $x=\frac{a+b}{2}$ and $y=\frac{c+d}{2}$ to get:

\begin{equation*} \lfloor \frac{x+y}{2}\rfloor = \lfloor \frac{ \lfloor x \rfloor+\lfloor y\rfloor}{2}\rfloor \end{equation*}

But this cannot hold for every real $x$ and every real $y$: just put $x=2.5$ and $y=1.5$ for example.

Edit:

If $a$, $b$, $c$, and $d$ are all positive integers, we can just make sure $a+b=5$ and $c+d=3$ to get $x=2.5$ and $y=1.5$ so that the result fails even if we assume they are all positive integers.