# Convert numbers between 0 and infinity to numbers between 0.0 and 1.0

Can we arrange all numbers x; such that x lies between 0 and Infinity, between 0 and 1? The scale does not have to be linear, but for any a and b in x, where a <= b, then a' and b', the equivalent numbers on the new scale must also be such that: a' <= b'.

Thanks!

• "The scale does not have to be linear" how fortunate!
– mdup
Feb 17, 2019 at 19:44
• @mdup, lol!, yeah... I have very mild requirements.... until something changes lol Feb 17, 2019 at 22:12

$$\exp$$ is a great tool, but there's also $$x \mapsto \frac{x^2}{1+x^2}$$ which may be slightly easier to work with in some situations.

As @Servaes points out, you can also use $$x \mapsto \frac{x}{1+x}$$ because you're working on the nonnegative reals rather than all reals.

And a personal favorite of mine is $$x \mapsto \frac{2}{\pi} \arctan(x).$$

• And in fact there is no need for the squares as the function is needed on the nonnegative reals only. Feb 17, 2019 at 11:37
• Good point. Edited. Feb 17, 2019 at 11:41
• A slight addition could be "y=1 / (1 + M/ x)". This maps x=M to y=0.5 Oct 22, 2020 at 15:58

There are many options, one example is the function $$f(x)=e^{-x}$$. It maps the domain $$(0,\infty)$$ onto the range $$(0,1)$$, though it reverses the ordering. That is, if $$x then $$f(x)>f(y)$$. This is of course easily fixed by taking $$g(x)=1-f(x)=1-e^{-x},$$ instead.

• $6$ seconds before me! Feb 17, 2019 at 11:31
• Are you sure this satisfies the second requirement? Feb 17, 2019 at 11:33
• Given that if $a\leq b$ then $a'\leq b'$ I think $1-e^{-x}$ should be what OP is looking for. Feb 17, 2019 at 11:34
• a=0, b=1 is a counterexample though, right? Feb 17, 2019 at 11:35
• Wow, I . am impressed with the dexterity and eagerness here. Thanks so much for helping out! I have to accept the other answer by @John Hughes, though. Because I need the answers not to converge too quickly towards 1. Thanks all the same! Feb 17, 2019 at 11:56

The expression you are looking for is a one-to-one mapping from positive reals into $$[0,1]$$. Consider the exponential mapping $$f_k(x) = exp(- (x^k))$$. Other people suggested $$f_2$$. There exist other mappings.

You can use $$g(x) = 1-2^{-x},$$ and any numbers between 0 and Infinity will be mapped to between 0 and 1.

I'm not very well versed in what's covered in the rest of the answers, so this may have already been stated a different way, but this is here if it hasn't.