Floor and ceiling math

112 Views Asked by At

lets say we have this expression $[\frac{n}{9}] + [\frac{n}{4}]$

$$=\left[\frac{n}{9}\right] + \left[\frac{n}{4}\right]$$

$$\leq \frac{n}{9} + \frac{n+3}{4}$$

Is this true? If so where did the 3 come from and why did the $[\frac{n}{9}]$ not change?

2

There are 2 best solutions below

0
On BEST ANSWER

If the equation was $\lfloor \frac n9\rfloor + \lceil \frac n4 \rceil \le \frac n9 + \frac n4$

Then either $n = 4k; 4k+1; 4k + 2;$ or $4k+3$ for some $k$.

If $n = 4k$ then $\lceil \frac n4 \rceil = k < \frac {n+3}4 = k + \frac 34$.

Otherwise if $n = 4k + j; j\ge 0$ then $\lceil \frac n4 \rceil= k+1$.

But $\frac {n+3}4 = k + \frac {j+3}4$. But $j \ge 1$ so $j + 3 \ge 4$ so $\frac{n+3}4 = k + \frac {j+3}4 \ge k + 1 = \lceil \frac n4 \rceil$.

And $\lfloor \frac n9\rfloor \le \frac n9$. The floor is irrelevant because it is less so it didn't change. The ceiling is relevant as it might round up but by adding $3$ we assure that if it does round up, adding $3$ will increase the fraction by at least that amount of rounding up.

==== the below was when we thought both were floors ====

It true in the sense that $2 + 3 \le 2 + (3 + 7)$ is true. It is never the case that $[\frac n9] + [\frac n4] = \frac n9 + \frac {n+3}{4}$. But it is always the case that $[\frac n9] + [\frac n4] \le \frac n9 + \frac {n}4 < \frac n9 + \frac {n+3}4$.

So it is always true that $[\frac n9] + [\frac n4] \le \frac n9 + \frac {n+3}4$.

The $3$ came out of the text-writers $\not\text{a}\not\text{s}\not\text{s}$ imagination. S/he could have chosen any positive number and it would have always been true. Why didn't the $\frac n9$ change? Because it didn't have to; neither did the $\frac n4$. So why did the $\frac n4$ change? It didn't have to, but the text-writer was a $\not\text{p}\not\text{e}\not\text{r}\not\text{v}\not\text{e}\not\text{r}\not\text{t}$ creative human being with a sense of humor.

0
On
  • $n=9q+a$ with $a\in\{0,..,8\}$ then $\frac n9=q+\frac a9$

$\lfloor \frac n9\rfloor=q\le \frac n9$

  • $n=4k+b$ with $b\in\{0,..,3\}$ then $\frac n4=k+\frac b4$

If $b=0$ then $\lceil \frac n4\rceil=k\le \frac n4\le\frac{n+3}4$

If $b>0$ then $\lceil \frac n4\rceil=k+1\le\frac n4-\frac b4+1=\frac{n+(4-b)}4$

the minimum $b$ being $1$, we always have $4-b\le 3$ and so $\lceil \frac n4\rceil\le \frac{n+3}4$


Combining both you get $\lfloor \frac n9\rfloor+\lceil \frac n4\rceil\le\frac n9+\frac{n+3}4$

And generally speaking you can verify that $\lfloor \frac nu\rfloor+\lceil \frac nv\rceil\le\frac nu+\frac{n+(n-1)}v$