From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- math/bevington/pbinom.f | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 math/bevington/pbinom.f (limited to 'math/bevington/pbinom.f') diff --git a/math/bevington/pbinom.f b/math/bevington/pbinom.f new file mode 100644 index 00000000..325f6f70 --- /dev/null +++ b/math/bevington/pbinom.f @@ -0,0 +1,26 @@ +c function pbinom.f +c +c source +c Bevington, page 31. +c +c purpose +c evaluate binomial probability coefficient +c +c usage +c result = pbinom (nobs, ntotal, prob) +c +c description of parameters +c nobs - number of items observed +c ntotal - total number of items +c prob - probability of observing each item +c +c subroutines and function subprograms required +c factor (n) +c calculates n factorial for integers +c + function pbinom (nobs,ntotal,prob) +1 notobs=ntotal-nobs +2 pbinom=factor(ntotal)/(factor(nobs)*factor(notobs))* + * (prob**nobs)*(1.-prob)**notobs + return + end -- cgit