# Solving equations involving the floor and ceiling function

The following conversion equation appears to work for all positive integers. I verified this experimentally. $$x=\left\lfloor\left\lceil x\cdot \frac{412}{256}\right\rceil\cdot \frac{256}{412}\right\rfloor$$ I'm not sure how to solve or make progress on this floor and ceiling equation for $$x$$. Could anyone point me in the right direction for tackling this problem? Or perhaps a counterexample for this if one comes to mind?

Result from Wolframalpha.

• @GSmith, I think he already did: See the Wolfram hyperlink. Commented Jul 10 at 5:35
• @Simon so Wolfram Alpha counts? when i posted the precious comment i thought is wasn't the right result or something, as the text for the hyperlink said wrong result. I wasn't too sure whether wolfram alpha counts as a proof before as well, but thanks for clarifying. Commented Jul 10 at 5:46
• @GSmith, I made many mistakes because I'm not familiar with this system and English. Looking at the Wolframalpha graph, it seems like it would always be the case, but I couldn't be certain, so I asked this question. Commented Jul 10 at 6:00
• Hint: you can prove it directly using inequalities (for example, start by converting the statement "$x=\lfloor y\rfloor$" into the form $x\le y < x+1$) Commented Jul 10 at 8:41

Let's look in general at the equation $$\tag{*} x=\left\lfloor\frac{\left\lceil ax\right\rceil}{a}\right\rfloor$$ for real positive $$a$$ (in the case of this question, we have $$a=\frac{103}{64}$$). The right-hand side is always an integer, so the only possible solutions are integers. We can prove that for certain $$a$$, the equation holds for all integers $$x$$.
Starting with the definition of $$\left\lceil ax\right\rceil$$, $$ax\le \left\lceil ax\right\rceil < ax+1$$ Dividing by $$a$$, $$x\le \frac{\left\lceil ax\right\rceil}{a} < x+\frac{1}{a}$$
If $$a\ge 1$$, then we have $$x\le \frac{\left\lceil ax\right\rceil}{a} < x+1$$
which is equivalent to $$(*)$$ by the definition of floor.
Since $$\frac{103}{64}>1$$, this proves the conjecture. It's worth noting that for $$a<1$$, the statement doesn't hold for all integer $$x$$.