Re: Q: Random[]
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1652] Re: Q: Random[]
- From: rubin at msu.edu (Paul A. Rubin)
- Date: Sat, 8 Jul 1995 05:35:35 -0400
- Organization: Michigan State University
In article <3t2irf$mie at news0.cybernetics.net>, elsner at avalon.msfc.nasa.gov (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 time-of-day. Paul ************************************************************************** * 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