1 REM VALADINF
5 CLEAR 1000
10 CLS:PRINT TAB(10);"VALUE OF ADDITIONAL SAMPLE INFORMATIOM":PRINT
20 PRINT"IN SITUATIONS WHERE SAMPLING IS DONE IT IS GENERALLY ASSUMED
25 PRINT"THAT LARGER SAMPLES PROVIDE MORE INFORMATION ABOUT THE TRUE
30 PRINT"SITUATION THAN DO SMALLER SAMPLES. THE ADDITIONAL INFORMATION
35 PRINT"WHICH THE LARGER SAMPLE SIZE BRINGS COULD BE COMPUTED IF
40 PRINT"WE COULD SOMEHOW MEASURE THE UNCERTAINTY IN THE INFORMATION
45 PRINT"BOTH BEFORE AND AFTER TAKING THE SAMPLE. SUCH A MEASURE
50 PRINT"OF UNCERTAINTY EXISTS AND IS SOMETIMES CALLED SHANNON 
55 PRINT"INFORMATION. THIS PROGRAM GIVES BOUNDS ON THE UNCERTAINTY
60 PRINT"WHEN THE SAMPLING IS COMING FROM A NORMAL DISTRIBUTION WITH
65 PRINT"BOUNDED VARIANCE.
67 PRINT:GOSUB 10100:CLS
70 PRINT"NECESSARY INPUT INCLUDES AN UPPER BOUND ON THE VARIANCE
75 PRINT"OF THE DISTRIBUTION, THE NUMBER OF OBSERVATIONS IN THE
80 PRINT"INITIAL SAMPLE AND THE ADDITIONAL NUMBER OF OBSERVATIONS IN 
85 PRINT"THE FINAL SAMPLE.
90 PRINT:INPUT"PRESS ENTER TO BEGIN";Z9$
100 CLS
110 INPUT"DO YOU HAVE BOUND FOR VARIANCE(V) OR STANDARD DEVIATION(S)";Z1$
120 IF Z1$<>"S" AND Z1$<>"V" THEN GOSUB 10000:PRINT:GOTO 110
130 IF Z1$="S" THEN INPUT"ENTER STANDARD DEVIATION UPPER BOUND";S:V=S[2
140 IF Z1$="V" THEN INPUT"ENTER VARIANCE UPPER BOUND         ";V:S=SQR(V)
150 PRINT
155 INPUT"INITIAL SAMPLE SIZE ";NI
160 INPUT"ADDITIONAL SAMPLE SIZE";NA
170 H(1)=LOG(S/SQR(NI))+2.94:H(2)=LOG(S/SQR(NA+NI))+2.94
200 PRINT"INITIAL UNCERTAINTY WAS ";H(1)
210 PRINT"FINAL UNCERTAINTY WAS   ";H(2)
220 PRINT"THIS REPRESENTS A CHANGE OF";H(1)-H(2);"UNCERTAINTY UNITS
230 PRINT"AND IS A CHANGE OF ABOUT"; (H(1)-H(2))/H(1)*100;"%"
240 PRINT:INPUT"PRESS ENTER FOR MORE";Z9$
245 IF Z9$ = "-1" THEN END
250 GOTO 100
10000 PRINT"INPUT ERROR! TRY AGAIN!":FOR JJ=1TO300:NEXT:RETURN
10100 INPUT"PRESS ENTER TO CONTINUE";Z9$:RETURN
