How to isolate a variable inside floor and ceiling functions?

169 Views Asked by At

I am trying to isolate for the variable $E_c$ in the following equation: $$\Large F_c=Y + \left\lceil\frac{D_3 - Z*Y}{2*Z}\right\rceil$$ where $\large Y=\left\lceil\frac{D_1}{Z}\right\rceil$, $\large Z=\left\lfloor\frac{A*E_c}{100}\right\rfloor$, and variables $D_1$, $D_3$, $A$, and $E_c$ are all positive integers. This is floating point precision math, for clarification.

To be honest, I'm not even sure where to begin. Solving the equation after dropping the floors and ceilings is relatively straightforward but naturally the answer is off the mark by a notable margin. I wonder if this is even possible. I do have a way of confirming whether or not the results of $E_c$ are correct with the given $F_c$.

The given equation above uses the following equation within it that I have been using for other (more simple) datasets (as seen in the combinations of $Y$ and $Z$ above): $$\Large F_s=\left\lceil \frac{D_i}{\left\lfloor\frac{A*E_s}{100}\right\rfloor}\right\rceil$$ where $D_i$, $A$, and $E_s$ are all positive integers as well. The following equation is the equation I have been using solved for $E_s$, though I believe it is also slightly inaccurate which may prevent some functionality in the future (I need to run some more tests): $$\Large E_s=\left\lceil\left\lceil\frac{D_i}{F_s}\right\rceil * \frac{100}{A}\right\rceil$$

Solving $F_c$ for $E_c$ without floor and ceiling functions and putting it into a similar format as $E_s$, I came up with this: $$\Large E_c=\left\lceil\left\lceil\frac{D_1+D_3}{F_c}\right\rceil * \frac{50}{A}\right\rceil$$ However, it is not correct. I believe that when $F_c=10$, it is correct. In all other $F_c$ values, it is not correct. However, that is an assumption made on a small sample size so that may not be true 100% of the time. I am not sure what to make of that information, if it is true, either.

Both $F_c$ and $F_s$ will be integers in $E_c$ and $E_s$ respectively in my use-case scenario.

In conclusion, I would like to be able to solve $F_c$ for $E$ with as much accuracy as possible. Is it possible, and if so, any guidance?

1

There are 1 best solutions below

0
On BEST ANSWER

You cannot solve for $E_c$ in general, but you can determine a range of potential solutions using the inequalities that define the floor/ceiling functions $\,\lceil x \rceil - 1 \lt x \le \lceil x \rceil\,$ and $\,\lfloor x \rfloor \le x \lt \lfloor x \rfloor + 1\,$:

$$ F_c - 1 \;\lt\; Y + \frac{D_3 - Z \cdot Y}{2 \cdot Z} = \frac{1}{2}\left(\left\lceil\frac{D_1}{Z}\right\rceil + \frac{D_3}{Z}\right) \;\le\; F_c \\ 2 F_c - \frac{D_1}{Z} - 3\;\lt\; 2F_c - \left\lceil\frac{D_1}{Z}\right\rceil - 2 \;\lt\; \frac{D_3}{Z} \;\le\; 2F_c - \left\lceil\frac{D_1}{Z}\right\rceil \;\le\; 2F_c - \frac{D_1}{Z} \\ 2F_c - 3 \;\lt\; \frac{D_1+D_3}{Z} \;\le\; 2F_c \\ \frac{D_1+D_3}{2F_c} \;\le\; Z = \left\lfloor\frac{A \cdot E_c}{100}\right\rfloor \;\lt\; \frac{D_1+D_3}{2F_c - 3} \\ \left\lceil \frac{D_1+D_3}{2F_c} \right\rceil \;\le\; \frac{A \cdot E_c}{100} \;\lt\; \left\lceil \frac{D_1+D_3}{2F_c - 3} \right\rceil \\ \frac{100}{A}\left\lceil \frac{D_1+D_3}{2F_c} \right\rceil \;\le\; E_c \;\lt\; \frac{100}{A}\left\lceil \frac{D_1+D_3}{2F_c - 3} \right\rceil $$