Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not even sure how to ask this question, so bear with me for a second.

Given a linear input value, such as floating point numbers between 0 and 1, how can I produce an output that favors higher input values?

For example, let's say I have a function that generates probability values between 0 and 1, where 0 is a definite NO and 1 is a definite YES. Between 0 and 1, anything above 0.9 is a likely YES and anything below 0.5 is a likely NO. Now, let's say I want to produce an output value based on those probabilities that favors (places more value on) the higher end of the scale, and that the output value should be integers between 0 and 255.

So, a manual example goes like this:

prob 0.00 = output 0
prob 0.50 = output 50
prob 0.75 = output 130
prob 0.90 = output 150
prob 0.92 = output 155
prob 0.94 = output 160
prob 0.96 = output 175
prob 0.98 = output 200
prob 1.00 = output 255

These exact outputs aren't of interest for me, I'm simply trying to show the concept---that the majority of the available output numbers are achieved from probabilities between 0.9 and 1.0.

Is this approximating a logarithmic scale? Something else? Any easy way to calculate this kind of output (something close to it concept, not precision)?


share|cite|improve this question
You could choose any function which starts at zero and increases faster than linearly, like a polynomial or an exponential. For example. – Antonio Vargas Mar 11 '12 at 19:33
i see, thanks. what would a polynomial example look like? – mix Mar 11 '12 at 20:57
$f(x) = 255x^2$ – Antonio Vargas Mar 11 '12 at 21:12

The answer (given in comments) is to use a polynomial function such as $255x^2$ (or $255 x^n$ for other values of $n$). Other nonlinear functions, such as $\exp$, can also be used but polynomials are very easy to evaluate. A related concept is sigmoid.

share|cite|improve this answer

Your Answer


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.