Home » Archimedes archive » Acorn User » AU 1994-12.adf » !StarInfo_StarInfo » Craven/!Dice/!RunImage

Craven/!Dice/!RunImage

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-12.adf » !StarInfo_StarInfo
Filename: Craven/!Dice/!RunImage
Read OK:
File size: 2AE2 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM Dice Simulation
   20REM D.Craven, Greenhead College, Huddersfield
   30REM May 1994
   40:
   50:
   60ON ERROR PROCerror
   70DIMfrequency%(200),suxs%(6),th_freq(200),factorial(30)
   80MODE12:tt=RND(-TIME)
   90PROCfactorial:PROCoptions:PROCgetoption
  100WHILE option%<>4
  110meanflag%=FALSE:theory%=FALSE
  120IF data%=TRUE THEN
  130ON option% PROCdata1,PROCdata2,PROCdata3
  140ENDIF
  150ON option% PROCoption1,PROCoption2,PROCoption3
  160PROCftable
  170PROCmean
  180PROCmax
  190PROCscale
  200PROCdraw
  210REPEAT
  220PROCchoices
  230PROCchoose
  240CASE choice% OF
  250WHEN 1:data%=FALSE
  260WHEN 2:data%=TRUE
  270WHEN 3:PROCoptions:PROCgetoption
  280WHEN 4:option%=4
  290WHEN 5:PROCtheoretical
  300WHEN 6:meanflag%=TRUE
  310ENDCASE
  320UNTIL choice%<=4
  330ENDWHILE
  340*DESKTOP
  350:
  360:
  370:
  380:
  390:
  400DEFPROCdata1
  410step%=1:start%=0
  420GCOL134:CLG:COLOUR0:COLOUR131
  430VDU4:VDU29,0;0;
  440MOUSE OFF:OFF
  450GCOL0:RECTANGLE FILL 182,522,916,106:GCOL3:RECTANGLE FILL 190,530,900,90
  460GCOL0:RECTANGLE FILL 182,642,916,176:GCOL3:RECTANGLE FILL 190,650,900,160
  470GCOL0:RECTANGLE FILL 182,872,916,76:GCOL3:RECTANGLE FILL 190,880,900,60
  480PRINTTAB(29,3)"UNIFORM DISTRIBUTION"
  490PRINTTAB(13,7)"This option shows the results of throwing a single die"
  500PRINTTAB(13,8)"repeatedly.  Frequencies of each score are shown"
  510PRINTTAB(13,9)"together with a graphical representation of the"
  520PRINTTAB(13,10)"results."
  530PRINTTAB(13,13)"Enter the number of throws required : allow about"
  540PRINTTAB(13,14)"1 second per 10000:"
  550*FX15,1
  560REPEAT
  570INPUTTAB(32,14)throws%
  580IF throws%<=0 THEN PRINTTAB(45,14)"Positive Please!":PRINTTAB(32,14)"       "
  590UNTIL throws%>0
  600ENDPROC
  610:
  620:
  630:
  640:
  650DEFPROCoption1
  660LOCAL t%
  670PROCset
  680FOR t%=1 TO throws%
  690score%=RND(6)
  700frequency%(score%)=frequency%(score%)+1
  710NEXT t%
  720xmax%=6:maxobs%=6
  730FOR t%=1 TO 6
  740th_freq(t%)=throws%/6
  750NEXT t%
  760th_mean=3.5
  770tvariance=35/12
  780ENDPROC
  790:
  800:
  810:
  820:
  830DEFPROCdata2
  840start%=1
  850GCOL134:CLG:COLOUR0:COLOUR131
  860VDU4:VDU29,0;0;
  870MOUSE OFF:OFF
  880GCOL0:RECTANGLE FILL 182,522,916,116:GCOL3:RECTANGLE FILL 190,530,900,100
  890GCOL0:RECTANGLE FILL 182,652,916,266:GCOL3:RECTANGLE FILL 190,660,900,250
  900GCOL0:RECTANGLE FILL 182,932,916,76:GCOL3:RECTANGLE FILL 190,940,900,60
  910PRINTTAB(29,1)"BINOMIAL DISTRIBUTION"
  920PRINTTAB(13,4)"You can throw up to 25 dice in each trial.  Within"
  930PRINTTAB(13,5)"each trial, up to 5 numbers can count as successes."
  940PRINTTAB(13,6)"The number of successes per trial is recorded, the"
  950PRINTTAB(13,7)"results being shown in a table"
  960PRINTTAB(13,8)"For example, if you throw 10 dice and select 1 and 6"
  970PRINTTAB(13,9)"to count as successes, the result 1 5 2 4 3 3 6 1 3"
  980PRINTTAB(13,10)"would be recorded as 3 successes."
  990PRINTTAB(13,13)"Enter the number of dice you wish to be thrown in each"
 1000PRINTTAB(13,14)"trial (25 max):"
 1010REPEAT
 1020INPUTTAB(28,14)numberx%
 1030IF numberx%>25 THEN PRINTTAB(40,14)"Too Big!        ":PRINTTAB(28,14)"      "
 1040IF numberx%<=0 THEN PRINTTAB(40,14)"Positive Please!":PRINTTAB(28,14)"      "
 1050UNTIL numberx%>0 AND numberx% <=25
 1060IFnumberx%<=9 THEN step%=1 ELSE step%=2
 1070GCOL0:RECTANGLE FILL 182,392,916,116:GCOL3:RECTANGLE FILL 190,400,900,100
 1080PRINTTAB(13,17)"Enter the number of trials, i.e. how many times you"
 1090PRINTTAB(13,18)"want your ";numberx%;" dice to be thrown:"
 1100REPEAT
 1110INPUTTAB(44,18)numtrials%
 1120UNTIL numtrials%>0
 1130GCOL0:RECTANGLE FILL 182,262,916,116:GCOL3:RECTANGLE FILL 190,270,900,100
 1140PRINTTAB(13,21)"Select which scores are to count as successes : you"
 1150PRINTTAB(13,22)"can have up to five numbers  each between 1 and 6:"
 1160PROCwhichnos
 1170ENDPROC
 1180:
 1190:
 1200:
 1210:
 1220DEFPROCoption2
 1230LOCAL s%,t%,p%
 1240PROCset
 1250FOR s%=1 TO numtrials%
 1260numsuxs%=0
 1270FOR t%=1 TO numberx%
 1280score%=RND(6)
 1290IF suxs%(score%)=TRUE THEN numsuxs%=numsuxs%+1
 1300NEXT t%
 1310frequency%(numsuxs%)=frequency%(numsuxs%)+1
 1320NEXT s%
 1330xmax%=numberx%:maxobs%=numberx%
 1340FOR t%=1 TO 6
 1350IF suxs%(t%)=TRUE THEN p%=p%+1
 1360NEXT t%
 1370FOR t%=0 TO numberx%
 1380th_freq(t%)=factorial(numberx%)/(factorial(t%)*factorial(numberx%-t%))*(p%/6)^t%*(1-p%/6)^(numberx%-t%)*numtrials%
 1390NEXT t%
 1400th_mean=numberx%*p%/6
 1410tvariance=numberx%*p%/6*(1-p%/6)
 1420ENDPROC
 1430:
 1440:
 1450:
 1460:
 1470DEFPROCdata3
 1480start%=0
 1490GCOL134:CLG:COLOUR0:COLOUR131
 1500VDU4:VDU29,0;0;
 1510MOUSE OFF:OFF
 1520GCOL0:RECTANGLE FILL 182,392,916,76:GCOL3:RECTANGLE FILL 190,400,900,60
 1530GCOL0:RECTANGLE FILL 182,482,916,376:GCOL3:RECTANGLE FILL 190,490,900,360
 1540GCOL0:RECTANGLE FILL 182,872,916,76:GCOL3:RECTANGLE FILL 190,880,900,60
 1550PRINTTAB(29,3)"GEOMETRIC DISTRIBUTION"
 1560PRINTTAB(13,6)"A single die is thrown repeatedly until a success"
 1570PRINTTAB(13,7)"is seen.  This can be any one of up to 5 numbers."
 1580PRINTTAB(13,8)"The number of throws required is recorded and"
 1590PRINTTAB(13,9)"shown in a   frequency table and graphically."
 1600PRINTTAB(13,10)"For example if a 6 only is counted as a success,"
 1610PRINTTAB(13,11)"the sequence 1 5 3 4 2 2 3 6   would be recorded"
 1620PRINTTAB(13,12)"as 8 throws required."
 1630PRINTTAB(13,13)"As this number may be very high, only the first part"
 1640PRINTTAB(13,14)"of the table is shown, along with the maximum"
 1650PRINTTAB(13,15)"value observed."
 1660PRINTTAB(13,18)"Enter the number of 'successes':"
 1670REPEAT
 1680INPUTTAB(45,18)numsuxs%
 1690IF numsuxs%<=0 THEN PRINTTAB(51,18)"Positive Please!":PRINTTAB(45,18)"      "
 1700UNTIL numsuxs%>0
 1710GCOL0:RECTANGLE FILL 182,262,916,116:GCOL3:RECTANGLE FILL 190,270,900,100
 1720PRINTTAB(13,21)"Select which scored are to count as successes :you"
 1730PRINTTAB(13,22)"can have up to 5 numbers:"
 1740PROCwhichnos
 1750ENDPROC
 1760:
 1770:
 1780:
 1790:
 1800DEFPROCoption3
 1810LOCAL t%,p%,count%
 1820PROCset
 1830FOR t%=1 TO numsuxs%
 1840count%=0
 1850REPEAT
 1860score%=RND(6)
 1870count%=count%+1
 1880UNTIL suxs%(score%)=TRUE
 1890frequency%(count%)=frequency%(count%)+1
 1900NEXT t%
 1910maxobs%=200
 1920REPEAT
 1930maxobs%=maxobs%-1
 1940UNTILfrequency%(maxobs%)<>0
 1950xmax%=maxobs%
 1960IF xmax%<=10 THEN step%=1:xmax%=10
 1970IF xmax%>10 AND xmax%<=20 THEN step%=2:xmax%=20
 1980IF xmax%>20 THEN step%=2:xmax%=26
 1990FOR t%=1 TO 6
 2000IF suxs%(t%)=TRUE THEN p%=p%+1
 2010NEXT t%
 2020FOR t%=1 TO 27
 2030th_freq(t%)=p%/6*(1-p%/6)^(t%-1)*numsuxs%
 2040NEXT t%
 2050th_mean=6/p%
 2060tvariance=36*(1-p%/6)/p%^2
 2070ENDPROC
 2080:
 2090:
 2100:
 2110:
 2120DEFPROCmax
 2130LOCAL t%
 2140maxf%=frequency%(0)
 2150FORt%=1 TO xmax%
 2160IF frequency%(t%)>maxf% THEN maxf%=frequency%(t%)
 2170NEXT t%
 2180ENDPROC
 2190:
 2200:
 2210:
 2220:
 2230DEFPROCscale
 2240LOCAL t%
 2250VDU29,400;400;
 2260GCOL6:RECTANGLE FILL 0,0,800,600
 2270GCOL0:LINE0,-4,0,600:LINE0,-4,800,-4
 2280IF maxf%<150 THEN ymax%=10*(maxf% DIV 10)+10 ELSE ymax%=100*(maxf% DIV 100)+100
 2290unitx=800/(xmax%+1)
 2300unity=600/ymax%
 2310VDU5
 2320MOVE-170,600:PRINTymax%
 2330MOVE-170,300:PRINTymax%/2
 2340MOVE-170,20:PRINT0
 2350FORt%=1 TO xmax% STEP step%
 2360MOVEt%*unitx-unitx/2-150,-10
 2370PRINTt%-start%;
 2380NEXT t%
 2390ENDPROC
 2400:
 2410:
 2420:
 2430:
 2440DEFPROCdraw
 2450LOCAL t%
 2460FORt%=1 TO xmax%+start%
 2470IF frequency%(t%-start%)<>0 THEN
 2480GCOL0:RECTANGLE FILL (t%-1)*unitx+6,0,unitx-12,frequency%(t%-start%)*unity+4
 2490GCOL2:RECTANGLE FILL (t%-1)*unitx+10,0,unitx-20,frequency%(t%-start%)*unity
 2500ENDIF
 2510NEXT t%
 2520ENDPROC
 2530:
 2540:
 2550:
 2560:
 2570DEFPROCth_draw
 2580LOCAL t%
 2590VDU29,400;400;
 2600FORt%=1 TO xmax%+start%
 2610IF th_freq(t%-start%)>0.1 THEN
 2620GCOL0:RECTANGLE FILL (t%-1)*unitx+6,0,unitx-12,th_freq(t%-start%)*unity+4
 2630GCOL5:RECTANGLE FILL (t%-1)*unitx+10,0,unitx-20,th_freq(t%-start%)*unity
 2640ENDIF
 2650NEXT t%
 2660ENDPROC
 2670:
 2680:
 2690:
 2700:
 2710DEFPROCftable
 2720LOCAL t%
 2730VDU29,0;0;:VDU4
 2740GCOL134:CLG
 2750GCOL0:RECTANGLE FILL10,10,190,1000:GCOL2:RECTANGLE FILL14,14,182,992
 2760COLOUR0:COLOUR130:PRINTTAB(1,1)"Frequencies"
 2770PRINTTAB(1,2)"No.  Freq."
 2780FORt%=1-start% TO xmax%
 2790PRINTTAB(1,(t%+start%)+2)" ";t%;TAB(7-LEN(STR$(frequency%(t%)))DIV2)frequency%(t%)
 2800NEXT t%
 2810IF option%=3 THEN PRINTTAB(1,xmax%+start%+4)"Max x= ";maxobs%
 2820ENDPROC
 2830:
 2840:
 2850:
 2860:
 2870:
 2880DEFPROCchoices
 2890LOCAL x%,y%,t%
 2900VDU29,400;0;
 2910MOUSE ON:MOUSE RECTANGLE 0,40,752,304
 2920GCOL0:RECTANGLE FILL 0,40,752,304:GCOL3
 2930FOR x%=0 TO 2
 2940FOR y%=0 TO 1
 2950RECTANGLE FILL x%*248+8,y%*148+48,240,140
 2960NEXT y%
 2970NEXT x%:
 2980GCOL0:VDU5:MOVE 40,300:PRINT"Repeat With":MOVE 55,260:PRINT"Same Data"
 2990MOVE 288,300:PRINT"Repeat With":MOVE 310,260:PRINT"New Data"
 3000MOVE 536,280:PRINT"New Option"
 3010MOVE 20,180
 3020IF theory%=FALSE THEN PRINT"Observed Mean" ELSE PRINT"Expected Mean"
 3030MOVE 20,115
 3040IF theory%=FALSE THEN PRINT"Obs. Variance" ELSE PRINT"Exp. Variance"
 3050MOVE 285,175:PRINT"   Show   "
 3060IF theory%=FALSE THEN
 3070MOVE 285,135
 3080PRINT"Theoretical"
 3090ELSE
 3100MOVE 285,135
 3110PRINT"  Observed  "
 3120ENDIF
 3130MOVE 280,95:PRINT"Distribution"
 3140MOVE 590,135:PRINT"Quit"
 3150IF meanflag%=TRUE THEN
 3160IF theory%=FALSE THEN
 3170MOVE 60,145:PRINT LEFT$(STR$(mean),4):MOVE 60,80:PRINT LEFT$(STR$(variance),4)
 3180ELSE
 3190MOVE 60,145:PRINT LEFT$(STR$(th_mean),4):MOVE 60,80:PRINT LEFT$(STR$(tvariance),4)
 3200ENDIF
 3210ENDIF
 3220ENDPROC
 3230:
 3240:
 3250:
 3260:
 3270DEFPROCset
 3280LOCAL t%
 3290maxobs%=0
 3300FOR t%=0 TO 200:frequency%(t%)=0:NEXT t%
 3310ENDPROC
 3320:
 3330:
 3340:
 3350:
 3360DEFPROCmean
 3370LOCAL sigmaf%,sigmafx%,sigmafxx%,t%
 3380FOR t%=0 TO maxobs%
 3390sigmaf%=sigmaf%+frequency%(t%)
 3400sigmafx%=sigmafx%+t%*frequency%(t%)
 3410sigmafxx%=sigmafxx%+t%*t%*frequency%(t%)
 3420NEXT t%
 3430mean=(INT(100*sigmafx%/sigmaf%))/100
 3440variance=(INT(100*(sigmafxx%/sigmaf%-(sigmafx%/sigmaf%)^2)))/100
 3450ENDPROC
 3460:
 3470:
 3480:
 3490:
 3500DEFPROCchoose
 3510LOCAL chosen%,button%,x%,xx%,y%,yy%,t%
 3520choice%=0
 3530REPEAT
 3540REPEAT
 3550MOUSE xpos%,ypos%,button%
 3560UNTIL button%<>0
 3570FOR x%=0 TO 2
 3580FOR y%=0 TO 1
 3590IF xpos%>x%*248+8 AND xpos%<x%*248+248 AND ypos%>y%*148+48 AND ypos%<y%*148+288 THEN
 3600chosen%=TRUE
 3610yy%=y%:xx%=x%
 3620ENDIF
 3630NEXT y%
 3640NEXT x%
 3650UNTIL chosen%=TRUE
 3660FOR t%=1 TO 40000:NEXT t%
 3670IF yy%=0 THEN choice%=6-xx% ELSE choice%=1+xx%
 3680ENDPROC
 3690:
 3700:
 3710:
 3720:
 3730DEFPROCwhichnos
 3740LOCAL xpos%,ypos%,button%,chosen%,done%,numchosen%,t%
 3750VDU5:VDU29,70;0;
 3760MOUSE ON:MOUSE RECTANGLE 120,130,910,70:MOUSE TO 970,160
 3770FOR t%=1 TO 6
 3780suxs%(t%)=FALSE
 3790GCOL0:RECTANGLE FILL t%*120-4,126,78
 3800GCOL1:RECTANGLE FILL t%*120,130,70
 3810MOVE 28+t%*120,177:GCOL0:PRINT STR$(t%)
 3820NEXT t%
 3830GCOL0:RECTANGLE FILL 906,126,128,78
 3840GCOL3:RECTANGLE FILL 910,130,120,70
 3850GCOL0:MOVE 940,177:PRINT"DONE"
 3860REPEAT
 3870REPEAT
 3880MOUSE xpos%,ypos%,button%
 3890UNTIL button%<>0
 3900FOR t%=1 TO 6
 3910IF xpos%>120*t% AND xpos%<120*t%+70 THEN suxs%(t%)=TRUE:GCOL2:RECTANGLE FILL t%*120,130,70:GCOL0:MOVE 28+t%*120,177:PRINT STR$(t%):chosen%=TRUE
 3920NEXT t%
 3930numchosen%=0
 3940FOR t%=1 TO 6
 3950IF suxs%(t%)=TRUE THEN numchosen%=numchosen%+1
 3960NEXT t%
 3970IF numchosen%=5 THEN done%=TRUE
 3980IF xpos%>920 AND chosen%=TRUE  THEN done%=TRUE
 3990UNTIL chosen%=TRUE AND done%=TRUE
 4000VDU4
 4010FOR t%=1 TO 80000:NEXT t%
 4020ENDPROC
 4030:
 4040:
 4050:
 4060:
 4070DEFPROCoptions
 4080VDU29,0;0;
 4090VDU 4:OFF
 4100GCOL134:CLG:COLOUR0:COLOUR131
 4110MOUSE ON:MOUSE RECTANGLE 190,170,900,650
 4120GCOL0:RECTANGLE FILL 182,162,916,86:GCOL3:RECTANGLE FILL 190,170,900,70:
 4130GCOL0:RECTANGLE FILL 182,262,916,146:GCOL3:RECTANGLE FILL 190,270,900,130:
 4140GCOL0:RECTANGLE FILL 182,422,916,246:GCOL3:RECTANGLE FILL 190,430,900,230:
 4150GCOL0:RECTANGLE FILL 182,682,916,146:GCOL3:RECTANGLE FILL 190,690,900,130:
 4160GCOL0:RECTANGLE FILL 182,842,916,106:GCOL3:RECTANGLE FILL 190,850,900,90:
 4170PRINTTAB(13,3)"Use the mouse to select an option. Click any mouse"
 4180PRINTTAB(13,4)"button to proceed."
 4190PRINTTAB(29,7)"UNIFORM DISTRIBUTION"
 4200PRINTTAB(13,8)"A single die is thrown repeatedly, the result of each"
 4210PRINTTAB(13,9)"throw being recorded."
 4220PRINTTAB(29,12)"BINOMIAL DISTRIBUTION"
 4230PRINTTAB(13,13)"A number of dice (n) are thrown together each throw"
 4240PRINTTAB(13,14)"being called a TRIAL."
 4250PRINTTAB(13,15)"For each die,up to 5 numbers can count as a "
 4260PRINTTAB(13,16)"SUCCESS, e.g. a 6 (p=1/6), an even number (p=1/2) etc."
 4270PRINTTAB(13,17)"The number of successes per trial is recorded."
 4280PRINTTAB(29,20)"GEOMETRIC DISTRIBUTION"
 4290PRINTTAB(13,21)"A single die is thrown, the number of throws between"
 4300PRINTTAB(13,22)"consecutive successes is counted."
 4310PRINTTAB(38,25)"QUIT"
 4320ENDPROC
 4330:
 4340:
 4350:
 4360:
 4370DEFPROCgetoption
 4380LOCAL xpos%,ypos%,button%,chosen%
 4390REPEAT
 4400REPEAT
 4410MOUSE xpos%,ypos%,button%
 4420UNTIL button%<>0
 4430IF ypos%>170 AND ypos%<240 THEN option%=4:chosen%=TRUE
 4440IF ypos%>270 AND ypos%<400 THEN option%=3:chosen%=TRUE
 4450IF ypos%>430 AND ypos%<660 THEN option%=2:chosen%=TRUE
 4460IF ypos%>690 AND ypos%<820 THEN option%=1:chosen%=TRUE
 4470UNTIL chosen%=TRUE
 4480data%=TRUE
 4490ENDPROC
 4500:
 4510:
 4520:
 4530:
 4540DEFPROCtheory
 4550LOCAL t%
 4560VDU29,0;0;
 4570GCOL0:RECTANGLE FILL 210,10,100,1000:GCOL5:RECTANGLE FILL 214,14,92,992
 4580VDU4:COLOUR0:COLOUR133
 4590PRINTTAB(14,1)"Exp."
 4600PRINTTAB(14,2)"freq."
 4610FOR t%=1-start% TO xmax%
 4620PRINTTAB(16-LEN(STR$(INT(th_freq(t%))+INT(2*(th_freq(t%)-INT(th_freq(t%))))))DIV2,(t%+start%)+2)STR$(INT(th_freq(t%))+INT(2*(th_freq(t%)-INT(th_freq(t%)))))
 4630NEXT t%
 4640ENDPROC
 4650:
 4660:
 4670:
 4680:
 4690DEFPROCfactorial
 4700LOCAL t%
 4710factorial(0)=1
 4720factorial(1)=1
 4730FOR t%=2 TO 30
 4740factorial(t%)=t%*factorial(t%-1)
 4750NEXT t%
 4760ENDPROC
 4770:
 4780:
 4790:
 4800:
 4810DEFPROCtheoretical
 4820PROCtheory
 4830PROCscale
 4840IF theory%=FALSE THEN PROCth_draw ELSE PROCdraw
 4850theory%=NOTtheory%
 4860ENDPROC
 4870:
 4880:
 4890:
 4900:
 4910DEFPROCerror
 4920IF ERR=17 THEN
 4930*desktop
 4940ELSE
 4950CLS
 4960REPORT
 4970PRINTERL
 4980ENDIF
 4990ENDPROC

