IMSL C# Numerical Library

Cdf.HypergeometricProb Method 

Evaluates the hypergeometric probability density function.

public static double HypergeometricProb(
   int k,
   int sampleSize,
   int defectivesInLot,
   int lotSize
);

Parameters

k
An int specifying the argument at which the function is to be evaluated.
sampleSize
An int specifying the sample size, n.
defectivesInLot
An int specifying the number of defectives in the lot, m.
lotSize
An int specifying the lot size, l.

Return Value

A double specifying the probability that a hypergeometric random variable takes a value equal to k.

Remarks

Method HypergeometricProb 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:

{\rm{Pr}}\left( {X = k} \right) = 
            \frac{{\left( {_k^m } \right)\left( {_{n - k}^{l - m} } \right)}}{{\left( 
            {_n^l } \right)}}{\rm{for}} \,\,\, k = i,\;i + 1,\,i + 2\; \ldots ,\;\min 
            \left( {n,m} \right)

where i = max(0, n - l + m). HypergeometricProb evaluates the expression using log gamma functions.

See Also

Cdf Class | Imsl.Stat Namespace | Example