3
$\begingroup$

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!

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

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

$\endgroup$
  • 2
    $\begingroup$ And in fact there is no need for the squares as the function is needed on the nonnegative reals only. $\endgroup$ – Servaes Feb 17 at 11:37
  • 1
    $\begingroup$ Good point. Edited. $\endgroup$ – John Hughes Feb 17 at 11:41
4
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ $6$ seconds before me! $\endgroup$ – Peter Foreman Feb 17 at 11:31
  • $\begingroup$ @PeterForeman Either this is a rather canonical answer, or you are very fast at paraphrasing. $\endgroup$ – Servaes Feb 17 at 11:32
  • 1
    $\begingroup$ Are you sure this satisfies the second requirement? $\endgroup$ – Keatinge Feb 17 at 11:33
  • 2
    $\begingroup$ Given that if $a\leq b$ then $a'\leq b'$ I think $1-e^{-x}$ should be what OP is looking for. $\endgroup$ – Infiaria Feb 17 at 11:34
  • 1
    $\begingroup$ 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! $\endgroup$ – gbenroscience Feb 17 at 11:56
2
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.