1
$\begingroup$

I have this equation here that I need to solve for the variable 'r'. Normally this would be easy, but with the ceiling function I'm unsure of how to approach it.

$0 = \frac{h}{w} - \frac{\lceil\frac{n}{r}\rceil\, y}{r\,x}$

Thanks in advance for the help guys.

  • 2
    As your function is not one to one, the inverse is not unique.2011-05-05

1 Answers 1

7

If $\lceil \frac{n}{r}\rceil = k$, then you have $r = k\left(\frac{wy}{hx}\right).$ This will occur precisely when $k-1\lt \frac{n}{r}\leq k$. This means that you must have $k-1 \lt \frac{nhx}{kwy}\leq k.$ If $k\gt 0$, this is equivalent to $k^2-k \lt \frac{nhx}{wy}\leq k^2.$ For $k\lt 0$, it is equivalent to $k^2-k \gt \frac{nhx}{wy}\geq k^2.$ For $k=0$, there is no solution unless $h=0$. If $k=h=0$, then you just want $-1\lt \frac{n}{r}\leq 0$.

So first determine the possible values of $k$ for which the inequalities can hold (since you, presumably, know the values of $n$, $h$, $x$, $w$, and $y$), then use that to determine the value of $r$ by specifying the value of $\lceil\frac{n}{r}\rceil$.

Added. You say below $n$ and $r$ are positive, so $k\geq 1$. Note that there is at most one value of $k$ that can work, since $(k+1)^2 - (k+1) = k^2 + k \gt k^2$. But there may be no value of $k$ that works at all.

  • 0
    @Arturo ignore that comment I had tried to modify it but I wasn't able to. I apologize.2011-05-12