From: Eric S. Raymond Date: Fri, 14 Apr 1995 14:01:23 +0000 (+0000) Subject: Improved the docs. X-Git-Tag: 2.0~6 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=9f2abcf73b9cf1e4ec7ddbc342ec6ad28bb5e985;p=deal.git Improved the docs. --- diff --git a/deal.xml b/deal.xml index 7cf7fc8..9109fe7 100644 --- a/deal.xml +++ b/deal.xml @@ -15,15 +15,16 @@ Then X has a hypergeometric distribution, with the following formula 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 @@ -64,7 +65,7 @@ B(n, k) is blowing up, this will enable you to probe the local lgamma 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 @@ -74,17 +75,11 @@ Gathering" deck (MtG starts you with 7 cards): 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 . Based on the `cardprobs' program by Jeremy York. See my home page at