|
![](/i/fill.gif) |
Actually, I said "approximate" a normal distribution. As long
as you're adding a finite number of uniform numbers together,
you're only approximating a normal distribution. Lots of numbers
just gives a better approximation. My way's approximation is just
not quite as good as your's <grin>
tgl### [at] nettally com
Nieminen Mika wrote:
>
> Tim Glover <tgl### [at] nettally com> wrote:
> : Most random number generators produce uniform-distributed
> : random numbers, not normally -distributed random numbers.
> : There's an old programmer's trick (at least as old as
> : FORTRAN 4) to approximate normal distributions from uniform
> : ones.... take TWO uniform randoms of half the range and add
> : them together to get final value!
>
> Actually this will not give a normal distribution. If you want a normal
> distribution you have to add at least three random numbers or more.
>
> --
> main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
> *_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |