MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Q: Random[]

  • To: mathgroup at
  • Subject: [mg1652] Re: Q: Random[]
  • From: rubin at (Paul A. Rubin)
  • Date: Sat, 8 Jul 1995 05:35:35 -0400
  • Organization: Michigan State University

In article <3t2irf$mie at>,
   elsner at (Ron Elsner) wrote:
->I am constructing a Monte-Carlo simulator in Mathematica for an 
->x-ray polarimeter we are proposing for NASA's Explorer program.  I 
->have 2 questions about Random[]:
->1.  What is its period?  This affects how large a Monte-Carlo I 
->can run before losing independence of trials.

If you have to ask, you obviously aren't running on a 486 under Windows 
(where it won't cycle within your lifetime, almost regardless of the period 
:-).  I don't know the answer, but I suspect you can extend the period 
using a technique called "shuflling" if it proves necessary.

->2.  I understand it gets its seed from the clock.  When debugging 
->Monte-Carlo code, I like to set the seed so I can repeat runs.  Is 
->this possible for Random[], and if so how?  (The seed initiates the 
->sequence of psuedo-random numbers.)

The function you want is SeedRandom[seed].  If you omit the seed, it uses 


* Paul A. Rubin                                  Phone: (517) 432-3509   *
* Department of Management                       Fax:   (517) 432-1111   *
* Eli Broad Graduate School of Management        Net:   RUBIN at MSU.EDU    *
* Michigan State University                                              *
* East Lansing, MI  48824-1122  (USA)                                    *
Mathematicians are like Frenchmen:  whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different.                                    J. W. v. GOETHE

  • Prev by Date: Problems with NIntegrate
  • Next by Date: How do I find my current directory?
  • Previous by thread: Re: Q: Random[]
  • Next by thread: Re: Q: Random[]