Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying to get a continuous mapping from (0,∞) to (0,1). What would be a good mapping?

Context:
I need to rank tuples based on values of two of their attributes a and b. a increases very steeply and b much slower. To accomodate both of them in ranking, I am generating c=a*b and am using that for ranking. c could vary from sub-1 values to a few billions. this makes comparison very difficult. I tried log10(c)..while that helps in reducing the range significantly, having a proper way to map the values to (0,1) would help. I am trying to look for a function to map c to (0,1) that would have a good spread over entire range of the iterval (0,1).I considered sigmoid, but then I thought since all values are psoitive, sigmoid values would be restricted to (0.5,1)..so had to drop that idea..

share|improve this question
6  
$x\mapsto x/(1+x)$. –  Did Apr 12 '12 at 11:32
1  
The one proposed by Didier seems really good. Perhaps you could provide us with details concerning what you require of your mapping. Since you posted it under the "numerical-methods" tag, I suppose you want it to be well-conditionned and rapidly computed (here Didier's example is perfect), but perhaps there is something else ? –  Samuel T Apr 12 '12 at 11:45
    
Yet another: $x\mapsto 1-e^{-x}$. –  Brian M. Scott Apr 12 '12 at 11:55
1  
You could multiply the sigmoid by $2$ and subtract $1$ to normalize it to $(0,1)$. –  Brian M. Scott Apr 12 '12 at 12:07
    
@Didier Thanks Didier. I should have been more specific..I am looking for a function that would not only map to (0,1) but would also have a good spread over that interval. x/(1+x) does not satisfy this latter requirement. –  Aadith Apr 12 '12 at 12:38

2 Answers 2

$\displaystyle f(x) = \frac{1}{x+1}$. The endpoints give it away: we'd like $ \infty$ to go to 0 or 1. Well, we can do $ \infty$ going to 0 easily by $x \to \frac{1}{x}$. But this function doesn't work near 0. Ah, we can shift it along.

share|improve this answer
1  
Or for that matter $f(x)=\dfrac1{(x+1)^a}$ for any $a>0$. –  Brian M. Scott Apr 12 '12 at 11:57

An obvious one would be x going to $\frac{\tan^{-1}{x}}{\pi/2} $, but you may prefer something else depending on more info you may have about the variable.

share|improve this answer
1  
I suppose most of the sigmoidal functions ($\arctan$, $\tanh$, $\mathrm{erf}$, etc...) work nicely, with suitable normalization... –  J. M. Apr 14 '12 at 4:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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