10 ' THIS PROGRAM IS A TEST OF THE THEORY THAT UNUSUAL
20 ' EVENTS ARE PREDICTED BY UNUSUAL RESULTS IN THE ACTIONS
30 ' OF RANDOM GENERATORS.
40 ' DAILY AVERAGES AND STANDARD DEVIATIONS OF
50 ' 1000 RANDOM GENERATIONS
60 ' OF NUMBERS BETWEEN 1 AND 100 ARE LOGGED IN FILE "SDDATA
70 ' STUDY OF THE LOGGED DATA AND DAILY EVENTS
80 ' SHOULD HAVE YOU PREDICTING THE FUTURE IN NO TIME!
90 ' THE SDDATA FILE IS BEST VIEWED AND EDITED WITH NOTEPAD.
100 DIM A(1000,1)
110 RANDOMIZE TIMER
120 OPEN "A",#1,"SDDATA"
130 REM
140 REM ***** load array with random numbers 1 - 1000 *****
150 FOR N = 1 TO 1000
160 R = 1 + INT(RND*100)
170 A(N,0) = R
180 NEXT N
190 REM
200 REM ***** find the mean of random numbers in a(1000,1)
210 FOR N = 1 TO 1000
220 T = T + A(N,0)
230 NEXT N
240 M = T/1000
250 REM ***** square of the difference *****
260 FOR N = 1 TO 1000
270 D = M - A(N,0)
280 A(N,1) = D^2
290 NEXT N
300 REM ***** add all squares *****
310 FOR N = 1 TO 1000
320 SUM = SUM + A(N,1)
330 NEXT N
340 REM
350 REM ***** sum divided by number of data values *****
360 SUM2 = SUM/ 1000
370 REM
380 REM ***** standard deviation is square root of sum2 *****
390 SD = SQR(SUM2)
400 PRINT
410 PRINT "DATE"," AVERAGE"," STANDARD DEVIATION"
420 PRINT DATE$,M,SD
430 PRINT#1,DATE$,M,SD
440 CLOSE#1
450 PRINT
460 REM   a KindlyRat program