POV-Ray : Newsgroups : povray.general : 2Q's: normal & random : Re: A random trick Server Time
12 Aug 2024 21:26:08 EDT (-0400)
  Re: A random trick  
From: Nieminen Mika
Date: 15 Feb 1999 07:37:04
Message: <36c814f0.0@news.povray.org>
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.