# Solving equations including floor function.

I got a little trouble solving equations that involve floor function in an efficient way.

For example :

$$\left\lfloor\frac{x+3}{2}\right\rfloor = \frac{4x+5}{3}$$

In the one above, I get that you basically let $$\frac{4x+5}{3} = k$$ and then inserting $k$ in the left side, take $k = 8l, 8l+1$, and so on and test it.

If there's a better solution to the one above plese tell me.

My main problem is when it comes down to functions that have multiple floors such as :

$$\left\lfloor \frac{x+1}{3}\right\rfloor + \left\lfloor\frac{2x+5}{6}\right\rfloor = \frac{3x-5}{2}$$

Using the same method for each of them and then intersecting the solutions should give me the right answer but is there a faster way to solve equations like this ?

• use the fact that : $\lfloor x \rfloor=n \Leftrightarrow n\leq x <n+1$
– L F
May 10, 2015 at 15:35
• @LuisFelipeVillavicencioLopez tought about that but how do I use that in things that involve fractions? May 10, 2015 at 15:36
• $\frac{4x+5}{3}$ must be in $\mathbb{Z}$, you can add $-\frac{4x+5}{3}$ to your inequality and solve the equation for $x$ and then $\cap \mathbb{Z}$
– L F
May 10, 2015 at 15:42
• @LuisFelipeVillavicencioLopez still don't get it. May 10, 2015 at 15:49
• @lab bhattacharjee shows you a better way, i was telling you the first line of him, his second line is better than mine, he has a general method for this
– L F
May 10, 2015 at 15:59

As the left hand side is integer, so should be $\dfrac{3x-5}2\iff2|3(x-1)\iff2|(x-1)\implies x$ is odd (assuming $x$ to be an integer)

Again as lcm$(3,6)$ we need to test for $x\equiv0,1,2,3,4,5\pmod6$

But as $x$ is odd, $x\equiv1,3,5\pmod6$

If $x=6b+1$

$$\left\lfloor\frac{x+1}{3}\right\rfloor + \left\lfloor\frac{2x+5}{6}\right\rfloor=\left\lfloor\frac{6b+1+1}{3}\right\rfloor + \left\lfloor\frac{2(6b+1)+5}{6}\right\rfloor=2b+(2b+1)=4b+1$$

and $$\dfrac{3x-5}2=\dfrac{3(6b+1)-5}2=9b-1$$

and so on

If $x$ is not necessarily an integer, $\dfrac{3x-5}2+I\iff x=\dfrac{5+2I}3$

Check for $I\equiv0,1,2\pmod3$

Since $\dfrac{4x+5}3 = \left\lfloor \dfrac{x+3}2 \right \rfloor$ is an integer, we need $3$ to divide $4x+5$, i.e., $$\dfrac{4x+5}3 = m \in \mathbb{Z} \implies x = \dfrac{3m-5}4 \text{ where }m \in \mathbb{Z}$$ Hence, $$\left\lfloor \dfrac{x+3}2 \right\rfloor = m \implies \dfrac{x+3}2 = m + e \implies x+3 = 2m+2e \implies x = 2m-3+2e$$ where $e \in[0,1)$. Hence, we need $$\dfrac{3m-5}4 = 2m-3+2e \implies 3m-5 =8m-12+8e \implies 8e = -5m+7$$ This gives us $e = \dfrac{7-5m}8$. Since $e \in [0,1)$, we have $7-5m \in [0,8) \implies m = 0,1$. Hence, $$x=-\dfrac54,-\dfrac12$$

• If you use that in the initial equation it gives : 2 = 1. Didn't check your math but the main idea is that you also missed a solution, it has 2. May 10, 2015 at 15:55
• @user1640736 Corrected. It was due to some sign error. May 10, 2015 at 15:57

**Below I have provided a solution $\mathbf{\left(\frac{4x+5}{3}=t\right)}$ $,\,t\in\mathbb z$

$\rightarrow$ $$x=\left(\frac{3t-5}{4}\right)$$ $$\lfloor\left(\frac{\frac{3t-5}{4}+3}{2}\right)\rfloor=t$$ $\rightarrow$ $$\lfloor\left(\frac{3t+7}{8}\right)\rfloor=t$$ $$t\le\left(\frac{3t+7}{8}\right)\lt t+1$$ $$t\le\left(\frac{7}{5}\right) ,t\gt\left(\frac{-1}{5}\right)$$ $\rightarrow$ $$t=0 , 1$$ $$x=\left(\frac{-5}{4}\right) or x=\left(\frac{-1}{2}\right)$$ thank you for your attention

• Formatting tips here.
– Em.
Jan 9, 2016 at 9:00
• Have I got enough?
– d.v
Jan 9, 2016 at 15:09