Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Hypergeometric probability density function

`Y = hygepdf(X,M,K,N)`

`Y = hygepdf(X,M,K,N)`

computes
the hypergeometric pdf at each of the values in `X`

using
the corresponding size of the population, `M`

, number
of items with the desired characteristic in the population, `K`

,
and number of samples drawn, `N`

. `X`

, `M`

, `K`

,
and `N`

can be vectors, matrices, or multidimensional
arrays that all have the same size. A scalar input is expanded to
a constant array with the same dimensions as the other inputs.

The parameters in `M`

, `K`

,
and `N`

must all be positive integers, with `N`

≤ `M`

.
The values in `X`

must be less than or equal to all
the parameter values.

The hypergeometric pdf is

$$y=f(x|M,K,N)=\frac{\left(\begin{array}{c}K\\ x\end{array}\right)\left(\begin{array}{c}M-K\\ N-x\end{array}\right)}{\left(\begin{array}{c}M\\ N\end{array}\right)}$$

The result, * y*, is the probability of drawing
exactly

Suppose you have a lot of 100 floppy disks and you know that 20 of them are defective. What is the probability of drawing 0 through 5 defective floppy disks if you select 10 at random?

p = hygepdf(0:5,100,20,10) p = 0.0951 0.2679 0.3182 0.2092 0.0841 0.0215

Was this topic helpful?