250MB free for everyone.

RECURRENCE ANALYSIS AND LOTTERY PREDICTION

Visualization of Lottery Numbers.

In mathematics there is always more than one way to picture a set of data, and lottery results are no exception. Below are some of the images I have discovered in my work to understand and predict them (move your cursor over the images to enlarge them). First, the graphs of three UK draws as seen by VRA: EuroMillions, the main Lotto draw, and Thunderball respectively. Each graph covers ten draws.

EuroMillions

Note the w-shaped kinks that often appear in the troughs of the graph. This is caused by the two 'Lucky Stars' balls:

Lotto

This is the least well-behaved of the three, a reflection of the 13,983,816 possible six-number combinations and the range of numbers, 1 to 49:

Thunderball

Although this resembles the Lotto graph, the peaks are generally more even in height. This is a result of the range of numbers used - 1 to 34 instead of 1 to 49 - and five main balls instead of six. Note the sixth Thunderball is also included in this plot:

Somewhat bizarrely, these graphs bear a passing similarity to the ECG traces of certain cardiac arrhythmias, especially the fourth trace of this:

All three lottery graphs have the same general form, and can be modelled using a Fourier series combined with a random number generator. The Fourier series for a 'triangle' signal is:

The following is a program written for the BBC Master. It generates six numbers in the same range as the UK main lottery draw, then plots them in a 'gingerbread man' pattern. The numbers are generated using a linear congruence scheme as described in the book An Introduction to Computational Physics by Tao Pang (Cambridge University Press, ISBN 0-521-48592-4). The equations in lines 340-390 can be altered to give different images. The code will also run unaltered on a BBC emulator for the PC (an excellent site for BBC emulators is The BBC Lives!, though I still use my 1988-vintage BBC Master Turbo). It shouldn't be too difficult to convert it to other high-level languages such as FORTRAN, PASCAL, or Visual BASIC:

 10 REM Lottery Simulator - UK Main Draw 
 20 :
 30 MODE 0:VDU23;8202;0;0;0;0;
 40 DIM D(7),X(6),Y(6)
 50 A%=1:B%=1:C%=1
 60 IA=16807:IC=2147483647:IQ=127773:IR=2836
 70 ISEED=INT(RND(49))
 80 :
 90 REM Generate six unique numbers
100 N%=1 110 D(N%)=INT(RND(49))
120 FOR X%=1 TO N%-1
130 IF D(N%)=D(X%) THEN 140 ELSE 190
140 IH=ISEED/IQ:IL=ISEED MOD IQ:IT=IA*IL-IR*IH
150 IF IT>0 THEN ISEED=IT ELSE ISEED=IC+IT
160 R=ISEED/INT(IC):R=R*100:R%=INT(R)
170 IF R%<1 OR R%>49 THEN 140
180 D(N%)=R%
190 NEXT X%
200 N%=N%+1:IF N%=7 THEN 230 ELSE 110
210 :
220 REM Bubble sort numbers into ascending order
230 FOR W%=1 TO 6:X(W%)=D(W%):NEXT W%
240 FOR K%=1 TO 5
250 FOR J%=1 TO 6-K%
260 IF X(J%)>X(J%+1) THEN 270 ELSE 300
270 T%=X(J%)
280 X(J%)=X(J%+1)
290 X(J%+1)=T%
300 NEXT J%
310 NEXT K%
320 :
330 REM Plot numbers
340 E1=X(6)-X(4)+X(2):F1=X(5)-X(3)+X(1)
350 E2=X(1)-X(5)+X(3):F2=X(6)-X(4)+X(2)
360 E3=X(2)-X(6)+X(4):F3=X(1)-X(5)+X(3)
370 E4=X(3)-X(1)+X(5):F4=X(2)-X(6)+X(4)
380 E5=X(4)-X(2)+X(6):F5=X(3)-X(1)+X(5)
390 E6=X(5)-X(3)+X(1):F6=X(4)-X(2)+X(6)
400 PLOT 69,450+7*E1,350+7*F1
410 PLOT 69,450+7*E2,350+7*F2
420 PLOT 69,450+7*E3,350+7*F3
430 PLOT 69,450+7*E4,350+7*F4
440 PLOT 69,450+7*E5,350+7*F5
450 PLOT 69,450+7*E6,350+7*F6
460 GOTO 100

This image is a screen capture after several hundred iterations of the program:

Given that the lottery results constitute a strange attractor, what does the attractor look like? Many of the 'classical' attractors such as the Lorenz, Henon, Rossler, Duffing, van der Pol, and Ikeda have an equation or system of equations from which the attractor is plotted, but the lottery numbers are derived from a purely physical process which has no such neat representation (other than computer programs or random number generators). Fortunately, the Reconstruction Theorem of Takens allows attractors to be visualised from a data set. Using a program called AVTS (see the link on the main page), the UK main draw results give the following image:

Note that this object is only part of the attractor. A rough calculation indicates that there are at least approximately 7 x 10^42 possible trajectories (the number of ways to arrange all 13,983,816 six-number combinations), of which the actual draw data is but one. This lone trajectory has a roughly tetrahedral form. The entire attractor could be a vastly larger version. Even at the rate of one trajectory a second it would take 2.2 x 10^35 years to traverse the entire attractor, or about 18,000,000,000,000,000,000,000,000 times the age of the universe...

One striking image I came across is the following. This probably comes close to what the entire 'Lottery Attractor' looks like (from the inside), with each tiny tetrahedron representing a single trajectory:

Return to the main page


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