� Dice Simulation
/� D.Craven, Greenhead College, Huddersfield
� May 1994
(:
2:
<� � �error
F8�frequency%(200),suxs%(6),th_freq(200),factorial(30)
P�12:tt=�(-�)
Z"�factorial:�options:�getoption
dȕ option%<>4
nmeanflag%=�:theory%=�
x� data%=� �
�"� option% �data1,�data2,�data3
��
�(� option% �option1,�option2,�option3
��ftable
�	�mean
��max
�
�scale
�	�draw
��
��choices
��choose
�Ȏ choice% �
�� 1:data%=�
� 2:data%=�
� 3:�options:�getoption
� 4:option%=4
"� 5:�theoretical
,� 6:meanflag%=�
6�
@� choice%<=4
J�
T*DESKTOP
^:
h:
r:
|:
�:
���data1
�step%=1:start%=0
��134:�:�0:�131
��4:�29,0;0;
�
ȗ �:�
�4�0:ȓ Ȑ 182,522,916,106:�3:ȓ Ȑ 190,530,900,90
�5�0:ȓ Ȑ 182,642,916,176:�3:ȓ Ȑ 190,650,900,160
�3�0:ȓ Ȑ 182,872,916,76:�3:ȓ Ȑ 190,880,900,60
�!�29,3)"UNIFORM DISTRIBUTION"
�C�13,7)"This option shows the results of throwing a single die"
�=�13,8)"repeatedly.  Frequencies of each score are shown"
�<�13,9)"together with a graphical representation of the"
�13,10)"results."
?�13,13)"Enter the number of throws required : allow about"
!�13,14)"1 second per 10000:"
&*FX15,1
0�
:�32,14)throws%
D?� throws%<=0 � �45,14)"Positive Please!":�32,14)"       "
N� throws%>0
X�
b:
l:
v:
�:
�
��option1
�� t%
��set
�� t%=1 � throws%
�score%=�(6)
�+frequency%(score%)=frequency%(score%)+1
�� t%
�xmax%=6:maxobs%=6
�� t%=1 � 6
�th_freq(t%)=throws%/6
�� t%
�th_mean=3.5
tvariance=35/12
�
:
 :
*:
4:
>��data2
Hstart%=1
R�134:�:�0:�131
\�4:�29,0;0;
f
ȗ �:�
p5�0:ȓ Ȑ 182,522,916,116:�3:ȓ Ȑ 190,530,900,100
z5�0:ȓ Ȑ 182,652,916,266:�3:ȓ Ȑ 190,660,900,250
�3�0:ȓ Ȑ 182,932,916,76:�3:ȓ Ȑ 190,940,900,60
�"�29,1)"BINOMIAL DISTRIBUTION"
�?�13,4)"You can throw up to 25 dice in each trial.  Within"
�@�13,5)"each trial, up to 5 numbers can count as successes."
�?�13,6)"The number of successes per trial is recorded, the"
�+�13,7)"results being shown in a table"
�A�13,8)"For example, if you throw 10 dice and select 1 and 6"
�@�13,9)"to count as successes, the result 1 5 2 4 3 3 6 1 3"
�/�13,10)"would be recorded as 3 successes."
�D�13,13)"Enter the number of dice you wish to be thrown in each"
��13,14)"trial (25 max):"
��
��28,14)numberx%
?� numberx%>25 � �40,14)"Too Big!        ":�28,14)"      "
?� numberx%<=0 � �40,14)"Positive Please!":�28,14)"      "
 � numberx%>0 � numberx% <=25
$$�numberx%<=9 � step%=1 � step%=2
.5�0:ȓ Ȑ 182,392,916,116:�3:ȓ Ȑ 190,400,900,100
8A�13,17)"Enter the number of trials, i.e. how many times you"
B7�13,18)"want your ";numberx%;" dice to be thrown:"
L�
V�44,18)numtrials%
`� numtrials%>0
j5�0:ȓ Ȑ 182,262,916,116:�3:ȓ Ȑ 190,270,900,100
tA�13,21)"Select which scores are to count as successes : you"
~@�13,22)"can have up to five numbers  each between 1 and 6:"
�
�whichnos
��
�:
�:
�:
�:
�
��option2
�� s%,t%,p%
��set
�� s%=1 � numtrials%
�numsuxs%=0
�� t%=1 � numberx%
score%=�(6)

+� suxs%(score%)=� � numsuxs%=numsuxs%+1
� t%
/frequency%(numsuxs%)=frequency%(numsuxs%)+1
(� s%
2#xmax%=numberx%:maxobs%=numberx%
<� t%=1 � 6
F� suxs%(t%)=� � p%=p%+1
P� t%
Z� t%=0 � numberx%
dvth_freq(t%)=factorial(numberx%)/(factorial(t%)*factorial(numberx%-t%))*(p%/6)^t%*(1-p%/6)^(numberx%-t%)*numtrials%
n� t%
xth_mean=numberx%*p%/6
�$tvariance=numberx%*p%/6*(1-p%/6)
��
�:
�:
�:
�:
���data3
�start%=0
��134:�:�0:�131
��4:�29,0;0;
�
ȗ �:�
�3�0:ȓ Ȑ 182,392,916,76:�3:ȓ Ȑ 190,400,900,60
�5�0:ȓ Ȑ 182,482,916,376:�3:ȓ Ȑ 190,490,900,360
3�0:ȓ Ȑ 182,872,916,76:�3:ȓ Ȑ 190,880,900,60
#�29,3)"GEOMETRIC DISTRIBUTION"
>�13,6)"A single die is thrown repeatedly until a success"
">�13,7)"is seen.  This can be any one of up to 5 numbers."
,:�13,8)"The number of throws required is recorded and"
6:�13,9)"shown in a   frequency table and graphically."
@>�13,10)"For example if a 6 only is counted as a success,"
J>�13,11)"the sequence 1 5 3 4 2 2 3 6   would be recorded"
T#�13,12)"as 8 throws required."
^B�13,13)"As this number may be very high, only the first part"
h;�13,14)"of the table is shown, along with the maximum"
r�13,15)"value observed."
|.�13,18)"Enter the number of 'successes':"
��
��45,18)numsuxs%
�?� numsuxs%<=0 � �51,18)"Positive Please!":�45,18)"      "
�� numsuxs%>0
�5�0:ȓ Ȑ 182,262,916,116:�3:ȓ Ȑ 190,270,900,100
�@�13,21)"Select which scored are to count as successes :you"
�'�13,22)"can have up to 5 numbers:"
�
�whichnos
��
�:
�:
�:
�:

��option3
� t%,p%,count%
�set
&� t%=1 � numsuxs%
0count%=0
:�
Dscore%=�(6)
Ncount%=count%+1
X� suxs%(score%)=�
b+frequency%(count%)=frequency%(count%)+1
l� t%
vmaxobs%=200
��
�maxobs%=maxobs%-1
��frequency%(maxobs%)<>0
�xmax%=maxobs%
�"� xmax%<=10 � step%=1:xmax%=10
�-� xmax%>10 � xmax%<=20 � step%=2:xmax%=20
�!� xmax%>20 � step%=2:xmax%=26
�� t%=1 � 6
�� suxs%(t%)=� � p%=p%+1
�� t%
�� t%=1 � 27
�-th_freq(t%)=p%/6*(1-p%/6)^(t%-1)*numsuxs%
�� t%
th_mean=6/p%
tvariance=36*(1-p%/6)/p%^2
�
 :
*:
4:
>:
H	��max
R� t%
\maxf%=frequency%(0)
f�t%=1 � xmax%
p1� frequency%(t%)>maxf% � maxf%=frequency%(t%)
z� t%
��
�:
�:
�:
�:
���scale
�� t%
��29,400;400;
��6:ȓ Ȑ 0,0,800,600
��0:�0,-4,0,600:�0,-4,800,-4
�H� maxf%<150 � ymax%=10*(maxf% � 10)+10 � ymax%=100*(maxf% � 100)+100
�unitx=800/(xmax%+1)
�unity=600/ymax%
	�5
	�-170,600:�ymax%
	�-170,300:�ymax%/2
	$�-170,20:�0
	.�t%=1 � xmax% � step%
	8�t%*unitx-unitx/2-150,-10
	B�t%-start%;
	L� t%
	V�
	`:
	j:
	t:
	~:
	�
��draw
	�� t%
	��t%=1 � xmax%+start%
	� � frequency%(t%-start%)<>0 �
	�D�0:ȓ Ȑ (t%-1)*unitx+6,0,unitx-12,frequency%(t%-start%)*unity+4
	�C�2:ȓ Ȑ (t%-1)*unitx+10,0,unitx-20,frequency%(t%-start%)*unity
	��
	�� t%
	��
	�:
	�:
	�:
:


