in reply to how can i generate random numbers with predefined mean and standard deviation

Math::Random has exactly what you need,

use Math::Random; my @randoms = random_normal 1000, 250, 20;
Being random, that does not guarantee the the sample you get will have exactly that mean and sd, just close.

If you need a distrubution other than normal, Math::Random has many to choose from.

After Compline,
Zaxo

  • Comment on Re: how can i generate random numbers with predefined mean and standard deviation
  • Download Code

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.