# Logarithmic Function With Range [0,1] for domain between [0,n]

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$$.

The function $$f(x) = \displaystyle\frac{\log(x+1)}{\log(n+1)}$$ should do the trick.
• 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 Commented Dec 2, 2020 at 1:44
• Aha, adding a coefficient in front of $x$ and $n$ that is less than one works. Commented Dec 2, 2020 at 1:53
• 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. Commented Dec 2, 2020 at 2:28