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
    Shouldn't the first `leq` symbol in $k-1 \leq n/r \leq k$ instead be a strict inequality? If $n/r$ hits the lower bound $k-1$, doesn't this become $\lceil n/r \rceil = k-1 = k$?2011-05-05
  • 0
    @Jason: Yes; thank you and sorry about that.2011-05-06
  • 0
    K will always be greater than zero because n and r are always greater than zero. given the values of n =4, x = 1.33, y = 1, h = 221.116, and w = 154.6667, I get that .1854<= k < 1.03328. This gives me an approximation for K. but how do I use that to get r? I still have the ceiling.2011-05-10
  • 0
    @Arturo Also, n and r will always be integers.2011-05-10
  • 0
    @Shawn: I don't know what you did. If $n=4$, $x=1.33$, $y=1$, $h=221.116$, $w=154.6667$, then $nhx/wy = 7.605626292$. You want a value of $k$ for which $k^2-k\lt 7.605626292 \leq k^2$. Since $k$ must be a positive integer, you get that $k$ must be at least $3$ (otherwise, $7.605626292$ is not less than or equal to $k^2$); and must be at most $3$ (otherwise, it's not greater than $k^2-k$). So the *correct* value of $k$ is $k=3$. Therefore, the value of the ceiling is $3$, so $r=3(wy)/(hx) \approx 1.57778$. Note that $n/r \approx 2.535$, so $\lceil n/r\rceil = 3$, as required.2011-05-10
  • 0
    @Shawn: Given your values of $h$ and $w$, $r$ *cannot* be an integer and satisfy the given equation. Of course, you may have not given me the correct values, and your $x$ was *really* meant to be $4/3$ (not $1.33$), $w=464/3$, and $h$ some other rational. You cannot get exact answers if you don't put in exact quantities. If I assume those are the values, I get $r = (348/h)$. That still puts me with $r$ somewhere near $1.5$, so this suggests there are **no** integer solutions.2011-05-10
  • 0
    @Arturo Well I do know that the value that works for r is 2.2011-05-10
  • 0
    @Shawn: $r=2$ does **not** satisfy the equation with $n=4$, $x=1.33$, $y=1$, $h=22.116$, and $w=154.6667$. You get $\lceil\frac{n}{r}\rceil = 2$, so $\frac{\lceil\frac{n}{r}\rceil y}{rx} = \frac{2y}{2x} = \frac{1}{x} \approx 0.75$ , but $\frac{h}{w} \approx \frac{221.116}{154.6667}\approx 1.43$. There is simply no way that $\frac{h}{w} - \frac{\lceil\frac{n}{r}\rceil y}{rx}=0$ holds with those values. So I don't know how you think you "know" that $r=2$ "works", or what you mean by "works", but $r=2$ does not satisfy your given equation with your given values. It's not even close.2011-05-10
  • 0
    @Arturo ignore that comment I had tried to modify it but I wasn't able to. I apologize.2011-05-12