250MB free for everyone.

RECURRENCE ANALYSIS AND LOTTERY PREDICTION

The Case for Computerised Draws.

Many large national lottery draws employ mechanical means to draw numbers, but increasingly operators are turning to purely electronic methods, specifically a computer running a purpose-written program based on a random number generator (RNG). Wherever electronic draws are introduced players often object. Mechanical draws appeal to lottery players for several reasons: they are seen to be fair and more secure; people like to root for their numbers; watching the balls provides both tension and a thrill; and it just looks good when televised. Electronic draws are viewed with suspicion, and even as a threat to systems players have developed based on mechanical draws (a computerised draw would almost certainly defeat recurrence analysis).

The two main criticisms of electronic draws are the problem of security and the question of randomness. Computerised draws are no harder to secure than mechanical ones; the draw computer is physically isolated in the same way as a mechanical draw machine; more than one official observes and records the draw result. The second objection - that of randomness - is perhaps more complex to explain, but no harder to justify.

One of the first RNGs was proposed by John von Neumann in 1946. His middle-square method involved taking a number, squaring it, then taking the middle digit of the result and repeating. It was simple to carry out, but its simplicity was its weakness: it had a very short period (how many numbers are generated before the sequence begins to repeat, in this case only 142). The generated numbers were not truly random but pseudo-random, and it is a problem which has dogged RNGs ever since.

As computational means improved and number theory research advanced, RNG periods have gradually increased, until now they are so long that for all practical purposes the generated sequences can be said to be random, and actually pass the most rigorous statistical tests for randomness. Modern RNG algorithms are triumphs of computation and the mathematician's craft. They have truly astonishing periods. The current best RNG is MT19937, developed by two Japanese mathematicians, Makoto Matsumoto and Takuji Nishimura in 1998, and revised in 2002 to remove undesirable results obtained from certain seed values (a seed is an initial number fed into an RNG to start it off).

MT19937 is a variant of the twisted generalized feedback shift-register algorithm, and has a Mersenne prime period of 2^19937 - 1 (about 10^6000). Let's put this gargantuan number into perspective: at the rate of 1,000,000,000 numbers PER SECOND it would take 10^5983 years before MT19937 began to repeat. Our universe is estimated to be only about 1.2 x 10^12 years old. Naturally such a powerful RNG is no mere academic plaything. It is used in quantum chromodynamic calculations, lattice field theory simulations, cosmological computer models, simulations of nuclear weapon explosions, and numerical tests of high-end supercomputers. MT19937 has even been adapted for use in cryptography. MT19937 has passed the most rigorous statistical tests for randomness yet devised, the toughest of which is the ominously-named Diehard suite of tests, devised by American mathematician George Marsaglia.

MT19937 represents the pinnacle of RNG science, but more modest algorithms would serve just as well for a lottery draw. One known as gsl_rng_rand has a period of 2^31, more than 2,000,000,000 numbers. At the rate of six numbers per week this would run for the best part of seven million years before it began to repeat.

Today, many countries use computer RNGs in their national lotteries (one of the largest being in China). The UK National Lottery has an online generator for players, and its shop terminals can also deliver computer-generated numbers. Now that the limitations of early RNGs have been overcome - and more people are becoming familiar with computers - objections to computerised draws can be viewed as increasingly irrational.

Random Number and RNG Links.

Checking the Randomness of the UK National Lottery (PDF from 2004)

Matsumoto and Nishimura's original 1998 paper on MT19937

Download Matsumoto and Nishimura's MT19937 PDF

MT19937 module for Excel

Mersenne Twister homepage

George Marsaglia's Diehard tests

On the Reliability of Random Number Generators PDF site

Download the Reliability of Random Number Generators PDF

Page of RNG algorithms

Perfectly Random Sampling with Markov Chains

The RNG Random Number Library PDF site

Download the RNG Random Number Library PDF

Random number article from MathWorld

Wikipedia entry about Diehard tests

Wikipedia entry about pseudo-random numbers

Return to the main page


Let us know if this page contains pornographic, copyrighted, or hate content. 250Free proudly supports TheFreeSite.com