| Statistics Toolbox | Search  Help Desk |
| hygepdf | Examples |
Hypergeometric probability density function (pdf).
Syntax
Y = hygepdf(X,M,K,N)
Description
hygecdf(X,M,K,N) computes the hypergeometric pdf with parameters M, K, and N at the values in X. The arguments X, M, K, and N must all be the same size except that scalar arguments function as constant matrices of the common size of the other arguments. The parameters M, K, and N must be positive integers. Also X must be less than or equal to all the parameters and N must be less than or equal to M. The hypergeometric pdf is:
Examples
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