I'm looking for a function that has logarithmic like behavior for a set of input ranging from [0,n]. The range of the output should be [0,1].

$\lim_{x\to 0} = 0$

$\lim_{x\to n} = 1$

Basically, I'm trying to have values near n be very close to 1, and slowly fall off towards zero as input gets closer to 0. Value for $n/2$ for example would be greater than $1/2$.


1 Answer 1


The function $f(x) = \displaystyle\frac{\log(x+1)}{\log(n+1)}$ should do the trick.

  • $\begingroup$ Beautiful. Any input on how to adjust the curve to alter how quickly it increases as $x$ increases? i.e. some knobs I can play around with? Oh, maybe I can just play with base of log to do that.... let me experiment $\endgroup$ Commented Dec 2, 2020 at 1:44
  • $\begingroup$ Doh, of course changing log base does nothing because change of base formula results in base change being meaningless. Embarassing how much I've lost since I did my B.S. in Physics! $\endgroup$ Commented Dec 2, 2020 at 1:50
  • $\begingroup$ Aha, adding a coefficient in front of $x$ and $n$ that is less than one works. $\endgroup$ Commented Dec 2, 2020 at 1:53
  • $\begingroup$ Is there a term meant to describe how quickly a logarithmic function approaches it's upper limit? $\endgroup$ Commented Dec 2, 2020 at 2:15
  • $\begingroup$ Logarithmic functions don't have upper limits (only the bounded interval forces the function to be bounded), so there isn't a name for that. You can also look at functions of the form $f(x) = (x/n)^b$ for real numbers $0<b<1$ if you want different shapes. $\endgroup$ Commented Dec 2, 2020 at 2:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .