for probabilities:
.nf
- B(M, i)B(N-M, k-i)
+ B(M, i) * B(N-M, k-i)
P(X = i) = ---------------------
B(N, k)
.fi
-where B(a,b) is read "a choose b", and is the number of ways
-to choose b objects out of a possible objects. The formula for it is
+where B(a,b) is the binomial coefficient (read "a choose b"), and is the
+number of ways to choose b objects out of a possible objects. The
+formula for the binomial coefficient is:
- B(a,b) = a!/(b! (a-b)!)
+ B(n,m) = n!/(m! * (n-m)!)
This program prints out tables of these probabilities. The `specials'
and `total' arguments specify M and N. The table displays values for
function.
.TP
-H
-Compute the hypergeometric coefficient H(i, k, M, N) with arguments
+Compute the hypergeometric probability H(i, k, M, N) with arguments
supplied from the command line. For debugging.
.PP
.SH EXAMPLES
deal 3 62
-To compute your chances of drawing the 4 aces in 5-card draw poker:
+To compute your chances of having the 4 aces on the nth draw in
+5-card draw poker:
deal -b 5 4 52
-.SH BUGS
-For various extreme values of the arguments, the code is prone to
-SIGFPE errors in the exp() function (it will tell you when this
-happens).
-.PP
-Since it doesn't happen in useful cases, and there is no portable
-fix that I know of, we'll just have to live with it.
.SH AUTHOR
Eric S. Raymond <esr@snark.thyrsus.com>. Based on the `cardprobs'
program by Jeremy York. See my home page at