# How to plot an Operating Characteristic Curve using Hypergeometric distribution?

I"m trying to plot an OC curve (y-axis Probability of acceptance, x-axis Lot Percent Defective) and there should be a way to plot using a hypergeometric distribution.

In:= NProbability[x <= 0,
x \[Distributed] HypergeometricDistribution[8, 7, 500]]

Out= 0.89262


is great for one point. The 7 in the distribution is the number defective in the lot of 500, I'd like to plot this for 1, 2, etc. Then alter the x-axis labels to represent the percent defective in the lot of 500, .1%, 1%, 2%, etc....

I can get the individual values as above, yet not able to get a plot.

I can do this using PoissonDistribution

Plot[{N[Probability[x <= 0,
x \[Distributed] PoissonDistribution[13*lpd]]],
N[Probability[x <= 0,
x \[Distributed] PoissonDistribution[8*lpd]]]}, {lpd, 0, .5}]


which assumes a very large lot size. I have the situation with smaller lot sizes and using hypergeometric is the right way to do the calculation for the OC curve - just not able to sort out the plotting.

Any suggestions?

cheers,

Fred

• DiscretePlot is good for plotting discrete functions – ssch Feb 11 '13 at 3:55

With the Ticks option you can set custom ticks, see this:

DiscretePlot[
Probability[x <= 0, x \[Distributed] HypergeometricDistribution[8, d, 500]],
{d, 0, 250},
Ticks -> {Table[{i 500/100, ToString@i <> "%"}, {i, 0, 50, 5}],Automatic}
] • This is right on what I was trying to do. Excellent. – Fred Schenkelberg Feb 11 '13 at 17:41
• Ok, now is it possible to easily adjust the x-axis ticks to show correct lot percent defective when I change the number of units sampled and the lot size? I apparently do not understanding the Ticks element and how it is constructed as I'm not able to alter it and get meaningful results. cheers, Fred – Fred Schenkelberg Apr 22 '13 at 18:24