HYPERGEOPDF Function
Evaluates the hypergeometric probability function.
Usage
result = HYPERGEOPDF(k, n, m, l)
Input Parameters
k—Argument for which the hypergeometric probability function is to be evaluated.
n—Sample size. n must be greater than zero and greater than or equal to k.
m—Number of defectives in the lot.
l—Lot size. l must be greater than or equal to n and m.
Returned Value
result—The probability that a hypergeometric random variable takes a value equal to k. This value is the probability that exactly k defectives occur in a sample of size n drawn from a lot of size l that contains m defectives.
Input Keywords
Double—If present and nonzero, double precision is used.
Discussion
HYPERGEOPDF evaluates the probability function of a hypergeometric random variable with parameters n, l, and m. The hypergeometric random variable X can be thought of as the number of items of a given type in a random sample of size n that is drawn without replacement from a population of size l containing m items of this type. The probability function is:
where i = max(0, n – l + m). HYPERGEOPDF evaluates the expression using log gamma functions.
Example
Suppose X is a hypergeometric random variable with n = 100, l = 1000, and m = 70. In this example, we evaluate the probability function at k = 7.
result = HYPERGEOPDF(7, 100, 70, 1000)
PRINT, "The probability that X is equal to 7 is:"
PRINT, result, Format='(F6.4)'
; PV-WAVE prints the following:
; The probability that X is equal to 7 is:
; 0.1628