[sci.math.stat] HP28S basic probability programs

markl@uokmax.uucp (Mark A. Lindsay) (07/06/90)

	The below programs are some short programs for the 28S for some
basic probability applications (these are REAL basic).  Anyone with any
knowledge of hp28 programming can probably do these themselves, but I'll
post them anyway.


BINO

This program solves a binomial problem.
Programs used: NGX.

<< 
-> n x p
	<<
	n x COMB 
	p x ^ * 
	p NGX
	n x - ^ *
	>>
>>


CBIN

This program computes the cumulative value of a binomial distribution.
Programs used: BINO.

<<
-> n x p
	<<
	0
	0 x FOR y
	n y p BINO +
	NEXT
	>>
>>


GEOM

This program solves a geometric distribution.
Programs used: NGX.

<< 
-> x p
	<<
	p NGX
	x 1 - ^
	p *
	>>
>>


HYP

This program computes a hypergeometric distribution

<<
-> r x t n
	<<
	r x COMB
	t r - n x - COMB *
	t n COMB /
	>>
>>


NBT

This program solves a negative binomial distribution.
It uses the program NGX.

<<
-> x r p
	<<
	x 1 - x r - COMB
	p r ^ *
	p NGX x r - ^ *
	>>
>>



NGX

This program is used primarily in probability routines to compute the inverse
probability of an event.

<<
-> x
	<< 
	1 x -
	>>
<<


NORM

This program computes a zscore and then gives the upper tail probability of 
the standard normal distribution with that zscore.

<<
-> m s x
	<<
	0 1 x m - s / UTPN
	>>
>>


PCDT

This routine is for use in the solver.  Store it as the equation go to the
solver, plug in all values except x,  and type shift-x to solve the routine.
It solves for a chi-square distribution.

<< P N X UTPC - >>


PFDT

This routine is for use in the solver.  Store it as the equation go to the
solver, plug in all values except x,  and type shift-x to solve the routine.
It solves for an F distribution.

<< P M N X UTPF - >>


PNDT

This routine is for use in the solver.  Store it as the equation go to the
solver, plug in all values except x,  and type shift-x to solve the routine.
It solves for a normal distribution.

<< 1 P - M V X UTPN - >>


POIS

This program computes a poisson distribution.

<< 
-> x l
	<< 
	l x ^ 
	l NEG EXP *
	x FACT / 
	>>
>>


PTDT

This routine is for use in the solver.  Store it as the equation go to the
solver, plug in all values except x,  and type shift-x to solve the routine.
It solves for a student's T distribution.

<< P N X UTPT - >>


U2

This program is called by UP to move up a directory on the path.

<<  
    -> x
    <<
	DROP EVAL x 2 - DROPN
    >>
>>


UP

This program changes directory to one higher on the path.
Programs used:  U2.

<<  PATH  LIST->  U2 >>


ZINT

This program computes from the input:
		zscores of 2 bounds,
		the area under the normal curve between the bounds,
		the area not under the curve.
Programs used: NORM, NGX

<<
-> u l m s
	<<
	u m - s /
	l m - s /
	DUP2 2->LIST
	3 ROLLD
	0 SWAP 1 SWAP NORM SWAP
	0 SWAP 1 SWAP NORM SWAP -
	NEG DUP NGX 2->LIST
	>>
>>



                                 ---------------
University of Oklahoma         | Mark A. Lindsay |         Veritas Omnia Vincit
                                 ---------------