Re: random numbers?
- To: mathgroup at smc.vnet.net
- Subject: [mg46136] Re: random numbers?
- From: Bill Rowe <readnewsciv at earthlink.net>
- Date: Sat, 7 Feb 2004 04:02:37 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On 2/6/04 at 4:15 AM, sean_incali at yahoo.com (sean kim) wrote: >How do ppl make random number generators? There are a number of different algorithms for doing this. One of the more popular methods is the linear congruential method. Given a number n, this method computes the next number as Mod[a n, b] for some constants a and b. This method is attactive for its simplicity and speed. For a more complete discussion of this method and other methods see Knuth, Seminumerical Algorithms Vol 2. >is a random number generator like a routine that picks a given set of >different number then goes back to the beginning and starts over? Yes, this is essentially what happens. For example, consider the linear congruential generator above. You start with a chosen number called a seed. The algorihm then computes the next number in the sequence, outputs it as a random number and replaces the seed with it. In this algorithm, b determines the set of numbers that will be generated. Both parameters together determine the cycle length of the generator, i.e., the number of numbers generated before they repeat. Poor choices of a and b will result in short cycle lengths. >How does mathematica determine if a numbder is random? Mathematica doesn't determine whether a number is random. In fact, no computer program can determine a number to be random. -- To reply via email subtract one hundred and four