Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I know I should remember this from high school geometry, but what's the simplest curve that is crosses (0,0) and (as x increases) rises to be asymptotic to a horizontal line? (I'm not sure whether I want an inflection point or not -- I'm just trying to convert an open-ended number into a bounded "score".)


I've got to say that you guys are a lot easier to deal with than the Stack Overflow crowd. I've come in with two "dumb" questions and gotten considerate answers in both cases. Much appreciated!!

share|improve this question
There's $1-\exp(-x)$ and a whole bunch of other functions... –  J. M. Aug 31 '11 at 16:46
If you need the asymptote to be the line $y=100$, then multiply the function in my previous comment by $100$. –  J. M. Aug 31 '11 at 16:57
"I've got to say that you guys are a lot easier to deal with than the Stack Overflow crowd." - interesting... –  J. M. Aug 31 '11 at 20:14
add comment

2 Answers

up vote 2 down vote accepted

You mention in comments to Zev's answer that you want f(1/2)=50 and f(50)=99. Together with the other constraints, we can use this to design an appropriate function. The most elementary way to get an asymptote is by division, so suppose f had the form $$f(x) = 100 - \frac{100}{g(x)}$$ where $g$ is a some function to be designed. We can then fix three values for g, namely g(0)=1, g(1/2)=2 and g(50)=100. The simplest way to get a function to pass through three known point is to make it a quadratic polynomial, so we have $$g(x) = ax^2+bx+c$$ for constants a, b, and c to be determined. Inserting our known points gives us three equations with three unknowns, which can be solved to get $$a = \frac{-1}{2475}, b = 2-\frac{a}{2}, c=1$$ A negative a won't do (it would cause the function to begin dropping away from f=100 at very large x), but luckily the exact computed a is so small that we don't lose much by just setting it to 0. Thus the final design will be just $$f(x) = 100 - \frac{100}{2x + 1}$$ which makes f(0)=0, f(0.5)=50, f(50)=99.01. And luckily it also happens to be strictly increasing (and convex) for positive $x$.

share|improve this answer
Well, actually I was getting f(32) = 99, and hoping for something closer to f(50) or f(75) = 99. But thanks -- I'll look at your formula –  Daniel R Hicks Aug 31 '11 at 18:00
@Daniel: Sorry, I misread. I have corrected my solution to work for 50 instead. Unfortunately this technique cannot move the 99% point even farther out than x=50. –  Henning Makholm Aug 31 '11 at 18:11
I'll take a look at it, right after I finish wrestling with a different alligator. –  Daniel R Hicks Aug 31 '11 at 18:33
That's looking pretty good. I fudged the 2 factor to 2.5 (moved the 0.5 point to about 55), added a small linear component (to get closer to 100), and the capped the result at 99.9. It's smooth and "looks right", at least to my eyes (can never guess what the customer will think). I'll call it good. –  Daniel R Hicks Aug 31 '11 at 20:07
add comment

Modifying J.M.'s suggestion a bit to fit what's in the title, one class of functions you might like is $$f_a(x)=100(1-e^{-x/a})$$ where $a>0$ is some parameter you can vary as you see fit. The larger $a$ is, the more spread out the function will be. Here is a plot of $f_a$ for $5\leq a\leq 20$:
$\hskip 1in$ enter image description here

(from Wolfram Alpha)

However, note that the nature of an asymptote is that it will never actually reach that value - that is, no $f_a$ will ever take on the value 100. If you want your function $f$ to satisfy $f(0)=0$ and $f(100)=100$, you can modify this suggestion as follows:


Then $g_a(0)=0$ and $g_a(100)=100$ for any $a>0$ you want to choose, but it retains the curved shape of the function $f_a$. The functions $g_a$ are also all bounded; just not by 100. If you plug in any $x>100$, then $g_a(x)>100$ too.

share|improve this answer
Yeah, I'm looking at that. 100*(1 - exp(x*7/50)) comes close, but, while x=0.5 yields roughly 50 (which I want), we get to 99 at around x=32, whereas I'd like it to be closer to x=50 or 75. So I'm open to some other "simple" equations. –  Daniel R Hicks Aug 31 '11 at 17:10
Just curious, do you care about the values of the function for $x<0$ or $x>100$? It may be easier if we don't have any restrictions for those inputs. Or is $f(x)<100$ for all $x$ important? –  Zev Chonoles Aug 31 '11 at 17:14
x can never be less than zero. I can cap in the 100-200 range, though. Obviously, if y approaches 100 then there's no precision to be lost in larger x values. –  Daniel R Hicks Aug 31 '11 at 17:17
I'd give you another +1 if I could. Came back to this thread seeking an answer to a question similar to the last one but a bit different and your answer gave me the hints I needed. Thanks! –  Daniel R Hicks Feb 9 '12 at 2:52
Glad that my answer helped! Thank you for the kind words. –  Zev Chonoles Feb 9 '12 at 3:14
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.