Last Revision: 2/25/97
John C. Turner
jct@nadn.navy.milSelect your calculator. Then check your program against the test values.
Casio 7700 (old)
Casio 7700 (new)
TI-81 General notes
Disp and Input
are on the PRGM I/O menu
If, End, Lbl, IS>( and Goto
are on PRGM CTL menu
> is on the TEST
menu
nCr are
on the Math Prb submenu
TI-81 program for binomial CDF
PrgmB: BCDF
:Disp "P"
:Input P
:Disp "N"
:Input N
:Disp "X"
:Input X
:0 STO A
:0 STO M
:Lbl 1
:A+(N nCr M)*P^M*(1-P)^(N-M) STO A
:IS>(M,X)
:Goto 1
:Disp A
TI-81 program for hypergeometric CDF
PrgmB: HCDF
:Disp "G"
:Input G
:Disp "B"
:Input B
:Disp "S"
:Input S
:Disp "X"
:Input X
:0 STO A
:0 STO M
:Lbl 1
:A+(G nCr M)* (B nCr (S-M)) STO A
:IS>(M,X)
:Goto 1
:A/((G+B) nCr S) STO A
:Disp A
TI-81 program for Poisson CDF
PrgmB: PCDF
:Disp "L"
:Input L
:Disp "T"
:Input T
:Disp "X"
:Input X
:0 STO A
:0 STO M
:Lbl 1
:A+(L*T)^M/M! STO A
:IS>(M,X)
:Goto 1
:A/e^(L*T) STO A
:Disp A
TI-81 program for normal CDF
PrgmB: ZCDF
:Disp "M"
:Input M
:Disp "S"
:Input S
:Disp "X"
:Input X
:1/(1+.2316419*abs(X-M)/S) STO T
: e^(-((X-M)/S)^2/2)/sqrt(2*pi)*
(.31938153*T-.356563782*T^2+1.781477937*T^3- 1.821255978*T^4+1.330274429*T^5)
STO A
:If X>M
:1-A STO A
:Disp A
TI-82, 83, 85 General notes
TI-82, 83 Notes
Prompt and Disp
are on the PRGM I/O menu
SUM is on the 2nd LIST
MATH menu
seq is on the 2nd List
menu
nCr are
on the MATH PRB menu
fnInt is on the Math
menu
TI-85 Notes
Prompt and Disp
are on the PRGM I/O menu
SUM is on the MATH
MISC menu
seq is on the MATH
MISC menu
nCr are
on the MATH PRB menu
fnInt is on the CALC
menu
TI-82 menu program
PROGRAM:A230
Lbl A
Menu("SM230","BCDF",B,"HCDF",H,"PCDF",P,"ZCDF",Z,"QUIT",Q)
Lbl B
prgmBCDF
Pause
Goto A
Lbl H
prgm HCDF
Pause
Goto A
Lbl P
prgm PCDF
Pause
Goto A
Lbl Z
prgm ZCDF
Pause
Goto A
Lbl Q
TI-85 menu program
PROGRAM:A230
Lbl A
Menu(1,"BCDF",B,2,"HCDF",H,3,"PCDF",P,4,"ZCDF",Z,5,"QUIT",Q)
Lbl B
BCDF
Goto A
Lbl H
HCDF
Goto A
Lbl P
PCDF
Goto A
Lbl Z
ZCDF
Goto A
Lbl Q
TI-82, 85 program for binomial CDF
PROGRAM:BCDF
:Prompt P,N,X
:sum seq(N nCr M*(1-P)^(N-M)*P^M,M,0,X,1) STO A
:Disp A
TI-82, 85 program for binomial CDF (faster)
PROGRAM:BBCDF
:Prompt P,N,X
:0 STO A
:(1-P)^N STO T
:For(M,0,X)
:A+T STO A
:T*P/(1-P)*(N-M)/(M+1) STO T
:End
:Disp A
TI-82, 85 program for hypergeometric CDF
PROGRAM:HCDF
:Prompt G,B,S,X
:sum seq((G nCr M)*(B nCr (S-M)),M,0,X,1) STO A
:A/((G+B) nCr S) STO A
:Disp A
TI-82, 85 program for Poisson CDF
PROGRAM:PCDF
:Prompt L,T,X
:sum seq((L*T)^M/M!,M,0,X,1) STO A
:A/e^(L*T) STO A
:Disp A
TI-82, 85 program for Poisson CDF (faster)
PROGRAM:PPCDF
:Prompt L,T,X
:0 STO A
:1/e^(L*T) STO S
:For(m,0,X)
:A+S STO A
:S*L*T/(M+1) STO S
:End
:A
:Disp A
TI-82, 85 program for normal CDF
PROGRAM:ZCDF
:Prompt M,S,X
:1/(1+.2316419*abs(X-M)/S) STO T
: e^(-((X-M)/S)^2/2)/sqrt(2*pi)*
(.31938153*T-.356563782*T^2+1.781477937*T^3- 1.821255978*T^4+1.330274429*T^5)
STO A
:A+(1-2A)*(X>M) STO A
:Disp A
TI-92 General notes
Prompt and Disp
are on the F3 I/O menu
SUM( and SEQ( are spelled out
nCr( are
on the MATH PRB menu
TI-92 program for binomial CDF
:BCDF()
:Prgm
:Prompt P,N,X
:sum( seq(nCr(N,M)*(1-P)^(N-M)*P^M,M,0,X,1)) STO A
:Disp A
: EndPrgm
TI-92 program for hypergeometric CDF
:HCDF()
:Prgm
:Prompt G,B,S,X
:sum( seq((nCr(G,M))*(nCr(B,S-M)),M,0,X,1))/nCr(G+B,S) STO A
:Disp A
: EndPrgm
TI-92 program for Poisson CDF
:PCDF()
:Prgm
:Prompt L,T,X
:sum( seq((L*T)^M/M!,M,0,X,1))/e^(L*T) STO A
:Disp A
: EndPrgm
TI-92 program for normal CDF
:ZCDF()
:Prgm
:Prompt M,S,X
:1/(1+.2316419*abs(X-M)/S) STO T
: e^(0-((X-M)/S)^2/2)/sqrt(2*pi)*
(.31938153*T-.356563782*T^2+1.781477937*T^3- 1.821255978*T^4+1.330274429*T^5)
STO A
:If X>M
:1-A STO A
:Disp A
: EndPrgm
HP-48 General notes:
HP-48 program for binomial CDF
"P" PROMPT DUP 'P' STO
"N" PROMPT DUP 'N' STO
"X" PROMPT DUP 'X' STO
'sum (M=0,X,COMB(N,M)*P*M*(1-P)^(N-M))' ->NUM DUP 'A'
STO
Notes:
sum is RightShift TAN
->NUM is LeftShift EVAL
PROMPT is under PRG,
NXT, IN, NXT
HP-48 program for hypergeometric CDF
"G" PROMPT DUP 'G' STO
"B" PROMPT DUP 'B' STO
"S" PROMPT DUP 'S' STO
"X" PROMPT DUP 'X' STO
'SUM(M=S-MIN(B,S),MIN(X,MIN(G,X)),COMB(G,M)*COMB(B,S-M)/COMB(G+B,S))'
->NUM DUP 'A' STO
Notes:
sum is RightShift TAN
->NUM is LeftShift EVAL
PROMPT is under PRG,
NXT, IN, NXT
HP-48 program for Poisson CDF
"L" PROMPT DUP 'L' STO
"T" PROMPT DUP 'T' STO
"X" PROMPT DUP 'X' STO
'sum(M=0,X,(L*T)^M/(M!*EXP(L*T)))' ->NUM DUP 'A' STO
Notes:
sum is RightShift TAN
MTH, NXT,
PROB
EXP is LeftShift 1/x
->NUM is LeftShift EVAL
PROMPT is under PRG,
NXT, IN, NXT
HP-48 program for normal CDF
"M" PROMPT DUP 'M' STO
"S" PROMPT DUP 'S' STO
"X" PROMPT DUP 'X' STO
(1+.2316419*ABS((X-M)/S)' ->NUM 'T' STO
'EXP(-((X-M)/S)^2/2)/(2*)*
(.31938153*T-.356563782*T^2+1.781477937*T^3- 1.821255978*T^4+1.330274429*T^4)'
->NUM 'A' STO
If 'X>M' THEN '1-A' ->NUM 'A' STO
ELSE A END
Notes:
PROMPT is under PRG,
NXT, IN, NXT
EXP is LeftShift 1/x
->NUM is LeftShift EVAL
> is under PRG,
TEST
CASIO 7700 General notes
See the manual to enter program editing mode and program
run mode.
To get double quote ("), press ALPHA and then pick
off the screen.
End each line with a "return" by typing SHIFT
EXE.
Get the equals sign by typing SHIFT PRGM, choosing REL
and then choose = off the screen.
To get Lbl, type SHIFT PRGM and choose JMP and then
Lbl off the screen.
To get Goto, type SHIFT PRGM and choose JMP and then
Gto off the screen.
The "store" symbol, ->, is a shift key.
CASIO 7700 program for binomial CDF
"P="? -> P
"N="? -> N
"X="? -> X
0 -> M
0 -> A
Lbl 1: M > X => Goto 3
Lbl 2: (N C M)*(P^M)*(1-P)^(N-M)+A -> A
(M+1) -> M
Goto 1
Lbl 3: A
CASIO 7700 program for hypergeometric CDF
"G="? -> G
"B="? -> B
"S="? -> S
"X="? -> X
0 -> M
B > S => Goto 4
S-B -> M
Lbl4: 0 -> A
Lbl 1: M > X => Goto 3
Lbl 2: (G C M)* (B C (S-M))/ ((G+B) C S) +A -> A
(M+1) -> M
Goto 1
Lbl 3: A
CASIO 7700 program for Poisson CDF
"L="? -> L
"T="? -> T
"X="? -> X
0 -> M
0 -> A
Lbl 1: M > X => Goto 3
Lbl 2: (L*T)^M *(e-(L*T))/(M!) +A -> A
(M+1) -> M
Goto 1
Lbl 3: A
CASIO 7700 program for normal CDF
"M="? -> M
"S="? -> S
"X="? -> X
1/(1+.2316419*abs(X-M)/S) -> T
(e-(((X-M)/S)^2/2))/sqrt(2*pi)*
(.31938153*T-.356563782*T^2+1.781477937*T^3- 1.821255978*T^4+1.330274429*T^5)
-> A
X<M => Goto 1
1-A -> A
Lbl 1: A
P N X CDF 0.6 10 5 0.3668967424 0.35 22 6 0.302158381771
G B S X CDF 10 8 6 4 0.880090497738 17 11 7 4 0.58115942029
L T X CDF 2 3 4 0.285056500317 3.1 1.8 5 0.515258759857
M S X CDF 0 1 1.645 0.950015110159 7.3 2.6 4.7 0.158655259563