tags:

views:

102

answers:

1

I want an arbitrary function p[x] that integrates to 1 and for all x, 0 <= p[x] <= 1. Some kind of transformation rule?

A: 

In case you're just asking for examples of density functions (PDFs) that match your criteria, here are two (out of uncountably many):

p(x) = 1 if 0 < x < 1
       0 otherwise

p(x) = x/2 if 0 < x < 2
       0 otherwise

We could even generalize those slightly:

p(x) = 1/k if 0 < x < k
       0 otherwise

p(x) = 2x/k^2 if 0 < x < k
       0 otherwise

The latter works for k >= 2. We can even generalize that with another parameter to get a class of such functions with arbitrary exponent

p(x) = (a+1)/k^(a+1)*x^a if 0 < x < k
       0 otherwise

which works for all a > 1 and k > a+1.

For more interesting examples I think you'll need to give more criteria. You mention a transformation rule so perhaps you'd like to take an arbitrary bounded function on R1 and translate/scale it so that it's always between 0 and 1 and integrates to 1. That will have a straightforward answer as long as you can get the min, max, and integral of the given function. Go ahead and edit the question to ask that if that's indeed what you're looking for.

dreeves