View Single Post
  #3  
Old 11-17-2007, 03:54 AM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Looking for event-based random number generator

[ QUOTE ]
This sparked a small memory in me and I did a quick investigation and it seems to hold.

You can actually generate a series of random numbers that are normally distributed by adding together 2 numbers that are randomly generated by a linear distribution. I remembered this because when you roll 2 dice, the sum of the dice is a standard distribution.

You can adjust to scale to the desired mean/standard deviation.

So, if you know any kind of programming language, go through a loop 100 times and do this:

n1 = rand()*std*2.45
n2 = rand()*std*2.45
num = mean + n1 + n2 - std*2.45

Why 2.45? I don't know. But it works.

I wrote a quick program for it. I could probably throw it up on the web if you're interested.

[/ QUOTE ]
I thought when I first read his post that he wanted to generate Gaussian random numbers too, but I think he wants to generate sequences that have an exact mean and standard deviation (eg: generate 10 random numbers that have a mean of -2.8 and a std of 1.5).

Juk [img]/images/graemlins/smile.gif[/img]
Reply With Quote