��th_draw
� t%
�29,400;400;
(�t%=1 � xmax%+start%
2� th_freq(t%-start%)>0.1 �
<A�0:ȓ Ȑ (t%-1)*unitx+6,0,unitx-12,th_freq(t%-start%)*unity+4
F@�5:ȓ Ȑ (t%-1)*unitx+10,0,unitx-20,th_freq(t%-start%)*unity
P�
Z� t%
d�
n:
x:
�:
�:
���ftable
�� t%
��29,0;0;:�4
�
�134:�
�0�0:ȓ Ȑ10,10,190,1000:�2:ȓ Ȑ14,14,182,992
��0:�130:�1,1)"Frequencies"
��1,2)"No.  Freq."
��t%=1-start% � xmax%
�E�1,(t%+start%)+2)" ";t%;�7-�(�(frequency%(t%)))�2)frequency%(t%)
�� t%
�6� option%=3 � �1,xmax%+start%+4)"Max x= ";maxobs%
�
:
:
":
,:
6:
@
��choices
J� x%,y%,t%
T�29,400;0;
^ȗ �:ȗ ȓ 0,40,752,304
h�0:ȓ Ȑ 0,40,752,304:�3
r� x%=0 � 2
|� y%=0 � 1
�$ȓ Ȑ x%*248+8,y%*148+48,240,140
�� y%
�	� x%:
�7�0:�5:� 40,300:�"Repeat With":� 55,260:�"Same Data"
�2� 288,300:�"Repeat With":� 310,260:�"New Data"
�� 536,280:�"New Option"
�� 20,180
�5� theory%=� � �"Observed Mean" � �"Expected Mean"
�� 20,115
�5� theory%=� � �"Obs. Variance" � �"Exp. Variance"
�� 285,175:�"   Show   "
�� theory%=� �
�
� 285,135
�"Theoretical"
�

� 285,135
&�"  Observed  "
0�
:� 280,95:�"Distribution"
D� 590,135:�"Quit"
N� meanflag%=� �
X� theory%=� �
b4� 60,145:� ��(mean),4):� 60,80:� ��(variance),4)
l�
v8� 60,145:� ��(th_mean),4):� 60,80:� ��(tvariance),4)
��
��
��
�:
�:
�:
�:
�	��set
�� t%
�
maxobs%=0
�&� t%=0 � 200:frequency%(t%)=0:� t%
��
�:

:

:

:

 
��mean

*#� sigmaf%,sigmafx%,sigmafxx%,t%

4� t%=0 � maxobs%

>"sigmaf%=sigmaf%+frequency%(t%)

H'sigmafx%=sigmafx%+t%*frequency%(t%)

R,sigmafxx%=sigmafxx%+t%*t%*frequency%(t%)

\� t%

f&mean=(�(100*sigmafx%/sigmaf%))/100

pBvariance=(�(100*(sigmafxx%/sigmaf%-(sigmafx%/sigmaf%)^2)))/100

z�

�:

�:

�:

�:

���choose

�&� chosen%,button%,x%,xx%,y%,yy%,t%

�
choice%=0

��

��

�ȗ xpos%,ypos%,button%

�� button%<>0

�� x%=0 � 2

�� y%=0 � 1
N� xpos%>x%*248+8 � xpos%<x%*248+248 � ypos%>y%*148+48 � ypos%<y%*148+288 �

