# Thread: A function to convert a +ve number to a number from 0 to 1

1. ## A function to convert a +ve number to a number from 0 to 1

I need a mathematical function, which converts any positive number (from 0 to any large value) to a number in the range 0 to 1.

2. Originally Posted by neerajraj1000
I need a mathematical function, which converts any positive number (from 0 to any large value) to a number in the range 0 to 1.
$\displaystyle f(x) = e^{-x}$.

3. Here's another:

$\displaystyle f(x) = \frac 1 {1 + x}$

4. ## Modified question

Thank you for responding. Actually I need a function which should be monotonically increasing and converts any +ve number to a number within the range 0 to 1. (The function should use the whole range between 0 to 1. For example for 1/(1+x) as the value of x increase, the function gives less value, I want the opposite).

5. if f(x) is monotonically decreasing and gives answers in the range (0,1)

then 1-f(x) is monotonically increasing and gives answers in the range (0,1)

So you could use: $\displaystyle 1- \frac{1}{1+x}$ if you want a monotonically increasing version. (This simplifies to $\displaystyle \frac {x}{1+x}$)

or indeed
$\displaystyle 1- e^{-x}$

6. Originally Posted by neerajraj1000
Thank you for responding. Actually I need a function which should be monotonically increasing and converts any +ve number to a number within the range 0 to 1. (The function should use the whole range between 0 to 1. For example for 1/(1+x) as the value of x increase, the function gives less value, I want the opposite).
Then $\displaystyle \frac{x}{x+1}$. That is an increasing function and maps $\displaystyle [0, \infty)$ into $\displaystyle [0, 1)$.

If, by "The function should use the whole range between 0 and 1." you mean that the function should have both the values 0 and 1, as well as all values between, for some finite, x, that is impossible for an increasing function on $\displaystyle [0, \infty)$.