Showing posts with label LCG. Show all posts
Showing posts with label LCG. Show all posts

Sunday, July 10, 2016

Where Do Random Numbers Come From?


   The random numbers generated in a computer or calculator are not truly random. They are not produced by sampling a physical process that contains a random process, such as flipping a coin or monitoring radioactive decay.

   Computer and calculator-generated random numbers are produced by computing an algorithm. An algorithm, by its very nature, contains no random processes. Still, these computer-generated random numbers pass most statistical tests and are, for most (but not all) practical purposes, random. Random numbers produced by an algorithm are more accurately called pseudo-random numbers.           

   The most commonly used algorithm for generating psuedo-random numbers is the linear congruential generator (LCG). The defining equation for a LCG is

xn+1 = (axn + c )mod m

where xn is called the seed, a is an integer constant called the multiplier, c (also an integer constant) is called the increment, and m is the modulus.
   The project can be viewed and downloaded by clicking on this link:
 https://scratch.mit.edu/projects/115898710/
    A four-page pdf document takes you through a paper and pencil exercise that explains the mathematics of a linear congruential generator and is available, free, on request. Send a request to grandadscience@gmail.com.