Decrease at an Increasing rate

596 Views Asked by At

I need a formula that decreases at an increasing rate. I'm guessing that logarithm is involved in the answer. My criteria: A value of 20 must return a value of 20 (low bound) A value of 80 must return a value of 60 (high bound) The values are always integer (20, 21, 22, etc up to 80) I'm open to the slope, so I'd want to play around with different slopes. Thank you.

1

There are 1 best solutions below

0
On

OK, so we want to find a (strictly) increasing function $f$ with its slope (strictly) decreasing. If you know calculus, this really means we want $f'(x) > 0$ and $f''(x) < 0$. Also, we require $f(20) = 20$ and $f(80) = 60$.

Of course, drawing quickly convinces us that there are many such functions. So our goal should be finding one with a "nice" closed form. It turns out we can construct one using logarithm. So your guess is right.

Let $$f(x) = a \log_b \frac{x}{c} + d$$ for some constant $a, b, c, d$. Our goal is to fit these constants so that the closed form appears "nice". By the requirement, we have $$20 = f(20) = a \log_b \frac{20}{c} + d$$ and $$60 = f(80) = a \log_b \frac{80}{c} + d$$ Subtract the two equations and apply $\log$ laws gives us $$40 = a \log_b \frac{80}{c} - a \log_b \frac{20}{c} = a \log_b \frac{80}{20} = a \log_b 4$$ Now notice if we choose $b = 2$, $c = 10$ and $d = 0$, then everything works out nicely and $$a = \frac{40}{\log_2 4} = 20$$ We conclude $$f(x) = 20 \log_2 \frac{x}{10}$$ is one such function.