OC curve calculator for a sampling plan
Enter a single sampling plan's sample size and acceptance number. The calculator draws the operating characteristic curve, the probability that the plan accepts a lot at each true defect rate, and reads off the producer's risk at your AQL and the consumer's risk at your LTPD. The probabilities are binomial.
Operating characteristic
- Producer's risk at AQL
- -
- Consumer's risk at LTPD
- -
- Chance of accepting at AQL
- -
- Chance of accepting at LTPD
- -
The formula
Pa(p) = sum over k = 0 to c of C(n, k) × pk × (1 − p)n−k
Pa is the probability that a sample of n from a lot with defect rate p contains c or fewer defectives, so the lot is accepted. The producer's risk is the chance a good lot, at the AQL, is rejected: 1 minus Pa at the AQL. The consumer's risk is the chance a bad lot, at the LTPD, is accepted: Pa at the LTPD.
Worked example
The plan n = 80, c = 2 is the Z1.4 plan for code letter J at an AQL of 1.0.
- At 1% defective, Pa = 95.3%, so the producer's risk is 4.7%.
- At 5% defective, Pa = 23.1%, so a lot that bad is still accepted almost one time in four.
- At 10% defective, Pa falls to about 1%.
That second line is the point of the curve. A sampling plan is not a filter that stops every bad lot; it is a bet with known odds, and the OC curve shows the odds before you sign up to them.
Reading the curve
The steeper the curve, the better the plan separates good lots from bad, and the only way to make it steeper is a bigger sample. Raising c with n fixed moves the whole curve to the right, which is kinder to the producer and harder on the consumer. The binomial assumes the lot is large next to the sample; for a sample that is a big share of a small lot, the hypergeometric distribution is exact and gives a slightly steeper curve.
Next frame Yours
Tell me what you are building.
A website for your business, an app, a tool your team needs, or a calculator that should exist. I read every message myself and reply within one business day.
Or write to me directly:
corey@forgedev.studio