chosen%=�
yy%=y%:xx%=x%
$�
.� y%
8� x%
B� chosen%=�
L� t%=1 � 40000:� t%
V+� yy%=0 � choice%=6-xx% � choice%=1+xx%
`�
j:
t:
~:
�:
���whichnos
�5� xpos%,ypos%,button%,chosen%,done%,numchosen%,t%
��5:�29,70;0;
�*ȗ �:ȗ ȓ 120,130,910,70:ȗ � 970,160
�� t%=1 � 6
�suxs%(t%)=�
��0:ȓ Ȑ t%*120-4,126,78
��1:ȓ Ȑ t%*120,130,70
�� 28+t%*120,177:�0:� �(t%)
�� t%
��0:ȓ Ȑ 906,126,128,78
�3:ȓ Ȑ 910,130,120,70

�0:� 940,177:�"DONE"
�
�
(ȗ xpos%,ypos%,button%
2� button%<>0
<� t%=1 � 6
Fn� xpos%>120*t% � xpos%<120*t%+70 � suxs%(t%)=�:�2:ȓ Ȑ t%*120,130,70:�0:� 28+t%*120,177:� �(t%):chosen%=�
P� t%
Znumchosen%=0
d� t%=1 � 6
n+� suxs%(t%)=� � numchosen%=numchosen%+1
x� t%
�� numchosen%=5 � done%=�
�&� xpos%>920 � chosen%=�  � done%=�
�� chosen%=� � done%=�
��4
�� t%=1 � 80000:� t%
��
�:
�:
�:
�:
�
��options
��29,0;0;
�	� 4:�
�134:�:�0:�131
ȗ �:ȗ ȓ 190,170,900,650
4�0:ȓ Ȑ 182,162,916,86:�3:ȓ Ȑ 190,170,900,70:
"6�0:ȓ Ȑ 182,262,916,146:�3:ȓ Ȑ 190,270,900,130:
,6�0:ȓ Ȑ 182,422,916,246:�3:ȓ Ȑ 190,430,900,230:
66�0:ȓ Ȑ 182,682,916,146:�3:ȓ Ȑ 190,690,900,130:
@5�0:ȓ Ȑ 182,842,916,106:�3:ȓ Ȑ 190,850,900,90:
J?�13,3)"Use the mouse to select an option. Click any mouse"
T�13,4)"button to proceed."
^!�29,7)"UNIFORM DISTRIBUTION"
hB�13,8)"A single die is thrown repeatedly, the result of each"
r"�13,9)"throw being recorded."
|#�29,12)"BINOMIAL DISTRIBUTION"
�A�13,13)"A number of dice (n) are thrown together each throw"
�#�13,14)"being called a TRIAL."
�:�13,15)"For each die,up to 5 numbers can count as a "
�D�13,16)"SUCCESS, e.g. a 6 (p=1/6), an even number (p=1/2) etc."
�<�13,17)"The number of successes per trial is recorded."
�$�29,20)"GEOMETRIC DISTRIBUTION"
�B�13,21)"A single die is thrown, the number of throws between"
�/�13,22)"consecutive successes is counted."
��38,25)"QUIT"
��
�:
�:
�:
:
��getoption
!� xpos%,ypos%,button%,chosen%
&�
0�
:ȗ xpos%,ypos%,button%
D� button%<>0
N1� ypos%>170 � ypos%<240 � option%=4:chosen%=�
X1� ypos%>270 � ypos%<400 � option%=3:chosen%=�
b1� ypos%>430 � ypos%<660 � option%=2:chosen%=�
l1� ypos%>690 � ypos%<820 � option%=1:chosen%=�
v� chosen%=�
�data%=�
��
�:
�:
�:
�:
���theory
�� t%
��29,0;0;
�3�0:ȓ Ȑ 210,10,100,1000:�5:ȓ Ȑ 214,14,92,992
��4:�0:�133
��14,1)"Exp."
��14,2)"freq."
� t%=1-start% � xmax%
��16-�(�(�(th_freq(t%))+�(2*(th_freq(t%)-�(th_freq(t%))))))�2,(t%+start%)+2)�(�(th_freq(t%))+�(2*(th_freq(t%)-�(th_freq(t%)))))
� t%
 �
*:
4:
>:
H:
R��factorial
\� t%
ffactorial(0)=1
pfactorial(1)=1
z� t%=2 � 30
�$factorial(t%)=t%*factorial(t%-1)
�� t%
��
�:
�:
�:
�:
���theoretical
��theory
�
�scale
�"� theory%=� � �th_draw � �draw
�theory%=�theory%
��
:
:
:
$:
.��error
8� �=17 �
B*desktop
L�
V�
`�
j�
t�
~�
�
00000000  0d 00 0a 15 f4 20 44 69  63 65 20 53 69 6d 75 6c  |..... Dice Simul|
00000010  61 74 69 6f 6e 0d 00 14  2f f4 20 44 2e 43 72 61  |ation.../. D.Cra|
00000020  76 65 6e 2c 20 47 72 65  65 6e 68 65 61 64 20 43  |ven, Greenhead C|
00000030  6f 6c 6c 65 67 65 2c 20  48 75 64 64 65 72 73 66  |ollege, Huddersf|
00000040  69 65 6c 64 0d 00 1e 0e  f4 20 4d 61 79 20 31 39  |ield..... May 19|
00000050  39 34 0d 00 28 05 3a 0d  00 32 05 3a 0d 00 3c 0e  |94..(.:..2.:..<.|
00000060  ee 20 85 20 f2 65 72 72  6f 72 0d 00 46 38 de 66  |. . .error..F8.f|
00000070  72 65 71 75 65 6e 63 79  25 28 32 30 30 29 2c 73  |requency%(200),s|
00000080  75 78 73 25 28 36 29 2c  74 68 5f 66 72 65 71 28  |uxs%(6),th_freq(|
00000090  32 30 30 29 2c 66 61 63  74 6f 72 69 61 6c 28 33  |200),factorial(3|
000000a0  30 29 0d 00 50 10 eb 31  32 3a 74 74 3d b3 28 2d  |0)..P..12:tt=.(-|
000000b0  91 29 0d 00 5a 22 f2 66  61 63 74 6f 72 69 61 6c  |.)..Z".factorial|
000000c0  3a f2 6f 70 74 69 6f 6e  73 3a f2 67 65 74 6f 70  |:.options:.getop|
000000d0  74 69 6f 6e 0d 00 64 11  c8 95 20 6f 70 74 69 6f  |tion..d... optio|
000000e0  6e 25 3c 3e 34 0d 00 6e  19 6d 65 61 6e 66 6c 61  |n%<>4..n.meanfla|
000000f0  67 25 3d a3 3a 74 68 65  6f 72 79 25 3d a3 0d 00  |g%=.:theory%=...|
00000100  78 0f e7 20 64 61 74 61  25 3d b9 20 8c 0d 00 82  |x.. data%=. ....|
00000110  22 ee 20 6f 70 74 69 6f  6e 25 20 f2 64 61 74 61  |". option% .data|
00000120  31 2c f2 64 61 74 61 32  2c f2 64 61 74 61 33 0d  |1,.data2,.data3.|
00000130  00 8c 05 cd 0d 00 96 28  ee 20 6f 70 74 69 6f 6e  |.......(. option|
00000140  25 20 f2 6f 70 74 69 6f  6e 31 2c f2 6f 70 74 69  |% .option1,.opti|
00000150  6f 6e 32 2c f2 6f 70 74  69 6f 6e 33 0d 00 a0 0b  |on2,.option3....|
00000160  f2 66 74 61 62 6c 65 0d  00 aa 09 f2 6d 65 61 6e  |.ftable.....mean|
00000170  0d 00 b4 08 f2 6d 61 78  0d 00 be 0a f2 73 63 61  |.....max.....sca|
00000180  6c 65 0d 00 c8 09 f2 64  72 61 77 0d 00 d2 05 f5  |le.....draw.....|
00000190  0d 00 dc 0c f2 63 68 6f  69 63 65 73 0d 00 e6 0b  |.....choices....|
000001a0  f2 63 68 6f 6f 73 65 0d  00 f0 10 c8 8e 20 63 68  |.choose...... ch|
000001b0  6f 69 63 65 25 20 ca 0d  00 fa 0f c9 20 31 3a 64  |oice% ...... 1:d|
000001c0  61 74 61 25 3d a3 0d 01  04 0f c9 20 32 3a 64 61  |ata%=...... 2:da|
000001d0  74 61 25 3d b9 0d 01 0e  1b c9 20 33 3a f2 6f 70  |ta%=...... 3:.op|
000001e0  74 69 6f 6e 73 3a f2 67  65 74 6f 70 74 69 6f 6e  |tions:.getoption|
000001f0  0d 01 18 11 c9 20 34 3a  6f 70 74 69 6f 6e 25 3d  |..... 4:option%=|
00000200  34 0d 01 22 14 c9 20 35  3a f2 74 68 65 6f 72 65  |4..".. 5:.theore|
00000210  74 69 63 61 6c 0d 01 2c  13 c9 20 36 3a 6d 65 61  |tical..,.. 6:mea|
00000220  6e 66 6c 61 67 25 3d b9  0d 01 36 05 cb 0d 01 40  |nflag%=...6....@|
00000230  10 fd 20 63 68 6f 69 63  65 25 3c 3d 34 0d 01 4a  |.. choice%<=4..J|
00000240  05 ce 0d 01 54 0c 2a 44  45 53 4b 54 4f 50 0d 01  |....T.*DESKTOP..|
00000250  5e 05 3a 0d 01 68 05 3a  0d 01 72 05 3a 0d 01 7c  |^.:..h.:..r.:..||
00000260  05 3a 0d 01 86 05 3a 0d  01 90 0b dd f2 64 61 74  |.:....:......dat|
00000270  61 31 0d 01 9a 14 73 74  65 70 25 3d 31 3a 73 74  |a1....step%=1:st|
00000280  61 72 74 25 3d 30 0d 01  a4 12 e6 31 33 34 3a da  |art%=0.....134:.|
00000290  3a fb 30 3a fb 31 33 31  0d 01 ae 0f ef 34 3a ef  |:.0:.131.....4:.|
000002a0  32 39 2c 30 3b 30 3b 0d  01 b8 0a c8 97 20 87 3a  |29,0;0;...... .:|
000002b0  87 0d 01 c2 34 e6 30 3a  c8 93 20 c8 90 20 31 38  |....4.0:.. .. 18|
000002c0  32 2c 35 32 32 2c 39 31  36 2c 31 30 36 3a e6 33  |2,522,916,106:.3|
000002d0  3a c8 93 20 c8 90 20 31  39 30 2c 35 33 30 2c 39  |:.. .. 190,530,9|
000002e0  30 30 2c 39 30 0d 01 cc  35 e6 30 3a c8 93 20 c8  |00,90...5.0:.. .|
000002f0  90 20 31 38 32 2c 36 34  32 2c 39 31 36 2c 31 37  |. 182,642,916,17|
00000300  36 3a e6 33 3a c8 93 20  c8 90 20 31 39 30 2c 36  |6:.3:.. .. 190,6|
00000310  35 30 2c 39 30 30 2c 31  36 30 0d 01 d6 33 e6 30  |50,900,160...3.0|
00000320  3a c8 93 20 c8 90 20 31  38 32 2c 38 37 32 2c 39  |:.. .. 182,872,9|
00000330  31 36 2c 37 36 3a e6 33  3a c8 93 20 c8 90 20 31  |16,76:.3:.. .. 1|
00000340  39 30 2c 38 38 30 2c 39  30 30 2c 36 30 0d 01 e0  |90,880,900,60...|
00000350  21 f1 8a 32 39 2c 33 29  22 55 4e 49 46 4f 52 4d  |!..29,3)"UNIFORM|
00000360  20 44 49 53 54 52 49 42  55 54 49 4f 4e 22 0d 01  | DISTRIBUTION"..|
00000370  ea 43 f1 8a 31 33 2c 37  29 22 54 68 69 73 20 6f  |.C..13,7)"This o|
00000380  70 74 69 6f 6e 20 73 68  6f 77 73 20 74 68 65 20  |ption shows the |
00000390  72 65 73 75 6c 74 73 20  6f 66 20 74 68 72 6f 77  |results of throw|
000003a0  69 6e 67 20 61 20 73 69  6e 67 6c 65 20 64 69 65  |ing a single die|
000003b0  22 0d 01 f4 3d f1 8a 31  33 2c 38 29 22 72 65 70  |"...=..13,8)"rep|
000003c0  65 61 74 65 64 6c 79 2e  20 20 46 72 65 71 75 65  |eatedly.  Freque|
000003d0  6e 63 69 65 73 20 6f 66  20 65 61 63 68 20 73 63  |ncies of each sc|
000003e0  6f 72 65 20 61 72 65 20  73 68 6f 77 6e 22 0d 01  |ore are shown"..|
000003f0  fe 3c f1 8a 31 33 2c 39  29 22 74 6f 67 65 74 68  |.<..13,9)"togeth|
00000400  65 72 20 77 69 74 68 20  61 20 67 72 61 70 68 69  |er with a graphi|
00000410  63 61 6c 20 72 65 70 72  65 73 65 6e 74 61 74 69  |cal representati|
00000420  6f 6e 20 6f 66 20 74 68  65 22 0d 02 08 16 f1 8a  |on of the"......|
00000430  31 33 2c 31 30 29 22 72  65 73 75 6c 74 73 2e 22  |13,10)"results."|
00000440  0d 02 12 3f f1 8a 31 33  2c 31 33 29 22 45 6e 74  |...?..13,13)"Ent|
00000450  65 72 20 74 68 65 20 6e  75 6d 62 65 72 20 6f 66  |er the number of|
00000460  20 74 68 72 6f 77 73 20  72 65 71 75 69 72 65 64  | throws required|
00000470  20 3a 20 61 6c 6c 6f 77  20 61 62 6f 75 74 22 0d  | : allow about".|
00000480  02 1c 21 f1 8a 31 33 2c  31 34 29 22 31 20 73 65  |..!..13,14)"1 se|
00000490  63 6f 6e 64 20 70 65 72  20 31 30 30 30 30 3a 22  |cond per 10000:"|
000004a0  0d 02 26 0b 2a 46 58 31  35 2c 31 0d 02 30 05 f5  |..&.*FX15,1..0..|
000004b0  0d 02 3a 13 e8 8a 33 32  2c 31 34 29 74 68 72 6f  |..:...32,14)thro|
000004c0  77 73 25 0d 02 44 3f e7  20 74 68 72 6f 77 73 25  |ws%..D?. throws%|
000004d0  3c 3d 30 20 8c 20 f1 8a  34 35 2c 31 34 29 22 50  |<=0 . ..45,14)"P|
000004e0  6f 73 69 74 69 76 65 20  50 6c 65 61 73 65 21 22  |ositive Please!"|
000004f0  3a f1 8a 33 32 2c 31 34  29 22 20 20 20 20 20 20  |:..32,14)"      |
00000500  20 22 0d 02 4e 0f fd 20  74 68 72 6f 77 73 25 3e  | "..N.. throws%>|
00000510  30 0d 02 58 05 e1 0d 02  62 05 3a 0d 02 6c 05 3a  |0..X....b.:..l.:|
00000520  0d 02 76 05 3a 0d 02 80  05 3a 0d 02 8a 0d dd f2  |..v.:....:......|
00000530  6f 70 74 69 6f 6e 31 0d  02 94 08 ea 20 74 25 0d  |option1..... t%.|
00000540  02 9e 08 f2 73 65 74 0d  02 a8 14 e3 20 74 25 3d  |....set..... t%=|
00000550  31 20 b8 20 74 68 72 6f  77 73 25 0d 02 b2 0f 73  |1 . throws%....s|
00000560  63 6f 72 65 25 3d b3 28  36 29 0d 02 bc 2b 66 72  |core%=.(6)...+fr|
00000570  65 71 75 65 6e 63 79 25  28 73 63 6f 72 65 25 29  |equency%(score%)|
00000580  3d 66 72 65 71 75 65 6e  63 79 25 28 73 63 6f 72  |=frequency%(scor|
00000590  65 25 29 2b 31 0d 02 c6  08 ed 20 74 25 0d 02 d0  |e%)+1..... t%...|
000005a0  15 78 6d 61 78 25 3d 36  3a 6d 61 78 6f 62 73 25  |.xmax%=6:maxobs%|
000005b0  3d 36 0d 02 da 0e e3 20  74 25 3d 31 20 b8 20 36  |=6..... t%=1 . 6|
000005c0  0d 02 e4 19 74 68 5f 66  72 65 71 28 74 25 29 3d  |....th_freq(t%)=|
000005d0  74 68 72 6f 77 73 25 2f  36 0d 02 ee 08 ed 20 74  |throws%/6..... t|
000005e0  25 0d 02 f8 0f 74 68 5f  6d 65 61 6e 3d 33 2e 35  |%....th_mean=3.5|
000005f0  0d 03 02 13 74 76 61 72  69 61 6e 63 65 3d 33 35  |....tvariance=35|
00000600  2f 31 32 0d 03 0c 05 e1  0d 03 16 05 3a 0d 03 20  |/12.........:.. |
00000610  05 3a 0d 03 2a 05 3a 0d  03 34 05 3a 0d 03 3e 0b  |.:..*.:..4.:..>.|
00000620  dd f2 64 61 74 61 32 0d  03 48 0c 73 74 61 72 74  |..data2..H.start|
00000630  25 3d 31 0d 03 52 12 e6  31 33 34 3a da 3a fb 30  |%=1..R..134:.:.0|
00000640  3a fb 31 33 31 0d 03 5c  0f ef 34 3a ef 32 39 2c  |:.131..\..4:.29,|
00000650  30 3b 30 3b 0d 03 66 0a  c8 97 20 87 3a 87 0d 03  |0;0;..f... .:...|
00000660  70 35 e6 30 3a c8 93 20  c8 90 20 31 38 32 2c 35  |p5.0:.. .. 182,5|
00000670  32 32 2c 39 31 36 2c 31  31 36 3a e6 33 3a c8 93  |22,916,116:.3:..|
00000680  20 c8 90 20 31 39 30 2c  35 33 30 2c 39 30 30 2c  | .. 190,530,900,|
00000690  31 30 30 0d 03 7a 35 e6  30 3a c8 93 20 c8 90 20  |100..z5.0:.. .. |
000006a0  31 38 32 2c 36 35 32 2c  39 31 36 2c 32 36 36 3a  |182,652,916,266:|
000006b0  e6 33 3a c8 93 20 c8 90  20 31 39 30 2c 36 36 30  |.3:.. .. 190,660|
000006c0  2c 39 30 30 2c 32 35 30  0d 03 84 33 e6 30 3a c8  |,900,250...3.0:.|
000006d0  93 20 c8 90 20 31 38 32  2c 39 33 32 2c 39 31 36  |. .. 182,932,916|
000006e0  2c 37 36 3a e6 33 3a c8  93 20 c8 90 20 31 39 30  |,76:.3:.. .. 190|
000006f0  2c 39 34 30 2c 39 30 30  2c 36 30 0d 03 8e 22 f1  |,940,900,60...".|
00000700  8a 32 39 2c 31 29 22 42  49 4e 4f 4d 49 41 4c 20  |.29,1)"BINOMIAL |
00000710  44 49 53 54 52 49 42 55  54 49 4f 4e 22 0d 03 98  |DISTRIBUTION"...|
00000720  3f f1 8a 31 33 2c 34 29  22 59 6f 75 20 63 61 6e  |?..13,4)"You can|
00000730  20 74 68 72 6f 77 20 75  70 20 74 6f 20 32 35 20  | throw up to 25 |
00000740  64 69 63 65 20 69 6e 20  65 61 63 68 20 74 72 69  |dice in each tri|
00000750  61 6c 2e 20 20 57 69 74  68 69 6e 22 0d 03 a2 40  |al.  Within"...@|
00000760  f1 8a 31 33 2c 35 29 22  65 61 63 68 20 74 72 69  |..13,5)"each tri|
00000770  61 6c 2c 20 75 70 20 74  6f 20 35 20 6e 75 6d 62  |al, up to 5 numb|
00000780  65 72 73 20 63 61 6e 20  63 6f 75 6e 74 20 61 73  |ers can count as|
00000790  20 73 75 63 63 65 73 73  65 73 2e 22 0d 03 ac 3f  | successes."...?|
000007a0  f1 8a 31 33 2c 36 29 22  54 68 65 20 6e 75 6d 62  |..13,6)"The numb|
000007b0  65 72 20 6f 66 20 73 75  63 63 65 73 73 65 73 20  |er of successes |
000007c0  70 65 72 20 74 72 69 61  6c 20 69 73 20 72 65 63  |per trial is rec|
000007d0  6f 72 64 65 64 2c 20 74  68 65 22 0d 03 b6 2b f1  |orded, the"...+.|
000007e0  8a 31 33 2c 37 29 22 72  65 73 75 6c 74 73 20 62  |.13,7)"results b|
000007f0  65 69 6e 67 20 73 68 6f  77 6e 20 69 6e 20 61 20  |eing shown in a |
00000800  74 61 62 6c 65 22 0d 03  c0 41 f1 8a 31 33 2c 38  |table"...A..13,8|
00000810  29 22 46 6f 72 20 65 78  61 6d 70 6c 65 2c 20 69  |)"For example, i|
00000820  66 20 79 6f 75 20 74 68  72 6f 77 20 31 30 20 64  |f you throw 10 d|
00000830  69 63 65 20 61 6e 64 20  73 65 6c 65 63 74 20 31  |ice and select 1|
00000840  20 61 6e 64 20 36 22 0d  03 ca 40 f1 8a 31 33 2c  | and 6"...@..13,|
00000850  39 29 22 74 6f 20 63 6f  75 6e 74 20 61 73 20 73  |9)"to count as s|
00000860  75 63 63 65 73 73 65 73  2c 20 74 68 65 20 72 65  |uccesses, the re|
00000870  73 75 6c 74 20 31 20 35  20 32 20 34 20 33 20 33  |sult 1 5 2 4 3 3|
00000880  20 36 20 31 20 33 22 0d  03 d4 2f f1 8a 31 33 2c  | 6 1 3".../..13,|
00000890  31 30 29 22 77 6f 75 6c  64 20 62 65 20 72 65 63  |10)"would be rec|
000008a0  6f 72 64 65 64 20 61 73  20 33 20 73 75 63 63 65  |orded as 3 succe|
000008b0  73 73 65 73 2e 22 0d 03  de 44 f1 8a 31 33 2c 31  |sses."...D..13,1|
000008c0  33 29 22 45 6e 74 65 72  20 74 68 65 20 6e 75 6d  |3)"Enter the num|
000008d0  62 65 72 20 6f 66 20 64  69 63 65 20 79 6f 75 20  |ber of dice you |
000008e0  77 69 73 68 20 74 6f 20  62 65 20 74 68 72 6f 77  |wish to be throw|
000008f0  6e 20 69 6e 20 65 61 63  68 22 0d 03 e8 1d f1 8a  |n in each"......|
00000900  31 33 2c 31 34 29 22 74  72 69 61 6c 20 28 32 35  |13,14)"trial (25|
00000910  20 6d 61 78 29 3a 22 0d  03 f2 05 f5 0d 03 fc 14  | max):".........|
00000920  e8 8a 32 38 2c 31 34 29  6e 75 6d 62 65 72 78 25  |..28,14)numberx%|
00000930  0d 04 06 3f e7 20 6e 75  6d 62 65 72 78 25 3e 32  |...?. numberx%>2|
00000940  35 20 8c 20 f1 8a 34 30  2c 31 34 29 22 54 6f 6f  |5 . ..40,14)"Too|
00000950  20 42 69 67 21 20 20 20  20 20 20 20 20 22 3a f1  | Big!        ":.|
00000960  8a 32 38 2c 31 34 29 22  20 20 20 20 20 20 22 0d  |.28,14)"      ".|
00000970  04 10 3f e7 20 6e 75 6d  62 65 72 78 25 3c 3d 30  |..?. numberx%<=0|
00000980  20 8c 20 f1 8a 34 30 2c  31 34 29 22 50 6f 73 69  | . ..40,14)"Posi|
00000990  74 69 76 65 20 50 6c 65  61 73 65 21 22 3a f1 8a  |tive Please!":..|
000009a0  32 38 2c 31 34 29 22 20  20 20 20 20 20 22 0d 04  |28,14)"      "..|
000009b0  1a 20 fd 20 6e 75 6d 62  65 72 78 25 3e 30 20 80  |. . numberx%>0 .|
000009c0  20 6e 75 6d 62 65 72 78  25 20 3c 3d 32 35 0d 04  | numberx% <=25..|
000009d0  24 24 e7 6e 75 6d 62 65  72 78 25 3c 3d 39 20 8c  |$$.numberx%<=9 .|
000009e0  20 73 74 65 70 25 3d 31  20 8b 20 73 74 65 70 25  | step%=1 . step%|
000009f0  3d 32 0d 04 2e 35 e6 30  3a c8 93 20 c8 90 20 31  |=2...5.0:.. .. 1|
00000a00  38 32 2c 33 39 32 2c 39  31 36 2c 31 31 36 3a e6  |82,392,916,116:.|
00000a10  33 3a c8 93 20 c8 90 20  31 39 30 2c 34 30 30 2c  |3:.. .. 190,400,|
00000a20  39 30 30 2c 31 30 30 0d  04 38 41 f1 8a 31 33 2c  |900,100..8A..13,|
00000a30  31 37 29 22 45 6e 74 65  72 20 74 68 65 20 6e 75  |17)"Enter the nu|
00000a40  6d 62 65 72 20 6f 66 20  74 72 69 61 6c 73 2c 20  |mber of trials, |
00000a50  69 2e 65 2e 20 68 6f 77  20 6d 61 6e 79 20 74 69  |i.e. how many ti|
00000a60  6d 65 73 20 79 6f 75 22  0d 04 42 37 f1 8a 31 33  |mes you"..B7..13|
00000a70  2c 31 38 29 22 77 61 6e  74 20 79 6f 75 72 20 22  |,18)"want your "|
00000a80  3b 6e 75 6d 62 65 72 78  25 3b 22 20 64 69 63 65  |;numberx%;" dice|
00000a90  20 74 6f 20 62 65 20 74  68 72 6f 77 6e 3a 22 0d  | to be thrown:".|
00000aa0  04 4c 05 f5 0d 04 56 16  e8 8a 34 34 2c 31 38 29  |.L....V...44,18)|
00000ab0  6e 75 6d 74 72 69 61 6c  73 25 0d 04 60 12 fd 20  |numtrials%..`.. |
00000ac0  6e 75 6d 74 72 69 61 6c  73 25 3e 30 0d 04 6a 35  |numtrials%>0..j5|
00000ad0  e6 30 3a c8 93 20 c8 90  20 31 38 32 2c 32 36 32  |.0:.. .. 182,262|
00000ae0  2c 39 31 36 2c 31 31 36  3a e6 33 3a c8 93 20 c8  |,916,116:.3:.. .|
00000af0  90 20 31 39 30 2c 32 37  30 2c 39 30 30 2c 31 30  |. 190,270,900,10|
00000b00  30 0d 04 74 41 f1 8a 31  33 2c 32 31 29 22 53 65  |0..tA..13,21)"Se|
00000b10  6c 65 63 74 20 77 68 69  63 68 20 73 63 6f 72 65  |lect which score|
00000b20  73 20 61 72 65 20 74 6f  20 63 6f 75 6e 74 20 61  |s are to count a|
00000b30  73 20 73 75 63 63 65 73  73 65 73 20 3a 20 79 6f  |s successes : yo|
00000b40  75 22 0d 04 7e 40 f1 8a  31 33 2c 32 32 29 22 63  |u"..~@..13,22)"c|
00000b50  61 6e 20 68 61 76 65 20  75 70 20 74 6f 20 66 69  |an have up to fi|
00000b60  76 65 20 6e 75 6d 62 65  72 73 20 20 65 61 63 68  |ve numbers  each|
00000b70  20 62 65 74 77 65 65 6e  20 31 20 61 6e 64 20 36  | between 1 and 6|
00000b80  3a 22 0d 04 88 0d f2 77  68 69 63 68 6e 6f 73 0d  |:".....whichnos.|
00000b90  04 92 05 e1 0d 04 9c 05  3a 0d 04 a6 05 3a 0d 04  |........:....:..|
00000ba0  b0 05 3a 0d 04 ba 05 3a  0d 04 c4 0d dd f2 6f 70  |..:....:......op|
00000bb0  74 69 6f 6e 32 0d 04 ce  0e ea 20 73 25 2c 74 25  |tion2..... s%,t%|
00000bc0  2c 70 25 0d 04 d8 08 f2  73 65 74 0d 04 e2 17 e3  |,p%.....set.....|
00000bd0  20 73 25 3d 31 20 b8 20  6e 75 6d 74 72 69 61 6c  | s%=1 . numtrial|
00000be0  73 25 0d 04 ec 0e 6e 75  6d 73 75 78 73 25 3d 30  |s%....numsuxs%=0|
00000bf0  0d 04 f6 15 e3 20 74 25  3d 31 20 b8 20 6e 75 6d  |..... t%=1 . num|
00000c00  62 65 72 78 25 0d 05 00  0f 73 63 6f 72 65 25 3d  |berx%....score%=|
00000c10  b3 28 36 29 0d 05 0a 2b  e7 20 73 75 78 73 25 28  |.(6)...+. suxs%(|
00000c20  73 63 6f 72 65 25 29 3d  b9 20 8c 20 6e 75 6d 73  |score%)=. . nums|
00000c30  75 78 73 25 3d 6e 75 6d  73 75 78 73 25 2b 31 0d  |uxs%=numsuxs%+1.|
00000c40  05 14 08 ed 20 74 25 0d  05 1e 2f 66 72 65 71 75  |.... t%.../frequ|
00000c50  65 6e 63 79 25 28 6e 75  6d 73 75 78 73 25 29 3d  |ency%(numsuxs%)=|
00000c60  66 72 65 71 75 65 6e 63  79 25 28 6e 75 6d 73 75  |frequency%(numsu|
00000c70  78 73 25 29 2b 31 0d 05  28 08 ed 20 73 25 0d 05  |xs%)+1..(.. s%..|
00000c80  32 23 78 6d 61 78 25 3d  6e 75 6d 62 65 72 78 25  |2#xmax%=numberx%|
00000c90  3a 6d 61 78 6f 62 73 25  3d 6e 75 6d 62 65 72 78  |:maxobs%=numberx|
00000ca0  25 0d 05 3c 0e e3 20 74  25 3d 31 20 b8 20 36 0d  |%..<.. t%=1 . 6.|
00000cb0  05 46 1b e7 20 73 75 78  73 25 28 74 25 29 3d b9  |.F.. suxs%(t%)=.|
00000cc0  20 8c 20 70 25 3d 70 25  2b 31 0d 05 50 08 ed 20  | . p%=p%+1..P.. |
00000cd0  74 25 0d 05 5a 15 e3 20  74 25 3d 30 20 b8 20 6e  |t%..Z.. t%=0 . n|
00000ce0  75 6d 62 65 72 78 25 0d  05 64 76 74 68 5f 66 72  |umberx%..dvth_fr|
00000cf0  65 71 28 74 25 29 3d 66  61 63 74 6f 72 69 61 6c  |eq(t%)=factorial|
00000d00  28 6e 75 6d 62 65 72 78  25 29 2f 28 66 61 63 74  |(numberx%)/(fact|
00000d10  6f 72 69 61 6c 28 74 25  29 2a 66 61 63 74 6f 72  |orial(t%)*factor|
00000d20  69 61 6c 28 6e 75 6d 62  65 72 78 25 2d 74 25 29  |ial(numberx%-t%)|
00000d30  29 2a 28 70 25 2f 36 29  5e 74 25 2a 28 31 2d 70  |)*(p%/6)^t%*(1-p|
00000d40  25 2f 36 29 5e 28 6e 75  6d 62 65 72 78 25 2d 74  |%/6)^(numberx%-t|
00000d50  25 29 2a 6e 75 6d 74 72  69 61 6c 73 25 0d 05 6e  |%)*numtrials%..n|
00000d60  08 ed 20 74 25 0d 05 78  19 74 68 5f 6d 65 61 6e  |.. t%..x.th_mean|
00000d70  3d 6e 75 6d 62 65 72 78  25 2a 70 25 2f 36 0d 05  |=numberx%*p%/6..|
00000d80  82 24 74 76 61 72 69 61  6e 63 65 3d 6e 75 6d 62  |.$tvariance=numb|
00000d90  65 72 78 25 2a 70 25 2f  36 2a 28 31 2d 70 25 2f  |erx%*p%/6*(1-p%/|
00000da0  36 29 0d 05 8c 05 e1 0d  05 96 05 3a 0d 05 a0 05  |6).........:....|
00000db0  3a 0d 05 aa 05 3a 0d 05  b4 05 3a 0d 05 be 0b dd  |:....:....:.....|
00000dc0  f2 64 61 74 61 33 0d 05  c8 0c 73 74 61 72 74 25  |.data3....start%|
00000dd0  3d 30 0d 05 d2 12 e6 31  33 34 3a da 3a fb 30 3a  |=0.....134:.:.0:|
00000de0  fb 31 33 31 0d 05 dc 0f  ef 34 3a ef 32 39 2c 30  |.131.....4:.29,0|
00000df0  3b 30 3b 0d 05 e6 0a c8  97 20 87 3a 87 0d 05 f0  |;0;...... .:....|
00000e00  33 e6 30 3a c8 93 20 c8  90 20 31 38 32 2c 33 39  |3.0:.. .. 182,39|
00000e10  32 2c 39 31 36 2c 37 36  3a e6 33 3a c8 93 20 c8  |2,916,76:.3:.. .|
00000e20  90 20 31 39 30 2c 34 30  30 2c 39 30 30 2c 36 30  |. 190,400,900,60|
00000e30  0d 05 fa 35 e6 30 3a c8  93 20 c8 90 20 31 38 32  |...5.0:.. .. 182|
00000e40  2c 34 38 32 2c 39 31 36  2c 33 37 36 3a e6 33 3a  |,482,916,376:.3:|
00000e50  c8 93 20 c8 90 20 31 39  30 2c 34 39 30 2c 39 30  |.. .. 190,490,90|
00000e60  30 2c 33 36 30 0d 06 04  33 e6 30 3a c8 93 20 c8  |0,360...3.0:.. .|
00000e70  90 20 31 38 32 2c 38 37  32 2c 39 31 36 2c 37 36  |. 182,872,916,76|
00000e80  3a e6 33 3a c8 93 20 c8  90 20 31 39 30 2c 38 38  |:.3:.. .. 190,88|
00000e90  30 2c 39 30 30 2c 36 30  0d 06 0e 23 f1 8a 32 39  |0,900,60...#..29|
00000ea0  2c 33 29 22 47 45 4f 4d  45 54 52 49 43 20 44 49  |,3)"GEOMETRIC DI|
00000eb0  53 54 52 49 42 55 54 49  4f 4e 22 0d 06 18 3e f1  |STRIBUTION"...>.|
00000ec0  8a 31 33 2c 36 29 22 41  20 73 69 6e 67 6c 65 20  |.13,6)"A single |
00000ed0  64 69 65 20 69 73 20 74  68 72 6f 77 6e 20 72 65  |die is thrown re|
00000ee0  70 65 61 74 65 64 6c 79  20 75 6e 74 69 6c 20 61  |peatedly until a|
00000ef0  20 73 75 63 63 65 73 73  22 0d 06 22 3e f1 8a 31  | success"..">..1|
00000f00  33 2c 37 29 22 69 73 20  73 65 65 6e 2e 20 20 54  |3,7)"is seen.  T|
00000f10  68 69 73 20 63 61 6e 20  62 65 20 61 6e 79 20 6f  |his can be any o|
00000f20  6e 65 20 6f 66 20 75 70  20 74 6f 20 35 20 6e 75  |ne of up to 5 nu|
00000f30  6d 62 65 72 73 2e 22 0d  06 2c 3a f1 8a 31 33 2c  |mbers."..,:..13,|
00000f40  38 29 22 54 68 65 20 6e  75 6d 62 65 72 20 6f 66  |8)"The number of|
00000f50  20 74 68 72 6f 77 73 20  72 65 71 75 69 72 65 64  | throws required|
00000f60  20 69 73 20 72 65 63 6f  72 64 65 64 20 61 6e 64  | is recorded and|
00000f70  22 0d 06 36 3a f1 8a 31  33 2c 39 29 22 73 68 6f  |"..6:..13,9)"sho|
00000f80  77 6e 20 69 6e 20 61 20  20 20 66 72 65 71 75 65  |wn in a   freque|
00000f90  6e 63 79 20 74 61 62 6c  65 20 61 6e 64 20 67 72  |ncy table and gr|
00000fa0  61 70 68 69 63 61 6c 6c  79 2e 22 0d 06 40 3e f1  |aphically."..@>.|
00000fb0  8a 31 33 2c 31 30 29 22  46 6f 72 20 65 78 61 6d  |.13,10)"For exam|
00000fc0  70 6c 65 20 69 66 20 61  20 36 20 6f 6e 6c 79 20  |ple if a 6 only |
00000fd0  69 73 20 63 6f 75 6e 74  65 64 20 61 73 20 61 20  |is counted as a |
00000fe0  73 75 63 63 65 73 73 2c  22 0d 06 4a 3e f1 8a 31  |success,"..J>..1|
00000ff0  33 2c 31 31 29 22 74 68  65 20 73 65 71 75 65 6e  |3,11)"the sequen|
00001000  63 65 20 31 20 35 20 33  20 34 20 32 20 32 20 33  |ce 1 5 3 4 2 2 3|
00001010  20 36 20 20 20 77 6f 75  6c 64 20 62 65 20 72 65  | 6   would be re|
00001020  63 6f 72 64 65 64 22 0d  06 54 23 f1 8a 31 33 2c  |corded"..T#..13,|
00001030  31 32 29 22 61 73 20 38  20 74 68 72 6f 77 73 20  |12)"as 8 throws |
00001040  72 65 71 75 69 72 65 64  2e 22 0d 06 5e 42 f1 8a  |required."..^B..|
00001050  31 33 2c 31 33 29 22 41  73 20 74 68 69 73 20 6e  |13,13)"As this n|
00001060  75 6d 62 65 72 20 6d 61  79 20 62 65 20 76 65 72  |umber may be ver|
00001070  79 20 68 69 67 68 2c 20  6f 6e 6c 79 20 74 68 65  |y high, only the|
00001080  20 66 69 72 73 74 20 70  61 72 74 22 0d 06 68 3b  | first part"..h;|
00001090  f1 8a 31 33 2c 31 34 29  22 6f 66 20 74 68 65 20  |..13,14)"of the |
000010a0  74 61 62 6c 65 20 69 73  20 73 68 6f 77 6e 2c 20  |table is shown, |
000010b0  61 6c 6f 6e 67 20 77 69  74 68 20 74 68 65 20 6d  |along with the m|
000010c0  61 78 69 6d 75 6d 22 0d  06 72 1d f1 8a 31 33 2c  |aximum"..r...13,|
000010d0  31 35 29 22 76 61 6c 75  65 20 6f 62 73 65 72 76  |15)"value observ|
000010e0  65 64 2e 22 0d 06 7c 2e  f1 8a 31 33 2c 31 38 29  |ed."..|...13,18)|
000010f0  22 45 6e 74 65 72 20 74  68 65 20 6e 75 6d 62 65  |"Enter the numbe|
00001100  72 20 6f 66 20 27 73 75  63 63 65 73 73 65 73 27  |r of 'successes'|
00001110  3a 22 0d 06 86 05 f5 0d  06 90 14 e8 8a 34 35 2c  |:"...........45,|
00001120  31 38 29 6e 75 6d 73 75  78 73 25 0d 06 9a 3f e7  |18)numsuxs%...?.|
00001130  20 6e 75 6d 73 75 78 73  25 3c 3d 30 20 8c 20 f1  | numsuxs%<=0 . .|
00001140  8a 35 31 2c 31 38 29 22  50 6f 73 69 74 69 76 65  |.51,18)"Positive|
00001150  20 50 6c 65 61 73 65 21  22 3a f1 8a 34 35 2c 31  | Please!":..45,1|
00001160  38 29 22 20 20 20 20 20  20 22 0d 06 a4 10 fd 20  |8)"      "..... |
00001170  6e 75 6d 73 75 78 73 25  3e 30 0d 06 ae 35 e6 30  |numsuxs%>0...5.0|
00001180  3a c8 93 20 c8 90 20 31  38 32 2c 32 36 32 2c 39  |:.. .. 182,262,9|
00001190  31 36 2c 31 31 36 3a e6  33 3a c8 93 20 c8 90 20  |16,116:.3:.. .. |
000011a0  31 39 30 2c 32 37 30 2c  39 30 30 2c 31 30 30 0d  |190,270,900,100.|
000011b0  06 b8 40 f1 8a 31 33 2c  32 31 29 22 53 65 6c 65  |..@..13,21)"Sele|
000011c0  63 74 20 77 68 69 63 68  20 73 63 6f 72 65 64 20  |ct which scored |
000011d0  61 72 65 20 74 6f 20 63  6f 75 6e 74 20 61 73 20  |are to count as |
000011e0  73 75 63 63 65 73 73 65  73 20 3a 79 6f 75 22 0d  |successes :you".|
000011f0  06 c2 27 f1 8a 31 33 2c  32 32 29 22 63 61 6e 20  |..'..13,22)"can |
00001200  68 61 76 65 20 75 70 20  74 6f 20 35 20 6e 75 6d  |have up to 5 num|
00001210  62 65 72 73 3a 22 0d 06  cc 0d f2 77 68 69 63 68  |bers:".....which|
00001220  6e 6f 73 0d 06 d6 05 e1  0d 06 e0 05 3a 0d 06 ea  |nos.........:...|
00001230  05 3a 0d 06 f4 05 3a 0d  06 fe 05 3a 0d 07 08 0d  |.:....:....:....|
00001240  dd f2 6f 70 74 69 6f 6e  33 0d 07 12 12 ea 20 74  |..option3..... t|
00001250  25 2c 70 25 2c 63 6f 75  6e 74 25 0d 07 1c 08 f2  |%,p%,count%.....|
00001260  73 65 74 0d 07 26 15 e3  20 74 25 3d 31 20 b8 20  |set..&.. t%=1 . |
00001270  6e 75 6d 73 75 78 73 25  0d 07 30 0c 63 6f 75 6e  |numsuxs%..0.coun|
00001280  74 25 3d 30 0d 07 3a 05  f5 0d 07 44 0f 73 63 6f  |t%=0..:....D.sco|
00001290  72 65 25 3d b3 28 36 29  0d 07 4e 13 63 6f 75 6e  |re%=.(6)..N.coun|
000012a0  74 25 3d 63 6f 75 6e 74  25 2b 31 0d 07 58 15 fd  |t%=count%+1..X..|
000012b0  20 73 75 78 73 25 28 73  63 6f 72 65 25 29 3d b9  | suxs%(score%)=.|
000012c0  0d 07 62 2b 66 72 65 71  75 65 6e 63 79 25 28 63  |..b+frequency%(c|
000012d0  6f 75 6e 74 25 29 3d 66  72 65 71 75 65 6e 63 79  |ount%)=frequency|
000012e0  25 28 63 6f 75 6e 74 25  29 2b 31 0d 07 6c 08 ed  |%(count%)+1..l..|
000012f0  20 74 25 0d 07 76 0f 6d  61 78 6f 62 73 25 3d 32  | t%..v.maxobs%=2|
00001300  30 30 0d 07 80 05 f5 0d  07 8a 15 6d 61 78 6f 62  |00.........maxob|
00001310  73 25 3d 6d 61 78 6f 62  73 25 2d 31 0d 07 94 1b  |s%=maxobs%-1....|
00001320  fd 66 72 65 71 75 65 6e  63 79 25 28 6d 61 78 6f  |.frequency%(maxo|
00001330  62 73 25 29 3c 3e 30 0d  07 9e 11 78 6d 61 78 25  |bs%)<>0....xmax%|
00001340  3d 6d 61 78 6f 62 73 25  0d 07 a8 22 e7 20 78 6d  |=maxobs%...". xm|
00001350  61 78 25 3c 3d 31 30 20  8c 20 73 74 65 70 25 3d  |ax%<=10 . step%=|
00001360  31 3a 78 6d 61 78 25 3d  31 30 0d 07 b2 2d e7 20  |1:xmax%=10...-. |
00001370  78 6d 61 78 25 3e 31 30  20 80 20 78 6d 61 78 25  |xmax%>10 . xmax%|
00001380  3c 3d 32 30 20 8c 20 73  74 65 70 25 3d 32 3a 78  |<=20 . step%=2:x|
00001390  6d 61 78 25 3d 32 30 0d  07 bc 21 e7 20 78 6d 61  |max%=20...!. xma|
000013a0  78 25 3e 32 30 20 8c 20  73 74 65 70 25 3d 32 3a  |x%>20 . step%=2:|
000013b0  78 6d 61 78 25 3d 32 36  0d 07 c6 0e e3 20 74 25  |xmax%=26..... t%|
000013c0  3d 31 20 b8 20 36 0d 07  d0 1b e7 20 73 75 78 73  |=1 . 6..... suxs|
000013d0  25 28 74 25 29 3d b9 20  8c 20 70 25 3d 70 25 2b  |%(t%)=. . p%=p%+|
000013e0  31 0d 07 da 08 ed 20 74  25 0d 07 e4 0f e3 20 74  |1..... t%..... t|
000013f0  25 3d 31 20 b8 20 32 37  0d 07 ee 2d 74 68 5f 66  |%=1 . 27...-th_f|
00001400  72 65 71 28 74 25 29 3d  70 25 2f 36 2a 28 31 2d  |req(t%)=p%/6*(1-|
00001410  70 25 2f 36 29 5e 28 74  25 2d 31 29 2a 6e 75 6d  |p%/6)^(t%-1)*num|
00001420  73 75 78 73 25 0d 07 f8  08 ed 20 74 25 0d 08 02  |suxs%..... t%...|
00001430  10 74 68 5f 6d 65 61 6e  3d 36 2f 70 25 0d 08 0c  |.th_mean=6/p%...|
00001440  1e 74 76 61 72 69 61 6e  63 65 3d 33 36 2a 28 31  |.tvariance=36*(1|
00001450  2d 70 25 2f 36 29 2f 70  25 5e 32 0d 08 16 05 e1  |-p%/6)/p%^2.....|
00001460  0d 08 20 05 3a 0d 08 2a  05 3a 0d 08 34 05 3a 0d  |.. .:..*.:..4.:.|
00001470  08 3e 05 3a 0d 08 48 09  dd f2 6d 61 78 0d 08 52  |.>.:..H...max..R|
00001480  08 ea 20 74 25 0d 08 5c  17 6d 61 78 66 25 3d 66  |.. t%..\.maxf%=f|
00001490  72 65 71 75 65 6e 63 79  25 28 30 29 0d 08 66 11  |requency%(0)..f.|
000014a0  e3 74 25 3d 31 20 b8 20  78 6d 61 78 25 0d 08 70  |.t%=1 . xmax%..p|
000014b0  31 e7 20 66 72 65 71 75  65 6e 63 79 25 28 74 25  |1. frequency%(t%|
000014c0  29 3e 6d 61 78 66 25 20  8c 20 6d 61 78 66 25 3d  |)>maxf% . maxf%=|
000014d0  66 72 65 71 75 65 6e 63  79 25 28 74 25 29 0d 08  |frequency%(t%)..|
000014e0  7a 08 ed 20 74 25 0d 08  84 05 e1 0d 08 8e 05 3a  |z.. t%.........:|
000014f0  0d 08 98 05 3a 0d 08 a2  05 3a 0d 08 ac 05 3a 0d  |....:....:....:.|
00001500  08 b6 0b dd f2 73 63 61  6c 65 0d 08 c0 08 ea 20  |.....scale..... |
00001510  74 25 0d 08 ca 10 ef 32  39 2c 34 30 30 3b 34 30  |t%.....29,400;40|
00001520  30 3b 0d 08 d4 18 e6 36  3a c8 93 20 c8 90 20 30  |0;.....6:.. .. 0|
00001530  2c 30 2c 38 30 30 2c 36  30 30 0d 08 de 1f e6 30  |,0,800,600.....0|
00001540  3a 86 30 2c 2d 34 2c 30  2c 36 30 30 3a 86 30 2c  |:.0,-4,0,600:.0,|
00001550  2d 34 2c 38 30 30 2c 2d  34 0d 08 e8 48 e7 20 6d  |-4,800,-4...H. m|
00001560  61 78 66 25 3c 31 35 30  20 8c 20 79 6d 61 78 25  |axf%<150 . ymax%|
00001570  3d 31 30 2a 28 6d 61 78  66 25 20 81 20 31 30 29  |=10*(maxf% . 10)|
00001580  2b 31 30 20 8b 20 79 6d  61 78 25 3d 31 30 30 2a  |+10 . ymax%=100*|
00001590  28 6d 61 78 66 25 20 81  20 31 30 30 29 2b 31 30  |(maxf% . 100)+10|
000015a0  30 0d 08 f2 17 75 6e 69  74 78 3d 38 30 30 2f 28  |0....unitx=800/(|
000015b0  78 6d 61 78 25 2b 31 29  0d 08 fc 13 75 6e 69 74  |xmax%+1)....unit|
000015c0  79 3d 36 30 30 2f 79 6d  61 78 25 0d 09 06 06 ef  |y=600/ymax%.....|
000015d0  35 0d 09 10 14 ec 2d 31  37 30 2c 36 30 30 3a f1  |5.....-170,600:.|
000015e0  79 6d 61 78 25 0d 09 1a  16 ec 2d 31 37 30 2c 33  |ymax%.....-170,3|
000015f0  30 30 3a f1 79 6d 61 78  25 2f 32 0d 09 24 0f ec  |00:.ymax%/2..$..|
00001600  2d 31 37 30 2c 32 30 3a  f1 30 0d 09 2e 19 e3 74  |-170,20:.0.....t|
00001610  25 3d 31 20 b8 20 78 6d  61 78 25 20 88 20 73 74  |%=1 . xmax% . st|
00001620  65 70 25 0d 09 38 1d ec  74 25 2a 75 6e 69 74 78  |ep%..8..t%*unitx|
00001630  2d 75 6e 69 74 78 2f 32  2d 31 35 30 2c 2d 31 30  |-unitx/2-150,-10|
00001640  0d 09 42 0f f1 74 25 2d  73 74 61 72 74 25 3b 0d  |..B..t%-start%;.|
00001650  09 4c 08 ed 20 74 25 0d  09 56 05 e1 0d 09 60 05  |.L.. t%..V....`.|
00001660  3a 0d 09 6a 05 3a 0d 09  74 05 3a 0d 09 7e 05 3a  |:..j.:..t.:..~.:|
00001670  0d 09 88 0a dd f2 64 72  61 77 0d 09 92 08 ea 20  |......draw..... |
00001680  74 25 0d 09 9c 18 e3 74  25 3d 31 20 b8 20 78 6d  |t%.....t%=1 . xm|
00001690  61 78 25 2b 73 74 61 72  74 25 0d 09 a6 20 e7 20  |ax%+start%... . |
000016a0  66 72 65 71 75 65 6e 63  79 25 28 74 25 2d 73 74  |frequency%(t%-st|
000016b0  61 72 74 25 29 3c 3e 30  20 8c 0d 09 b0 44 e6 30  |art%)<>0 ....D.0|
000016c0  3a c8 93 20 c8 90 20 28  74 25 2d 31 29 2a 75 6e  |:.. .. (t%-1)*un|
000016d0  69 74 78 2b 36 2c 30 2c  75 6e 69 74 78 2d 31 32  |itx+6,0,unitx-12|
000016e0  2c 66 72 65 71 75 65 6e  63 79 25 28 74 25 2d 73  |,frequency%(t%-s|
000016f0  74 61 72 74 25 29 2a 75  6e 69 74 79 2b 34 0d 09  |tart%)*unity+4..|
00001700  ba 43 e6 32 3a c8 93 20  c8 90 20 28 74 25 2d 31  |.C.2:.. .. (t%-1|
00001710  29 2a 75 6e 69 74 78 2b  31 30 2c 30 2c 75 6e 69  |)*unitx+10,0,uni|
00001720  74 78 2d 32 30 2c 66 72  65 71 75 65 6e 63 79 25  |tx-20,frequency%|
00001730  28 74 25 2d 73 74 61 72  74 25 29 2a 75 6e 69 74  |(t%-start%)*unit|
00001740  79 0d 09 c4 05 cd 0d 09  ce 08 ed 20 74 25 0d 09  |y.......... t%..|
00001750  d8 05 e1 0d 09 e2 05 3a  0d 09 ec 05 3a 0d 09 f6  |.......:....:...|
00001760  05 3a 0d 0a 00 05 3a 0d  0a 0a 0d dd f2 74 68 5f  |.:....:......th_|
00001770  64 72 61 77 0d 0a 14 08  ea 20 74 25 0d 0a 1e 10  |draw..... t%....|
00001780  ef 32 39 2c 34 30 30 3b  34 30 30 3b 0d 0a 28 18  |.29,400;400;..(.|
00001790  e3 74 25 3d 31 20 b8 20  78 6d 61 78 25 2b 73 74  |.t%=1 . xmax%+st|
000017a0  61 72 74 25 0d 0a 32 1e  e7 20 74 68 5f 66 72 65  |art%..2.. th_fre|
000017b0  71 28 74 25 2d 73 74 61  72 74 25 29 3e 30 2e 31  |q(t%-start%)>0.1|
000017c0  20 8c 0d 0a 3c 41 e6 30  3a c8 93 20 c8 90 20 28  | ...<A.0:.. .. (|
000017d0  74 25 2d 31 29 2a 75 6e  69 74 78 2b 36 2c 30 2c  |t%-1)*unitx+6,0,|
000017e0  75 6e 69 74 78 2d 31 32  2c 74 68 5f 66 72 65 71  |unitx-12,th_freq|
000017f0  28 74 25 2d 73 74 61 72  74 25 29 2a 75 6e 69 74  |(t%-start%)*unit|
00001800  79 2b 34 0d 0a 46 40 e6  35 3a c8 93 20 c8 90 20  |y+4..F@.5:.. .. |
00001810  28 74 25 2d 31 29 2a 75  6e 69 74 78 2b 31 30 2c  |(t%-1)*unitx+10,|
00001820  30 2c 75 6e 69 74 78 2d  32 30 2c 74 68 5f 66 72  |0,unitx-20,th_fr|
00001830  65 71 28 74 25 2d 73 74  61 72 74 25 29 2a 75 6e  |eq(t%-start%)*un|
00001840  69 74 79 0d 0a 50 05 cd  0d 0a 5a 08 ed 20 74 25  |ity..P....Z.. t%|
00001850  0d 0a 64 05 e1 0d 0a 6e  05 3a 0d 0a 78 05 3a 0d  |..d....n.:..x.:.|
00001860  0a 82 05 3a 0d 0a 8c 05  3a 0d 0a 96 0c dd f2 66  |...:....:......f|
00001870  74 61 62 6c 65 0d 0a a0  08 ea 20 74 25 0d 0a aa  |table..... t%...|
00001880  0f ef 32 39 2c 30 3b 30  3b 3a ef 34 0d 0a b4 0a  |..29,0;0;:.4....|
00001890  e6 31 33 34 3a da 0d 0a  be 30 e6 30 3a c8 93 20  |.134:....0.0:.. |
000018a0  c8 90 31 30 2c 31 30 2c  31 39 30 2c 31 30 30 30  |..10,10,190,1000|
000018b0  3a e6 32 3a c8 93 20 c8  90 31 34 2c 31 34 2c 31  |:.2:.. ..14,14,1|
000018c0  38 32 2c 39 39 32 0d 0a  c8 1f fb 30 3a fb 31 33  |82,992.....0:.13|
000018d0  30 3a f1 8a 31 2c 31 29  22 46 72 65 71 75 65 6e  |0:..1,1)"Frequen|
000018e0  63 69 65 73 22 0d 0a d2  16 f1 8a 31 2c 32 29 22  |cies"......1,2)"|
000018f0  4e 6f 2e 20 20 46 72 65  71 2e 22 0d 0a dc 18 e3  |No.  Freq.".....|
00001900  74 25 3d 31 2d 73 74 61  72 74 25 20 b8 20 78 6d  |t%=1-start% . xm|
00001910  61 78 25 0d 0a e6 45 f1  8a 31 2c 28 74 25 2b 73  |ax%...E..1,(t%+s|
00001920  74 61 72 74 25 29 2b 32  29 22 20 22 3b 74 25 3b  |tart%)+2)" ";t%;|
00001930  8a 37 2d a9 28 c3 28 66  72 65 71 75 65 6e 63 79  |.7-.(.(frequency|
00001940  25 28 74 25 29 29 29 81  32 29 66 72 65 71 75 65  |%(t%))).2)freque|
00001950  6e 63 79 25 28 74 25 29  0d 0a f0 08 ed 20 74 25  |ncy%(t%)..... t%|
00001960  0d 0a fa 36 e7 20 6f 70  74 69 6f 6e 25 3d 33 20  |...6. option%=3 |
00001970  8c 20 f1 8a 31 2c 78 6d  61 78 25 2b 73 74 61 72  |. ..1,xmax%+star|
00001980  74 25 2b 34 29 22 4d 61  78 20 78 3d 20 22 3b 6d  |t%+4)"Max x= ";m|
00001990  61 78 6f 62 73 25 0d 0b  04 05 e1 0d 0b 0e 05 3a  |axobs%.........:|
000019a0  0d 0b 18 05 3a 0d 0b 22  05 3a 0d 0b 2c 05 3a 0d  |....:..".:..,.:.|
000019b0  0b 36 05 3a 0d 0b 40 0d  dd f2 63 68 6f 69 63 65  |.6.:..@...choice|
000019c0  73 0d 0b 4a 0e ea 20 78  25 2c 79 25 2c 74 25 0d  |s..J.. x%,y%,t%.|
000019d0  0b 54 0e ef 32 39 2c 34  30 30 3b 30 3b 0d 0b 5e  |.T..29,400;0;..^|
000019e0  1b c8 97 20 ee 3a c8 97  20 c8 93 20 30 2c 34 30  |... .:.. .. 0,40|
000019f0  2c 37 35 32 2c 33 30 34  0d 0b 68 1c e6 30 3a c8  |,752,304..h..0:.|
00001a00  93 20 c8 90 20 30 2c 34  30 2c 37 35 32 2c 33 30  |. .. 0,40,752,30|
00001a10  34 3a e6 33 0d 0b 72 0e  e3 20 78 25 3d 30 20 b8  |4:.3..r.. x%=0 .|
00001a20  20 32 0d 0b 7c 0e e3 20  79 25 3d 30 20 b8 20 31  | 2..|.. y%=0 . 1|
00001a30  0d 0b 86 24 c8 93 20 c8  90 20 78 25 2a 32 34 38  |...$.. .. x%*248|
00001a40  2b 38 2c 79 25 2a 31 34  38 2b 34 38 2c 32 34 30  |+8,y%*148+48,240|
00001a50  2c 31 34 30 0d 0b 90 08  ed 20 79 25 0d 0b 9a 09  |,140..... y%....|
00001a60  ed 20 78 25 3a 0d 0b a4  37 e6 30 3a ef 35 3a ec  |. x%:...7.0:.5:.|
00001a70  20 34 30 2c 33 30 30 3a  f1 22 52 65 70 65 61 74  | 40,300:."Repeat|
00001a80  20 57 69 74 68 22 3a ec  20 35 35 2c 32 36 30 3a  | With":. 55,260:|
00001a90  f1 22 53 61 6d 65 20 44  61 74 61 22 0d 0b ae 32  |."Same Data"...2|
00001aa0  ec 20 32 38 38 2c 33 30  30 3a f1 22 52 65 70 65  |. 288,300:."Repe|
00001ab0  61 74 20 57 69 74 68 22  3a ec 20 33 31 30 2c 32  |at With":. 310,2|
00001ac0  36 30 3a f1 22 4e 65 77  20 44 61 74 61 22 0d 0b  |60:."New Data"..|
00001ad0  b8 1b ec 20 35 33 36 2c  32 38 30 3a f1 22 4e 65  |... 536,280:."Ne|
00001ae0  77 20 4f 70 74 69 6f 6e  22 0d 0b c2 0c ec 20 32  |w Option"..... 2|
00001af0  30 2c 31 38 30 0d 0b cc  35 e7 20 74 68 65 6f 72  |0,180...5. theor|
00001b00  79 25 3d a3 20 8c 20 f1  22 4f 62 73 65 72 76 65  |y%=. . ."Observe|
00001b10  64 20 4d 65 61 6e 22 20  8b 20 f1 22 45 78 70 65  |d Mean" . ."Expe|
00001b20  63 74 65 64 20 4d 65 61  6e 22 0d 0b d6 0c ec 20  |cted Mean"..... |
00001b30  32 30 2c 31 31 35 0d 0b  e0 35 e7 20 74 68 65 6f  |20,115...5. theo|
00001b40  72 79 25 3d a3 20 8c 20  f1 22 4f 62 73 2e 20 56  |ry%=. . ."Obs. V|
00001b50  61 72 69 61 6e 63 65 22  20 8b 20 f1 22 45 78 70  |ariance" . ."Exp|
00001b60  2e 20 56 61 72 69 61 6e  63 65 22 0d 0b ea 1b ec  |. Variance".....|
00001b70  20 32 38 35 2c 31 37 35  3a f1 22 20 20 20 53 68  | 285,175:."   Sh|
00001b80  6f 77 20 20 20 22 0d 0b  f4 11 e7 20 74 68 65 6f  |ow   "..... theo|
00001b90  72 79 25 3d a3 20 8c 0d  0b fe 0d ec 20 32 38 35  |ry%=. ...... 285|
00001ba0  2c 31 33 35 0d 0c 08 12  f1 22 54 68 65 6f 72 65  |,135....."Theore|
00001bb0  74 69 63 61 6c 22 0d 0c  12 05 cc 0d 0c 1c 0d ec  |tical"..........|
00001bc0  20 32 38 35 2c 31 33 35  0d 0c 26 13 f1 22 20 20  | 285,135..&.."  |
00001bd0  4f 62 73 65 72 76 65 64  20 20 22 0d 0c 30 05 cd  |Observed  "..0..|
00001be0  0d 0c 3a 1c ec 20 32 38  30 2c 39 35 3a f1 22 44  |..:.. 280,95:."D|
00001bf0  69 73 74 72 69 62 75 74  69 6f 6e 22 0d 0c 44 15  |istribution"..D.|
00001c00  ec 20 35 39 30 2c 31 33  35 3a f1 22 51 75 69 74  |. 590,135:."Quit|
00001c10  22 0d 0c 4e 13 e7 20 6d  65 61 6e 66 6c 61 67 25  |"..N.. meanflag%|
00001c20  3d b9 20 8c 0d 0c 58 11  e7 20 74 68 65 6f 72 79  |=. ...X.. theory|
00001c30  25 3d a3 20 8c 0d 0c 62  34 ec 20 36 30 2c 31 34  |%=. ...b4. 60,14|
00001c40  35 3a f1 20 c0 c3 28 6d  65 61 6e 29 2c 34 29 3a  |5:. ..(mean),4):|
00001c50  ec 20 36 30 2c 38 30 3a  f1 20 c0 c3 28 76 61 72  |. 60,80:. ..(var|
00001c60  69 61 6e 63 65 29 2c 34  29 0d 0c 6c 05 cc 0d 0c  |iance),4)..l....|
00001c70  76 38 ec 20 36 30 2c 31  34 35 3a f1 20 c0 c3 28  |v8. 60,145:. ..(|
00001c80  74 68 5f 6d 65 61 6e 29  2c 34 29 3a ec 20 36 30  |th_mean),4):. 60|
00001c90  2c 38 30 3a f1 20 c0 c3  28 74 76 61 72 69 61 6e  |,80:. ..(tvarian|
00001ca0  63 65 29 2c 34 29 0d 0c  80 05 cd 0d 0c 8a 05 cd  |ce),4)..........|
00001cb0  0d 0c 94 05 e1 0d 0c 9e  05 3a 0d 0c a8 05 3a 0d  |.........:....:.|
00001cc0  0c b2 05 3a 0d 0c bc 05  3a 0d 0c c6 09 dd f2 73  |...:....:......s|
00001cd0  65 74 0d 0c d0 08 ea 20  74 25 0d 0c da 0d 6d 61  |et..... t%....ma|
00001ce0  78 6f 62 73 25 3d 30 0d  0c e4 26 e3 20 74 25 3d  |xobs%=0...&. t%=|
00001cf0  30 20 b8 20 32 30 30 3a  66 72 65 71 75 65 6e 63  |0 . 200:frequenc|
00001d00  79 25 28 74 25 29 3d 30  3a ed 20 74 25 0d 0c ee  |y%(t%)=0:. t%...|
00001d10  05 e1 0d 0c f8 05 3a 0d  0d 02 05 3a 0d 0d 0c 05  |......:....:....|
00001d20  3a 0d 0d 16 05 3a 0d 0d  20 0a dd f2 6d 65 61 6e  |:....:.. ...mean|
00001d30  0d 0d 2a 23 ea 20 73 69  67 6d 61 66 25 2c 73 69  |..*#. sigmaf%,si|
00001d40  67 6d 61 66 78 25 2c 73  69 67 6d 61 66 78 78 25  |gmafx%,sigmafxx%|
00001d50  2c 74 25 0d 0d 34 14 e3  20 74 25 3d 30 20 b8 20  |,t%..4.. t%=0 . |
00001d60  6d 61 78 6f 62 73 25 0d  0d 3e 22 73 69 67 6d 61  |maxobs%..>"sigma|
00001d70  66 25 3d 73 69 67 6d 61  66 25 2b 66 72 65 71 75  |f%=sigmaf%+frequ|
00001d80  65 6e 63 79 25 28 74 25  29 0d 0d 48 27 73 69 67  |ency%(t%)..H'sig|
00001d90  6d 61 66 78 25 3d 73 69  67 6d 61 66 78 25 2b 74  |mafx%=sigmafx%+t|
00001da0  25 2a 66 72 65 71 75 65  6e 63 79 25 28 74 25 29  |%*frequency%(t%)|
00001db0  0d 0d 52 2c 73 69 67 6d  61 66 78 78 25 3d 73 69  |..R,sigmafxx%=si|
00001dc0  67 6d 61 66 78 78 25 2b  74 25 2a 74 25 2a 66 72  |gmafxx%+t%*t%*fr|
00001dd0  65 71 75 65 6e 63 79 25  28 74 25 29 0d 0d 5c 08  |equency%(t%)..\.|
00001de0  ed 20 74 25 0d 0d 66 26  6d 65 61 6e 3d 28 a8 28  |. t%..f&mean=(.(|
00001df0  31 30 30 2a 73 69 67 6d  61 66 78 25 2f 73 69 67  |100*sigmafx%/sig|
00001e00  6d 61 66 25 29 29 2f 31  30 30 0d 0d 70 42 76 61  |maf%))/100..pBva|
00001e10  72 69 61 6e 63 65 3d 28  a8 28 31 30 30 2a 28 73  |riance=(.(100*(s|
00001e20  69 67 6d 61 66 78 78 25  2f 73 69 67 6d 61 66 25  |igmafxx%/sigmaf%|
00001e30  2d 28 73 69 67 6d 61 66  78 25 2f 73 69 67 6d 61  |-(sigmafx%/sigma|
00001e40  66 25 29 5e 32 29 29 29  2f 31 30 30 0d 0d 7a 05  |f%)^2)))/100..z.|
00001e50  e1 0d 0d 84 05 3a 0d 0d  8e 05 3a 0d 0d 98 05 3a  |.....:....:....:|
00001e60  0d 0d a2 05 3a 0d 0d ac  0c dd f2 63 68 6f 6f 73  |....:......choos|
00001e70  65 0d 0d b6 26 ea 20 63  68 6f 73 65 6e 25 2c 62  |e...&. chosen%,b|
00001e80  75 74 74 6f 6e 25 2c 78  25 2c 78 78 25 2c 79 25  |utton%,x%,xx%,y%|
00001e90  2c 79 79 25 2c 74 25 0d  0d c0 0d 63 68 6f 69 63  |,yy%,t%....choic|
00001ea0  65 25 3d 30 0d 0d ca 05  f5 0d 0d d4 05 f5 0d 0d  |e%=0............|
00001eb0  de 1a c8 97 20 78 70 6f  73 25 2c 79 70 6f 73 25  |.... xpos%,ypos%|
00001ec0  2c 62 75 74 74 6f 6e 25  0d 0d e8 10 fd 20 62 75  |,button%..... bu|
00001ed0  74 74 6f 6e 25 3c 3e 30  0d 0d f2 0e e3 20 78 25  |tton%<>0..... x%|
00001ee0  3d 30 20 b8 20 32 0d 0d  fc 0e e3 20 79 25 3d 30  |=0 . 2..... y%=0|
00001ef0  20 b8 20 31 0d 0e 06 4e  e7 20 78 70 6f 73 25 3e  | . 1...N. xpos%>|
00001f00  78 25 2a 32 34 38 2b 38  20 80 20 78 70 6f 73 25  |x%*248+8 . xpos%|
00001f10  3c 78 25 2a 32 34 38 2b  32 34 38 20 80 20 79 70  |<x%*248+248 . yp|
00001f20  6f 73 25 3e 79 25 2a 31  34 38 2b 34 38 20 80 20  |os%>y%*148+48 . |
00001f30  79 70 6f 73 25 3c 79 25  2a 31 34 38 2b 32 38 38  |ypos%<y%*148+288|
00001f40  20 8c 0d 0e 10 0d 63 68  6f 73 65 6e 25 3d b9 0d  | .....chosen%=..|
00001f50  0e 1a 11 79 79 25 3d 79  25 3a 78 78 25 3d 78 25  |...yy%=y%:xx%=x%|
00001f60  0d 0e 24 05 cd 0d 0e 2e  08 ed 20 79 25 0d 0e 38  |..$....... y%..8|
00001f70  08 ed 20 78 25 0d 0e 42  0f fd 20 63 68 6f 73 65  |.. x%..B.. chose|
00001f80  6e 25 3d b9 0d 0e 4c 17  e3 20 74 25 3d 31 20 b8  |n%=...L.. t%=1 .|
00001f90  20 34 30 30 30 30 3a ed  20 74 25 0d 0e 56 2b e7  | 40000:. t%..V+.|
00001fa0  20 79 79 25 3d 30 20 8c  20 63 68 6f 69 63 65 25  | yy%=0 . choice%|
00001fb0  3d 36 2d 78 78 25 20 8b  20 63 68 6f 69 63 65 25  |=6-xx% . choice%|
00001fc0  3d 31 2b 78 78 25 0d 0e  60 05 e1 0d 0e 6a 05 3a  |=1+xx%..`....j.:|
00001fd0  0d 0e 74 05 3a 0d 0e 7e  05 3a 0d 0e 88 05 3a 0d  |..t.:..~.:....:.|
00001fe0  0e 92 0e dd f2 77 68 69  63 68 6e 6f 73 0d 0e 9c  |.....whichnos...|
00001ff0  35 ea 20 78 70 6f 73 25  2c 79 70 6f 73 25 2c 62  |5. xpos%,ypos%,b|
00002000  75 74 74 6f 6e 25 2c 63  68 6f 73 65 6e 25 2c 64  |utton%,chosen%,d|
00002010  6f 6e 65 25 2c 6e 75 6d  63 68 6f 73 65 6e 25 2c  |one%,numchosen%,|
00002020  74 25 0d 0e a6 10 ef 35  3a ef 32 39 2c 37 30 3b  |t%.....5:.29,70;|
00002030  30 3b 0d 0e b0 2a c8 97  20 ee 3a c8 97 20 c8 93  |0;...*.. .:.. ..|
00002040  20 31 32 30 2c 31 33 30  2c 39 31 30 2c 37 30 3a  | 120,130,910,70:|
00002050  c8 97 20 b8 20 39 37 30  2c 31 36 30 0d 0e ba 0e  |.. . 970,160....|
00002060  e3 20 74 25 3d 31 20 b8  20 36 0d 0e c4 0f 73 75  |. t%=1 . 6....su|
00002070  78 73 25 28 74 25 29 3d  a3 0d 0e ce 1c e6 30 3a  |xs%(t%)=......0:|
00002080  c8 93 20 c8 90 20 74 25  2a 31 32 30 2d 34 2c 31  |.. .. t%*120-4,1|
00002090  32 36 2c 37 38 0d 0e d8  1a e6 31 3a c8 93 20 c8  |26,78.....1:.. .|
000020a0  90 20 74 25 2a 31 32 30  2c 31 33 30 2c 37 30 0d  |. t%*120,130,70.|
000020b0  0e e2 1e ec 20 32 38 2b  74 25 2a 31 32 30 2c 31  |.... 28+t%*120,1|
000020c0  37 37 3a e6 30 3a f1 20  c3 28 74 25 29 0d 0e ec  |77:.0:. .(t%)...|
000020d0  08 ed 20 74 25 0d 0e f6  1b e6 30 3a c8 93 20 c8  |.. t%.....0:.. .|
000020e0  90 20 39 30 36 2c 31 32  36 2c 31 32 38 2c 37 38  |. 906,126,128,78|
000020f0  0d 0f 00 1b e6 33 3a c8  93 20 c8 90 20 39 31 30  |.....3:.. .. 910|
00002100  2c 31 33 30 2c 31 32 30  2c 37 30 0d 0f 0a 18 e6  |,130,120,70.....|
00002110  30 3a ec 20 39 34 30 2c  31 37 37 3a f1 22 44 4f  |0:. 940,177:."DO|
00002120  4e 45 22 0d 0f 14 05 f5  0d 0f 1e 05 f5 0d 0f 28  |NE"............(|
00002130  1a c8 97 20 78 70 6f 73  25 2c 79 70 6f 73 25 2c  |... xpos%,ypos%,|
00002140  62 75 74 74 6f 6e 25 0d  0f 32 10 fd 20 62 75 74  |button%..2.. but|
00002150  74 6f 6e 25 3c 3e 30 0d  0f 3c 0e e3 20 74 25 3d  |ton%<>0..<.. t%=|
00002160  31 20 b8 20 36 0d 0f 46  6e e7 20 78 70 6f 73 25  |1 . 6..Fn. xpos%|
00002170  3e 31 32 30 2a 74 25 20  80 20 78 70 6f 73 25 3c  |>120*t% . xpos%<|
00002180  31 32 30 2a 74 25 2b 37  30 20 8c 20 73 75 78 73  |120*t%+70 . suxs|
00002190  25 28 74 25 29 3d b9 3a  e6 32 3a c8 93 20 c8 90  |%(t%)=.:.2:.. ..|
000021a0  20 74 25 2a 31 32 30 2c  31 33 30 2c 37 30 3a e6  | t%*120,130,70:.|
000021b0  30 3a ec 20 32 38 2b 74  25 2a 31 32 30 2c 31 37  |0:. 28+t%*120,17|
000021c0  37 3a f1 20 c3 28 74 25  29 3a 63 68 6f 73 65 6e  |7:. .(t%):chosen|
000021d0  25 3d b9 0d 0f 50 08 ed  20 74 25 0d 0f 5a 10 6e  |%=...P.. t%..Z.n|
000021e0  75 6d 63 68 6f 73 65 6e  25 3d 30 0d 0f 64 0e e3  |umchosen%=0..d..|
000021f0  20 74 25 3d 31 20 b8 20  36 0d 0f 6e 2b e7 20 73  | t%=1 . 6..n+. s|
00002200  75 78 73 25 28 74 25 29  3d b9 20 8c 20 6e 75 6d  |uxs%(t%)=. . num|
00002210  63 68 6f 73 65 6e 25 3d  6e 75 6d 63 68 6f 73 65  |chosen%=numchose|
00002220  6e 25 2b 31 0d 0f 78 08  ed 20 74 25 0d 0f 82 1c  |n%+1..x.. t%....|
00002230  e7 20 6e 75 6d 63 68 6f  73 65 6e 25 3d 35 20 8c  |. numchosen%=5 .|
00002240  20 64 6f 6e 65 25 3d b9  0d 0f 8c 26 e7 20 78 70  | done%=....&. xp|
00002250  6f 73 25 3e 39 32 30 20  80 20 63 68 6f 73 65 6e  |os%>920 . chosen|
00002260  25 3d b9 20 20 8c 20 64  6f 6e 65 25 3d b9 0d 0f  |%=.  . done%=...|
00002270  96 19 fd 20 63 68 6f 73  65 6e 25 3d b9 20 80 20  |... chosen%=. . |
00002280  64 6f 6e 65 25 3d b9 0d  0f a0 06 ef 34 0d 0f aa  |done%=......4...|
00002290  17 e3 20 74 25 3d 31 20  b8 20 38 30 30 30 30 3a  |.. t%=1 . 80000:|
000022a0  ed 20 74 25 0d 0f b4 05  e1 0d 0f be 05 3a 0d 0f  |. t%.........:..|
000022b0  c8 05 3a 0d 0f d2 05 3a  0d 0f dc 05 3a 0d 0f e6  |..:....:....:...|
000022c0  0d dd f2 6f 70 74 69 6f  6e 73 0d 0f f0 0c ef 32  |...options.....2|
000022d0  39 2c 30 3b 30 3b 0d 0f  fa 09 ef 20 34 3a 87 0d  |9,0;0;..... 4:..|
000022e0  10 04 12 e6 31 33 34 3a  da 3a fb 30 3a fb 31 33  |....134:.:.0:.13|
000022f0  31 0d 10 0e 1e c8 97 20  ee 3a c8 97 20 c8 93 20  |1...... .:.. .. |
00002300  31 39 30 2c 31 37 30 2c  39 30 30 2c 36 35 30 0d  |190,170,900,650.|
00002310  10 18 34 e6 30 3a c8 93  20 c8 90 20 31 38 32 2c  |..4.0:.. .. 182,|
00002320  31 36 32 2c 39 31 36 2c  38 36 3a e6 33 3a c8 93  |162,916,86:.3:..|
00002330  20 c8 90 20 31 39 30 2c  31 37 30 2c 39 30 30 2c  | .. 190,170,900,|
00002340  37 30 3a 0d 10 22 36 e6  30 3a c8 93 20 c8 90 20  |70:.."6.0:.. .. |
00002350  31 38 32 2c 32 36 32 2c  39 31 36 2c 31 34 36 3a  |182,262,916,146:|
00002360  e6 33 3a c8 93 20 c8 90  20 31 39 30 2c 32 37 30  |.3:.. .. 190,270|
00002370  2c 39 30 30 2c 31 33 30  3a 0d 10 2c 36 e6 30 3a  |,900,130:..,6.0:|
00002380  c8 93 20 c8 90 20 31 38  32 2c 34 32 32 2c 39 31  |.. .. 182,422,91|
00002390  36 2c 32 34 36 3a e6 33  3a c8 93 20 c8 90 20 31  |6,246:.3:.. .. 1|
000023a0  39 30 2c 34 33 30 2c 39  30 30 2c 32 33 30 3a 0d  |90,430,900,230:.|
000023b0  10 36 36 e6 30 3a c8 93  20 c8 90 20 31 38 32 2c  |.66.0:.. .. 182,|
000023c0  36 38 32 2c 39 31 36 2c  31 34 36 3a e6 33 3a c8  |682,916,146:.3:.|
000023d0  93 20 c8 90 20 31 39 30  2c 36 39 30 2c 39 30 30  |. .. 190,690,900|
000023e0  2c 31 33 30 3a 0d 10 40  35 e6 30 3a c8 93 20 c8  |,130:..@5.0:.. .|
000023f0  90 20 31 38 32 2c 38 34  32 2c 39 31 36 2c 31 30  |. 182,842,916,10|
00002400  36 3a e6 33 3a c8 93 20  c8 90 20 31 39 30 2c 38  |6:.3:.. .. 190,8|
00002410  35 30 2c 39 30 30 2c 39  30 3a 0d 10 4a 3f f1 8a  |50,900,90:..J?..|
00002420  31 33 2c 33 29 22 55 73  65 20 74 68 65 20 6d 6f  |13,3)"Use the mo|
00002430  75 73 65 20 74 6f 20 73  65 6c 65 63 74 20 61 6e  |use to select an|
00002440  20 6f 70 74 69 6f 6e 2e  20 43 6c 69 63 6b 20 61  | option. Click a|
00002450  6e 79 20 6d 6f 75 73 65  22 0d 10 54 1f f1 8a 31  |ny mouse"..T...1|
00002460  33 2c 34 29 22 62 75 74  74 6f 6e 20 74 6f 20 70  |3,4)"button to p|
00002470  72 6f 63 65 65 64 2e 22  0d 10 5e 21 f1 8a 32 39  |roceed."..^!..29|
00002480  2c 37 29 22 55 4e 49 46  4f 52 4d 20 44 49 53 54  |,7)"UNIFORM DIST|
00002490  52 49 42 55 54 49 4f 4e  22 0d 10 68 42 f1 8a 31  |RIBUTION"..hB..1|
000024a0  33 2c 38 29 22 41 20 73  69 6e 67 6c 65 20 64 69  |3,8)"A single di|
000024b0  65 20 69 73 20 74 68 72  6f 77 6e 20 72 65 70 65  |e is thrown repe|
000024c0  61 74 65 64 6c 79 2c 20  74 68 65 20 72 65 73 75  |atedly, the resu|
000024d0  6c 74 20 6f 66 20 65 61  63 68 22 0d 10 72 22 f1  |lt of each"..r".|
000024e0  8a 31 33 2c 39 29 22 74  68 72 6f 77 20 62 65 69  |.13,9)"throw bei|
000024f0  6e 67 20 72 65 63 6f 72  64 65 64 2e 22 0d 10 7c  |ng recorded."..||
00002500  23 f1 8a 32 39 2c 31 32  29 22 42 49 4e 4f 4d 49  |#..29,12)"BINOMI|
00002510  41 4c 20 44 49 53 54 52  49 42 55 54 49 4f 4e 22  |AL DISTRIBUTION"|
00002520  0d 10 86 41 f1 8a 31 33  2c 31 33 29 22 41 20 6e  |...A..13,13)"A n|
00002530  75 6d 62 65 72 20 6f 66  20 64 69 63 65 20 28 6e  |umber of dice (n|
00002540  29 20 61 72 65 20 74 68  72 6f 77 6e 20 74 6f 67  |) are thrown tog|
00002550  65 74 68 65 72 20 65 61  63 68 20 74 68 72 6f 77  |ether each throw|
00002560  22 0d 10 90 23 f1 8a 31  33 2c 31 34 29 22 62 65  |"...#..13,14)"be|
00002570  69 6e 67 20 63 61 6c 6c  65 64 20 61 20 54 52 49  |ing called a TRI|
00002580  41 4c 2e 22 0d 10 9a 3a  f1 8a 31 33 2c 31 35 29  |AL."...:..13,15)|
00002590  22 46 6f 72 20 65 61 63  68 20 64 69 65 2c 75 70  |"For each die,up|
000025a0  20 74 6f 20 35 20 6e 75  6d 62 65 72 73 20 63 61  | to 5 numbers ca|
000025b0  6e 20 63 6f 75 6e 74 20  61 73 20 61 20 22 0d 10  |n count as a "..|
000025c0  a4 44 f1 8a 31 33 2c 31  36 29 22 53 55 43 43 45  |.D..13,16)"SUCCE|
000025d0  53 53 2c 20 65 2e 67 2e  20 61 20 36 20 28 70 3d  |SS, e.g. a 6 (p=|
000025e0  31 2f 36 29 2c 20 61 6e  20 65 76 65 6e 20 6e 75  |1/6), an even nu|
000025f0  6d 62 65 72 20 28 70 3d  31 2f 32 29 20 65 74 63  |mber (p=1/2) etc|
00002600  2e 22 0d 10 ae 3c f1 8a  31 33 2c 31 37 29 22 54  |."...<..13,17)"T|
00002610  68 65 20 6e 75 6d 62 65  72 20 6f 66 20 73 75 63  |he number of suc|
00002620  63 65 73 73 65 73 20 70  65 72 20 74 72 69 61 6c  |cesses per trial|
00002630  20 69 73 20 72 65 63 6f  72 64 65 64 2e 22 0d 10  | is recorded."..|
00002640  b8 24 f1 8a 32 39 2c 32  30 29 22 47 45 4f 4d 45  |.$..29,20)"GEOME|
00002650  54 52 49 43 20 44 49 53  54 52 49 42 55 54 49 4f  |TRIC DISTRIBUTIO|
00002660  4e 22 0d 10 c2 42 f1 8a  31 33 2c 32 31 29 22 41  |N"...B..13,21)"A|
00002670  20 73 69 6e 67 6c 65 20  64 69 65 20 69 73 20 74  | single die is t|
00002680  68 72 6f 77 6e 2c 20 74  68 65 20 6e 75 6d 62 65  |hrown, the numbe|
00002690  72 20 6f 66 20 74 68 72  6f 77 73 20 62 65 74 77  |r of throws betw|
000026a0  65 65 6e 22 0d 10 cc 2f  f1 8a 31 33 2c 32 32 29  |een".../..13,22)|
000026b0  22 63 6f 6e 73 65 63 75  74 69 76 65 20 73 75 63  |"consecutive suc|
000026c0  63 65 73 73 65 73 20 69  73 20 63 6f 75 6e 74 65  |cesses is counte|
000026d0  64 2e 22 0d 10 d6 12 f1  8a 33 38 2c 32 35 29 22  |d."......38,25)"|
000026e0  51 55 49 54 22 0d 10 e0  05 e1 0d 10 ea 05 3a 0d  |QUIT".........:.|
000026f0  10 f4 05 3a 0d 10 fe 05  3a 0d 11 08 05 3a 0d 11  |...:....:....:..|
00002700  12 0f dd f2 67 65 74 6f  70 74 69 6f 6e 0d 11 1c  |....getoption...|
00002710  21 ea 20 78 70 6f 73 25  2c 79 70 6f 73 25 2c 62  |!. xpos%,ypos%,b|
00002720  75 74 74 6f 6e 25 2c 63  68 6f 73 65 6e 25 0d 11  |utton%,chosen%..|
00002730  26 05 f5 0d 11 30 05 f5  0d 11 3a 1a c8 97 20 78  |&....0....:... x|
00002740  70 6f 73 25 2c 79 70 6f  73 25 2c 62 75 74 74 6f  |pos%,ypos%,butto|
00002750  6e 25 0d 11 44 10 fd 20  62 75 74 74 6f 6e 25 3c  |n%..D.. button%<|
00002760  3e 30 0d 11 4e 31 e7 20  79 70 6f 73 25 3e 31 37  |>0..N1. ypos%>17|
00002770  30 20 80 20 79 70 6f 73  25 3c 32 34 30 20 8c 20  |0 . ypos%<240 . |
00002780  6f 70 74 69 6f 6e 25 3d  34 3a 63 68 6f 73 65 6e  |option%=4:chosen|
00002790  25 3d b9 0d 11 58 31 e7  20 79 70 6f 73 25 3e 32  |%=...X1. ypos%>2|
000027a0  37 30 20 80 20 79 70 6f  73 25 3c 34 30 30 20 8c  |70 . ypos%<400 .|
000027b0  20 6f 70 74 69 6f 6e 25  3d 33 3a 63 68 6f 73 65  | option%=3:chose|
000027c0  6e 25 3d b9 0d 11 62 31  e7 20 79 70 6f 73 25 3e  |n%=...b1. ypos%>|
000027d0  34 33 30 20 80 20 79 70  6f 73 25 3c 36 36 30 20  |430 . ypos%<660 |
000027e0  8c 20 6f 70 74 69 6f 6e  25 3d 32 3a 63 68 6f 73  |. option%=2:chos|
000027f0  65 6e 25 3d b9 0d 11 6c  31 e7 20 79 70 6f 73 25  |en%=...l1. ypos%|
00002800  3e 36 39 30 20 80 20 79  70 6f 73 25 3c 38 32 30  |>690 . ypos%<820|
00002810  20 8c 20 6f 70 74 69 6f  6e 25 3d 31 3a 63 68 6f  | . option%=1:cho|
00002820  73 65 6e 25 3d b9 0d 11  76 0f fd 20 63 68 6f 73  |sen%=...v.. chos|
00002830  65 6e 25 3d b9 0d 11 80  0b 64 61 74 61 25 3d b9  |en%=.....data%=.|
00002840  0d 11 8a 05 e1 0d 11 94  05 3a 0d 11 9e 05 3a 0d  |.........:....:.|
00002850  11 a8 05 3a 0d 11 b2 05  3a 0d 11 bc 0c dd f2 74  |...:....:......t|
00002860  68 65 6f 72 79 0d 11 c6  08 ea 20 74 25 0d 11 d0  |heory..... t%...|
00002870  0c ef 32 39 2c 30 3b 30  3b 0d 11 da 33 e6 30 3a  |..29,0;0;...3.0:|
00002880  c8 93 20 c8 90 20 32 31  30 2c 31 30 2c 31 30 30  |.. .. 210,10,100|
00002890  2c 31 30 30 30 3a e6 35  3a c8 93 20 c8 90 20 32  |,1000:.5:.. .. 2|
000028a0  31 34 2c 31 34 2c 39 32  2c 39 39 32 0d 11 e4 0e  |14,14,92,992....|
000028b0  ef 34 3a fb 30 3a fb 31  33 33 0d 11 ee 11 f1 8a  |.4:.0:.133......|
000028c0  31 34 2c 31 29 22 45 78  70 2e 22 0d 11 f8 12 f1  |14,1)"Exp.".....|
000028d0  8a 31 34 2c 32 29 22 66  72 65 71 2e 22 0d 12 02  |.14,2)"freq."...|
000028e0  19 e3 20 74 25 3d 31 2d  73 74 61 72 74 25 20 b8  |.. t%=1-start% .|
000028f0  20 78 6d 61 78 25 0d 12  0c 83 f1 8a 31 36 2d a9  | xmax%......16-.|
00002900  28 c3 28 a8 28 74 68 5f  66 72 65 71 28 74 25 29  |(.(.(th_freq(t%)|
00002910  29 2b a8 28 32 2a 28 74  68 5f 66 72 65 71 28 74  |)+.(2*(th_freq(t|
00002920  25 29 2d a8 28 74 68 5f  66 72 65 71 28 74 25 29  |%)-.(th_freq(t%)|
00002930  29 29 29 29 29 81 32 2c  28 74 25 2b 73 74 61 72  |))))).2,(t%+star|
00002940  74 25 29 2b 32 29 c3 28  a8 28 74 68 5f 66 72 65  |t%)+2).(.(th_fre|
00002950  71 28 74 25 29 29 2b a8  28 32 2a 28 74 68 5f 66  |q(t%))+.(2*(th_f|
00002960  72 65 71 28 74 25 29 2d  a8 28 74 68 5f 66 72 65  |req(t%)-.(th_fre|
00002970  71 28 74 25 29 29 29 29  29 0d 12 16 08 ed 20 74  |q(t%)))))..... t|
00002980  25 0d 12 20 05 e1 0d 12  2a 05 3a 0d 12 34 05 3a  |%.. ....*.:..4.:|
00002990  0d 12 3e 05 3a 0d 12 48  05 3a 0d 12 52 0f dd f2  |..>.:..H.:..R...|
000029a0  66 61 63 74 6f 72 69 61  6c 0d 12 5c 08 ea 20 74  |factorial..\.. t|
000029b0  25 0d 12 66 12 66 61 63  74 6f 72 69 61 6c 28 30  |%..f.factorial(0|
000029c0  29 3d 31 0d 12 70 12 66  61 63 74 6f 72 69 61 6c  |)=1..p.factorial|
000029d0  28 31 29 3d 31 0d 12 7a  0f e3 20 74 25 3d 32 20  |(1)=1..z.. t%=2 |
000029e0  b8 20 33 30 0d 12 84 24  66 61 63 74 6f 72 69 61  |. 30...$factoria|
000029f0  6c 28 74 25 29 3d 74 25  2a 66 61 63 74 6f 72 69  |l(t%)=t%*factori|
00002a00  61 6c 28 74 25 2d 31 29  0d 12 8e 08 ed 20 74 25  |al(t%-1)..... t%|
00002a10  0d 12 98 05 e1 0d 12 a2  05 3a 0d 12 ac 05 3a 0d  |.........:....:.|
00002a20  12 b6 05 3a 0d 12 c0 05  3a 0d 12 ca 11 dd f2 74  |...:....:......t|
00002a30  68 65 6f 72 65 74 69 63  61 6c 0d 12 d4 0b f2 74  |heoretical.....t|
00002a40  68 65 6f 72 79 0d 12 de  0a f2 73 63 61 6c 65 0d  |heory.....scale.|
00002a50  12 e8 22 e7 20 74 68 65  6f 72 79 25 3d a3 20 8c  |..". theory%=. .|
00002a60  20 f2 74 68 5f 64 72 61  77 20 8b 20 f2 64 72 61  | .th_draw . .dra|
00002a70  77 0d 12 f2 14 74 68 65  6f 72 79 25 3d ac 74 68  |w....theory%=.th|
00002a80  65 6f 72 79 25 0d 12 fc  05 e1 0d 13 06 05 3a 0d  |eory%.........:.|
00002a90  13 10 05 3a 0d 13 1a 05  3a 0d 13 24 05 3a 0d 13  |...:....:..$.:..|
00002aa0  2e 0b dd f2 65 72 72 6f  72 0d 13 38 0c e7 20 9f  |....error..8.. .|
00002ab0  3d 31 37 20 8c 0d 13 42  0c 2a 64 65 73 6b 74 6f  |=17 ...B.*deskto|
00002ac0  70 0d 13 4c 05 cc 0d 13  56 05 db 0d 13 60 05 f6  |p..L....V....`..|
00002ad0  0d 13 6a 06 f1 9e 0d 13  74 05 cd 0d 13 7e 05 e1  |..j.....t....~..|
00002ae0  0d ff                                             |..|
00002ae2