POV-Ray : Newsgroups : povray.general : 2Q's: normal & random : Re: A random trick Server Time
12 Aug 2024 21:26:53 EDT (-0400)
  Re: A random trick  
From: Tim Glover
Date: 18 Feb 1999 15:35:55
Message: <36CC7A1F.1F61@nettally.com>
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] nettallycom



Nieminen Mika wrote:
> 
> Tim Glover <tgl### [at] nettallycom> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.