How to make a function lie in the interval [0,1]

139 Views Asked by At

Is there a way to convert a function g(x) so that the result lies between [0,1]? Thank you in advance.

1

There are 1 best solutions below

6
On

If you function is $\ge 0$, use the function $$ x\to \frac x{1+|x|} $$

In general, use $$ x\to \frac 12 \left(1+ \frac x{1+|x|}\right) $$ You hence have a one to one transformation: link to the plot

enter image description here


Another one is of course $$ x\to \frac 1\pi \arctan x + \frac 12 $$