12

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

I am really curious about this as I need it for a ratings system.

Thanks!

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88

4 Answers4

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

John Hughes
  • 100,827
  • 4
  • 86
  • 159
9

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<y$ then $f(x)>f(y)$. This is of course easily fixed by taking $$g(x)=1-f(x)=1-e^{-x},$$ instead.

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
Servaes
  • 67,306
  • 8
  • 82
  • 171
2

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.

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
PackSciences
  • 1,730
1

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.

311411
  • 3,576