Prove that the maximum difference between $\frac{n}{6}$ and $\lfloor \frac{(n-3)}{6} \rfloor$ is $1 \frac{1}{3}$?

42 Views Asked by At

Prove that the maximum difference between $\frac{n}{6}$ and $\lfloor \frac{(n-3)}{6} \rfloor$ where $n$ is an integer is $1 \frac{1}{3}$?

I know this is true because for $n = 8 + 6i$ where $i$ is an integer $\geq 0$, the difference is $1 \frac{1}{3}$. Plugging other values for $n$ gives a difference that is less than $1 \frac{1}{3}$.

How do you prove this without having to plug numbers into the equations and finding a pattern?

Edit: question was modified to specify that $n$ is an integer.

1

There are 1 best solutions below

0
On

The actual approach is essentially a fancier version of "plugging numbers in and finding a pattern".

Let $n = 6m + k$, where $0 \leq k \leq 5$.

Then $\frac{n}{6} = m + \frac{k}{6}$, and $\lfloor \frac{n - 3}{6} \rfloor = \lfloor (m - 1) + \frac{k + 3}{6} \rfloor = m - 1 + \lfloor \frac{k + 3}{6} \rfloor$. So $\frac{n}{6} - \lfloor \frac{n - 3}{6} \rfloor = 1 + \frac{k}{6} - \lfloor \frac{k + 3}{6} \rfloor$, and then we just need to prove that the difference between those last two terms is always less than or equal to $\frac{1}{3}$ (but bigger than $-\frac{7}{3}$, which is pretty obvious). You can split it into two cases - one where the floor function returns $0$, and one where it returns $1$.