ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
723 B

  1. 10 PRINT "CHI-SQUARE DISTRIBUTION"
  2. 20 PRINT
  3. 30 PRINT "(TO END PROGRAM ENTER 0)"
  4. 40 PRINT "DEGREES OF FREEDOM";
  5. 50 INPUT V
  6. 60 IF V=0 THEN 280
  7. 70 PRINT "CHI-SQUARE";
  8. 80 INPUT W
  9. 89 REM -R=THE DENOMINATOR PRODUCT
  10. 90 R=1
  11. 100 FOR I=V TO 2 STEP -2
  12. 110 R=R*I
  13. 120 NEXT I
  14. 129 REM - K=THE NUMBERATOR PRODUCT
  15. 130 K=W[(INT((V+1)/2))*EXP(-W/2)/R
  16. 139 REM - THE PI FACTOR IS USED ONLY WHEN DEG. FREEDOM ARE ODD
  17. 140 IF INT(V/2)=V/2 THEN 170
  18. 150 J=SQR(2/W/3.141592653599)
  19. 160 GOTO 180
  20. 169 REM - L (SUMMATION FACTOR) CALCULATED LINES 170-240
  21. 170 J=1
  22. 180 L=1
  23. 190 M=1
  24. 200 V=V+2
  25. 210 M=M*W/V
  26. 219 REM - CHECK FOR END OF SUMMATION
  27. 220 IF M<.0000001 THEN 250
  28. 230 L=L+M
  29. 240 GOTO 200
  30. 250 PRINT "TAIL END VALUE =";1-J*K*L
  31. 260 PRINT
  32. 270 GOTO 40
  33. 280 END