Random number within a range based on a normal distribution
- by ConfusedAgain
I'm math challenged today :(
I want to generate random numbers with a range (n to m, eg 100 to 150), but instead of purely random I want the results to be based on the normal distribution.
By this I mean that in general I want the numbers "clustered" around 125.
I've found this random number package that seems to have a lot of what I need: http://beta.codeproject.com/KB/recipes/Random.aspx
It supports a variety of random generators (include mersiene twister) and can apply the generator to a distribution.
But I'm confused... if I use a normal distribution generator the random numbers are from roughly -6 to +8 (apparently the true range is float.min to float.max).
How do a scale that to my required range?