| Statistics Toolbox | Search  Help Desk |
| binopdf | Examples |
Binomial probability density function (pdf).
Syntax
Y = binopdf(X,N,P)
Description
binopdf(X,N,P) computes the binomial pdf with parameters N and P at the values in X. The arguments X, N and P must all be the same size except that scalar arguments function as constant matrices of the common size of the other arguments. N must be a positive integer and P must lie on the interval [0 1]. The binomial pdf is
Examples
A Quality Assurance inspector tests 200 circuit boards a day. If 2% of the boards have defects, what is the probability that the inspector will find no defective boards on any given day?binopdf(0,200,0.02)
ans =
0.0176
What is the most likely number of defective boards the inspector will find?
y = binopdf([0:200],200,0.02);
[x,i] = max(y);
i
i =
5