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.
-
The title is different from the question in the first line. – Ryan Goulden Apr 21 '19 at 23:57
-
decreasing at an increasing rate – Scott Dunham Apr 21 '19 at 23:58
-
I wonder if I'll get to -10 before somebody actually answers. If my question (or lack of math knowledge) is the problem, I wish somebody would say so I don't wasts my time and yours. – Scott Dunham Apr 22 '19 at 00:00
-
So like $f(20) = 20$ and $f(80) = 60$? How is such function decreasing? – peterwhy Apr 22 '19 at 00:10
-
@peterwhy I think OP means $f'' \le 0$ like the logarithm. – Alex Vong Apr 22 '19 at 00:12
-
Uh, the result is decreasing. I guess I'm missing your point. – Scott Dunham Apr 22 '19 at 00:13
-
@ScottDunham Can the slope of the function be flat in some interval? – Alex Vong Apr 22 '19 at 00:18
-
Preferably not. I also forgot to mention that the function results don't need to be integers. – Scott Dunham Apr 22 '19 at 00:19
-
@ScottDunham Yes, please state the requirements clearly. Right now, the question is very confusing. – Alex Vong Apr 22 '19 at 00:27
-
I'm envisiong something like f(21)=20.9 (decrease by 0.1), maybe f(50)=40 (decrease by 10), etc. – Scott Dunham Apr 22 '19 at 00:28
-
@ScottDunham Actually, I think using logarithm after re-scaling works. – Alex Vong Apr 22 '19 at 00:45
1 Answers
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.
- 1,654