Skip to content
Prev 342848 / 398506 Next

Generate quasi-random positive numbers

On 05-Aug-2014 10:27:54 Frederico Mestre wrote:
There is an inevitable constraint on MEAN and SD for a uniform
ditribution of positive numbers. Say the parent distribution is
uniform on (a,b) with a >= 0 and b > a.

Then MEAN = (a+b)/2, SD^2 = ((b-a)^2)/12, so

  12*SD^2  = b^2 - 2*a*b + a^2
  4*MEAN^2 = b^2 + 2*a*b + a^2

  4*MEAN^2 - 12*SD^2 = 4*a*b

  MEAN^2 - 3*SD^2 = a*b

Hence for a >= 0 and b > a you must have MEAN^2 >= 3*SD^2.

Once you have MEAN and SD satisfying this constraint, you should
be able to solve the equations for a and b.

Hoping this helps,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
Date: 05-Aug-2014  Time: 11:46:52
This message was sent by XFMail