Xref: utzoo sci.math.stat:2120 sci.math.num-analysis:1800 comp.lang.c:37943 comp.lang.fortran:5103 comp.sources.wanted:16134 Path: 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 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..."