How do I correctly deal with equations involving floor (or ceiling) functions?

105 Views Asked by At

In the actual case, I have an equation stated by

$$\left\lfloor \frac{64GB}{r} - 4 \right\rfloor = k$$

where $64 GB = 64 \cdot 2^{30}$, and $k > 0$.

I need to solve for $r$. Now, I know how to deal with this when no floor function is involved. However, when attempting to consider the floor function where it makes sense, I feel that this is, well, garbage.

$$\left\lfloor {64 GB \over r} \right\rfloor = k + 4$$

$$\frac 1r = \frac{k+4}{64GB} \qquad \text{(This is not true, it's not equal.)}$$

$$r = \left\lfloor {64 GB \over (k + 4)} \right\rfloor$$

Before applying the floor function, I end up with an integer, plus a fraction $> 0.5$, which is uncomfortably large. Granted the previous step shows just a small difference, but there is no equality. When multiplying with a large value (as $64 GB$ is), the inequality is multiplied accordingly.

How are such equations approached correctly?

1

There are 1 best solutions below

3
On BEST ANSWER

Considering your equation as, where $k\in\Bbb Z$ $$\left\lfloor\frac{64\text{GB}}{r}\right\rfloor=k+4$$ We need the interior of the floor function to be between $k+4$ and $k+5$. We will replace the floor function by inequalities. $$k+4\leq\frac{64\text{GB}}{r}<k+5$$ Then solve both inequalities. $$k+4\leq\frac{64\text{GB}}{r}\implies r\leq\frac{64\text{GB}}{k+4}$$ $$\frac{64\text{GB}}{r}<k+5\implies r>\frac{64\text{GB}}{k+5}$$ Combining those inequalities $$r\in\left]\frac{64\text{GB}}{k+5},\frac{64\text{GB}}{k+4}\right]$$ Remark: Without context, I suppose $k+4$ and $k+5$ to be positive. If they are negative, one has to be careful with the inequalities. It nay change the answer.