Category : Miscellaneous Language Source Code
Archive   : FORTRN77.ZIP
Filename : STBNPB.FOR

 
Output of file : STBNPB.FOR contained in archive : FORTRN77.ZIP
SUBROUTINE STBNPB(N,P,M,P1)
C
C BINOMIAL PROBABILITY DISTRIBUTION SUBROUTINE.
C
IF (M.GE.N) GO TO 30
IF (M.LT.0) GO TO 20
IF (M.EQ.0) GO TO 40
T = P**N
Q1 = (1.0 - P)/P
P1 = T
XNP1 = N + 1
XK = 0.0
DO 10 K = 1,M
XK = XK + 1.0
T = T*Q1*(XNP1 - XK)/XK
10 P1 = P1 + T
RETURN
20 P1 = 0.0
RETURN
40 P1 = P**N
RETURN
30 P1 = 1.0
RETURN
END


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : FORTRN77.ZIP
Filename : STBNPB.FOR

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/