[Math] Why is $\lfloor n/3 \rfloor + \lceil 2n/3\rceil = n?$

algebra-precalculusceiling-and-floor-functions

Why is $\lfloor n/3 \rfloor + \lceil 2n/3\rceil = n?$

It feels like I'm just doing basic fraction addition since

$$\frac{n}{3}+\frac{2n}{3}=n$$

So then how does ceil and floor play a role in addition?

Best Answer

Note that both $\frac n3-\left\lfloor\frac n3\right\rfloor$ and $\left\lceil\frac{2n}3\right\rceil-\frac{2n}3$ have a period of $3$. Subtracting we get that $$ \left\lceil\frac{2n}3\right\rceil+\left\lfloor\frac n3\right\rfloor-n\tag{1} $$ has a period of $3$. Thus, we only need to check $n=0,1,2$ to verify $$ \left\lceil\frac{2n}3\right\rceil+\left\lfloor\frac n3\right\rfloor=n\tag{2} $$ for all $n$.

Related Question