From: Gavin Sinclair Date: 2004-08-14T15:43:36+09:00 Subject: Re: Random variable library? On Friday, August 13, 2004, 5:41:22 PM, Mauricio wrote: > On Fri, Aug 13, 2004 at 11:26:22AM +0900, Gavin Sinclair wrote: >> The work I'm doing now doesn't strictly require, but would benefit from a >> random number generator that: >> - obeyed the distribution you want, with the parameters you want > You can do that easily by taking a uniform random variable and feeding > it into the distribution function you want. Thanks for the tip. How do you write a distribution function? >> - spat out numbers between a given minimum and maximum > like min + rand(max-min+1) ? Yes, but what about: "give me a normal distribution between 0 and 10"? That probably doesn't make sense without some extra parameters, but they can be defaults/derived. Then I'd like to be able to bias it as well, if that makes sense. So you can have a "normal" distribution between 0 and 10, biased so that the center is on 3 instead of 5. IF that makes sense... :/ Gavin