Article View: sci.math.stat
Article #651Any normally-distributed random number functions?
From: Van Bagnol
Date: Thu, 04 Apr 1991 18:37
Date: Thu, 04 Apr 1991 18:37
19 lines
1308 bytes
1308 bytes
I am looking for a C or Fortran function that would generate a pseudorandom variable but with a *normal* distribution instead of uniform distribution. (I.e., return a random value Z with a mean of 0 and a std. dev. of 1.) * Does anyone know of any algorithm(s)? * What are their pros/cons? So far we have thought of using a "Monte Carlo" approach: take a sample of "n" uniformly random numbers between 0 and 1, then get its mean and s.d. and adjust to taste. Is there a faster and/or more elegant way? (BTW, how big should "n" be, 25? 30?) Many thanks in advance. -- Van Bagnol / Group One, Ltd. / (415) 398-7565 / ...!uunet!group1!van "Be cool, have fun." / "Parang lumakad ko sa loob ang panaginip..."
Technical Details
Message-ID:
<1991Apr04.183739.4876@group1.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!group1!vanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!group1!van From: van@group1.uucp (Van Bagnol) Newsgroups: sci.math.stat,sci.math.num-analysis,comp.lang.c,comp.lang.fortran,comp.sources.wanted Subject: Any normally-distributed random number functions? Summary: Like rand() but normal, not uniform Keywords: random generator normal density algorithm Message-ID: <1991Apr04.183739.4876@group1.UUCP> Date: 4 Apr 91 18:37:39 GMT Sender: van@group1.UUCP (Van Bagnol) Followup-To: sci.math.stat Organization: Group One, Ltd.; San Francisco Lines: 19