Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50110/prbsta.sta
There are 2 other files named prbsta.sta in the archive. Click here to see a list.
100'  NAME--PRBSTA
110'
120'  DESCRIPTION--COMPUTES THE PROBABILITIES OF TEN STATEMENTS AND
130'  THEIR DENIALS GIVEN THE PROBABILITIES OF ANY THREE.
140'  
150'  SOURCE--UNKNOWN
160'
170'  INSTRUCTIONS--TYPE "RUN" AND FOLLOW THE INSTRUCTIONS.
180'
190'
200'  *  *  *  *  *  *  *   MAIN PROGRAM   *  *  *  *  *  *  *  *  *
210'
220 PRINT "STATEMENT      DENIAL"
230 PRINT "S1 P(A/X)       S11 P(-A/X)"
240 PRINT "S2 P(B/X)       S12 P(-B/X)"
250 PRINT "S3 P(AB/X)      S13 P(-A+-B/X)"
260 PRINT "S4 P(A+B/X)     S14 P(-A-B/X)"
270 PRINT "S5 P(A-B/X)     S15 P(-A+B/X)"
280 PRINT "S6 P(A+-B/X)    S16 P(-AB/X)"
290 PRINT "S7 P(A/BX)      S17 P(-A/BX)"
300 PRINT "S8 P(B/AX)      S18 P(-B/AX)"
310 PRINT"S9 P(A/-BX)     S19 P(-A/-BX)"
320 PRINT"S10P(B/-AX)     S20P(-B/-AX)"
330 PRINT
340 PRINT "-A IS DENIAL OF A"
350 PRINT
360 PRINT "THIS PROGRAM WILL COMPUTE EACH OF THE ABOVE PROBABILITIES"
370 PRINT "GIVEN THREE OF THEM.  WHEN I TYPE (?) YOU TYPE THE"
380 PRINT "NUMBERS OF THE THREE STATEMENTS YOU KNOW (EG IF YOU KNOW"
390 PRINT "P(A/X), THEN TYPE 1)"
400 INPUT S(1),S(2),S(3)
410 PRINT "INPUT THE KNOWN VALUES TO"S(1);S(2);S(3)
420 INPUT V(1),V(2),V(3)
430 FOR T=1 TO 3
440 IF S(T)<11 THEN 470
450 LET V(T)=1-V(T)
460 LET S(T)=S(T)-10
470 ON S(T) GOTO 480,510,540,570,600,630,660,690,720,750
480 LET A=V(T)
490 LET A1=1
500 GO TO 770
510 LET B=V(T)
520 LET B1=1
530 GO TO 770
540 LET C=V(T)
550 LET C1=1
560 GO TO 770
570 LET D=V(T)
580 LET D1=1
590 GO TO 770
600 LET E=V(T)
610 LET E1=1
620 GO TO 770
630 LET F=V(T)
640 LET F1=1
650 GO TO 770
660 LET G=V(T)
670 LET G1=1
680 GO TO 770
690 LET H=V(T)
700 LET H1=1
710 GO TO 770
720 LET I=V(T)
730 LET I1=1
740 GO TO 770
750 LET J=V(T)
760 LET J1=1
770 NEXT T
780 IF A1=1 THEN 930
790 IF C1*H1<1 THEN 820
800 LET A=C/H
810 GO TO 920
820 IF E1*H1<1 THEN 850
830 LET A=E/(1-H)
840 GO TO 920
850 IF J1*F1<1 THEN 880
860 LET A=(J-1+F)/J
870 GO TO 920
880 IF B1*C1*D1<1 THEN 900
890 LET A=-B+C+D
900 IF B1*E1*F1<1 THEN 930
910 LET A=B+E+F-1
920 LET A1=1
930 IF B1=1 THEN 1060
940 IF C1*G1<1 THEN 970
950 LET B=C/G
960 GO TO 1050
970 IF E1*I1<1 THEN 1000
980 LET B=E/I
990 GO TO 1050
1000 IF A1*C1*D1<1 THEN 1030
1010 LET B=C+D-A
1020 GO TO 1050
1030 IF A1*E1*F1<1 THEN 1060
1040 LET B=A-E-F+1
1050 LET B1=1
1060 IF C1=1 THEN 1160
1070 IF B1*G1<1 THEN 1100
1080 LET C=B*G
1090 GO TO 1150
1100 IF A1*H1<1 THEN 1130
1110 LET C=A*H
1120 GO TO 1150
1130 IF A1*B1*D1<1 THEN 1160
1140 LET C=A+B-D
1150 LET C1=1
1160 IF D1=1 THEN 1200
1170 IF A1*B1*C1<1 THEN 1200
1180 LET D=A+B-C
1190 LET D1=1
1200 IF E1=1 THEN 1300
1210 IF A1*H1<1 THEN 1240
1220 LET E=A*(1-H)
1230 GO TO 1290
1240 IF B1*I1<1 THEN 1270
1250 LET E=B*I
1260 GO TO 1290
1270 IF A1*B1*F1<1 THEN 1300
1280 LET E=A-B-F+1
1290 LET E1=1
1300 IF F1=1 THEN 1370
1310 IF A1*J1<1 THEN 1340
1320 LET F=1-J*(1-A)
1330 GO TO 1360
1340 IF A1*B1*E1<1 THEN 1370
1350 LET F=A-B-E+1
1360 LET F1=1
1370 IF G1=1 THEN 1410
1380 IF B1*C1<1 THEN 1410
1390 LET G=C/B
1400 LET G1=1
1410 IF H1=1 THEN 1480
1420 IF A1*C1<1 THEN 1450
1430 LET H=C/A
1440 GO TO 1470
1450 IF A1*E1<1 THEN 1480
1460 LET H=1-(E/A)
1470 LET H1=1
1480 IF I1=1 THEN 1520
1490 IF B1*E1<1 THEN 1520
1500 LET I=E/B
1510 LET I1=1
1520 IF J1=1 THEN 1560
1530 IF A1*F1<1 THEN 1560
1540 LET J=(1-F)/(1-A)
1550 LET J1=1
1560 LET Y=Y+1
1570 IF Y=25 THEN 1870
1580 LET L=A1*B1*C1*D1
1590 LET L=L*E1*F1*G1*H1*I1*J1
1600 IF L<1 THEN 780
1610 PRINT
1620 PRINT "RESULTS:"
1630 PRINT
1640 PRINT
1650 LET A2=1-A
1660 LET B2=1-B
1670 LET C2=1-C
1680 LET D2=1-D
1690 LET E2=1-E
1700 LET F2=1-F
1710 LET G2=1-G
1720 LET H2=1-H
1730 LET I2=1-I
1740 LET J2=1-J
1750 PRINT "STATEMENT    P(STATEMENT)    P(DENIAL)"
1760 PRINT "1",A,A2
1770 PRINT "2",B,B2
1780 PRINT "3",C,C2
1790 PRINT "4",D,D2
1800 PRINT "5",E,E2
1810 PRINT "6",F,F2
1820 PRINT "7",G,G2
1830 PRINT "8",H,H2
1840 PRINT "9",I,I2
1850 PRINT "10",J,J2
1860 GO TO 1880
1870 PRINT "GIVEN PROBABILITIES ARE INSUFFICIENT TO DETERMINE PROBLEM"
1880 END