MECHOWL ENGINEERING AI
OC curve and acceptance probability of a sampling plan (AQL, LTPD, binomial)
Draws the OC curve of a sampling plan (sample size n, acceptance number c) and gives the probability of acceptance Pa for each lot fraction defective, and the producer’s risk α and the consumer’s risk β at the AQL (acceptable quality level) and the LTPD. The distribution can be chosen from the binomial, the hypergeometric (using the lot size N and the number of defectives D) and the Poisson approximation.
Last updated
Inputs
Results
Results appear here as you enter values.
Results are reference values from your inputs and the stated formulas and standards; they do not guarantee that a design is correct or safe. The final decision rests with you.
References
- NIST/SEMATECH e-Handbook of Statistical Methods, 6.2.3.2 Choosing a Sampling Plan with a given OC Curve · NIST (National Institute of Standards and Technology, US) · Probability of acceptance of the binomial distribution when the lot is much larger than the sample, Pa = P(d ≤ c); the table of the OC curve of the plan (52, 3); p₁ (AQL) and p₂ (LTPD) with α and β · Open the document
- NIST/SEMATECH e-Handbook of Statistical Methods, 6.2.2 What kinds of Lot Acceptance Sampling Plans (LASPs) are there? · NIST (National Institute of Standards and Technology, US) · Definitions of terms (AQL, LTPD, Type I Error (Producer’s Risk), Type II Error (Consumer’s Risk), OC curve) · Open the document
- NIST DATAPLOT Reference Manual, “HYPCDF” · NIST (National Institute of Standards and Technology, US) · Cumulative distribution function of the hypergeometric distribution (EQ 8-241: the sum of the probabilities of the number of marked items when drawing from a population without replacement) · Open the document
- Series: Key points for using SQC methods, sequel part 2: Acceptance sampling inspection (10th in the series) (Japanese) · Union of Japanese Scientists and Engineers (JUSE) · “2. The idea of acceptance sampling” (producer’s risk and consumer’s risk) and “4. Individual inspection standards” · Open the document
- SQC Smart Introduction Course, Part 3: Reading the process with control charts (Japanese) · KEYENCE · “Examining the binomial and Poisson distributions” (Poisson distribution m = np) · Open the document
The references were chosen independently by MechOwl; they do not recommend or guarantee this page.
Report an error in this calculation (contact page of the official site, opens in a new tab)
Paste this line into your message:
https://mechowl.com/calc/en/quality/sampling-oc/ (calculation version 0.2.1)
Explanation
In single sampling, n units are drawn from the lot; the lot is accepted when the sample has at most the acceptance number c of defectives and rejected when it has more than c. The line joining the probability of acceptance Pa for each lot fraction defective p is the OC curve (operating characteristic curve); it shows how the plan (n, c) works. The probability 1 − Pa(p₁) of rejecting a lot with a fraction defective p₁ that should be accepted is called the producer’s risk α, and the probability Pa(p₂) of accepting a lot with a fraction defective p₂ that should be rejected is called the consumer’s risk β. The reference (NIST) uses the AQL (acceptable quality level: the fraction defective taken as the producer’s quality standard) for p₁ and the LTPD (Lot Tolerance Percent Defective: a high fraction defective that the consumer cannot accept) for p₂. The tables that give the sample size n and the acceptance number c from the AQL, the inspection level and the lot size are in the standards and not on this page. To choose a plan, see a standard such as JIS Z 9015-1.
How to use
Choose the distribution, then enter the sample size n and the acceptance number c (the values of your plan) and the lot fraction defective p whose probability of acceptance you want. For the hypergeometric distribution, enter the lot size N and the number of defectives in the lot D instead of the fraction defective. To see the producer’s and the consumer’s risk, enter the fractions defective p₁ and p₂ (for the hypergeometric distribution, the numbers of defectives D₁ and D₂).
Worked examples (hand calculation)
Example 1: n = 52, c = 3: fraction defective 3 %, p₁ = 1 %, p₂ = 10 % (binomial)
The plan of the NIST example (n = 52, c = 3). Pa = Σ_{d=0}^{3} C(52, d) 0.03^d 0.97^(52−d) = 0.929537 (NIST table: 0.930). p₁ = 1 %: Pa = 0.998153, α = 1 − 0.998153 = 0.00184693 (NIST table: Pa 0.998). p₂ = 10 %: β = Pa = 0.223187 (NIST: 0.223). np = 52 × 0.03 = 1.56.
Example 2: Hypergeometric: N = 100, n = 25, c = 0, 10 defectives (10 %)
The inputs are values set on this page. D = 10 defectives (fraction defective D ÷ N = 10 %). With c = 0, Pa = P(0) = C(90, 25) ÷ C(100, 25) = (90 × 89 × … × 66) ÷ (100 × 99 × … × 76) = 0.0478866. The binomial distribution with the same n, c and p gives 0.9^25 = 0.0717898; in this example the hypergeometric value is smaller.
Example 3: Poisson approximation: n = 30, c = 0, fraction defective 2 %
The KEYENCE example: m = np = 30 × 0.02 = 0.6, Pa = P(0) = e^(−0.6) = 0.548812 (source: 0.549). The binomial distribution gives 0.98^30 = 0.545484.
Example 4: Hypergeometric: N = 1,000, n = 52, c = 3, 30 defectives, D₁ = 10, D₂ = 100
The inputs are values set on this page. D = 30 defectives (3 %): Pa = Σ_{d=0}^{3} C(30, d) C(970, 52 − d) ÷ C(1,000, 52) = 0.934695 (a little larger than the binomial 0.929537). D₁ = 10 defectives (1 %): α = 1 − Pa = 0.00108478. D₂ = 100 defectives (10 %): β = 0.215782.
Example 5: Fraction defective 0 % (always accepted)
The inputs are values set on this page. No defectives occur, so Pa = 1 (100 %). The same holds for c = 0.
Example 6: Hypergeometric with n = N (every unit inspected): N = n = 20, c = 1, 1 defective, D₂ = 2
The inputs are values set on this page. When every unit is inspected, the number of defectives in the sample is the number of defectives in the lot itself. D = 1 ≤ c = 1, so the lot is always accepted (Pa = 1). D₂ = 2 > 1, so the lot is always rejected (β = 0).
Example 7: c = n (n = 5, c = 5, fraction defective 30 %)
The inputs are values set on this page. Even if all 5 units are defective the lot is accepted, so Pa = 1.
Example 8: Hypergeometric with the lot size not entered
The hypergeometric distribution uses the lot size. It is not entered, so nothing is calculated (the page does not switch to the binomial distribution or fill in a large value).
Example 9: Sample size 200,000 units (outside the scope)
This page computes samples of up to 100,000 units. 200,000 units is a possible input but outside the scope, so no result is given and the reason is shown.
Example 10: Sample size > lot size (input error)
80 units cannot be drawn from a lot of 50. Input error (no verdict is given; the field is the sample size).
Example 11: Hypergeometric with 0 defectives (always accepted)
The inputs are values set on this page. The lot has no defectives, so the sample always has 0 defectives and Pa = 1 (100 %). The fraction defective D ÷ N = 0 %.
Example 12: Hypergeometric with defectives > lot size (input error)
A lot of 30 cannot hold 40 defectives. Input error (no verdict is given; the field is the number of defectives in the lot).
Example 13: Acceptance number > sample size (input error)
A sample of 10 cannot hold 12 defectives. The acceptance number must not exceed the sample size, so this is an input error.
Common mistakes
- Reading the probability of acceptance as the yield of the lot: Pa is the probability that the lot is accepted by this plan. For n = 52, c = 3 and a lot fraction defective of 3 %, Pa is about 93 %, which means that about 93 % of such lots are accepted.
- Calculating with the binomial distribution when the sample is a large part of the lot: each time a unit is drawn, the fraction defective of the rest of the lot changes. If the lot size is known, check with the hypergeometric distribution (this site’s guidance).
- Expecting a lot with the AQL fraction defective to be always accepted: unless the producer’s risk α is 0, a lot at the AQL is also rejected with the probability α.
- Using n and c read from a standard’s table without checking: the plan changes with the inspection level and the switching of severity (normal, tightened, reduced). See the procedure of the standard (this site’s guidance).
FAQ
- Which of the three distributions should I use?
- Use the binomial distribution when the lot is much larger than the sample. Use the hypergeometric distribution when the lot size N is known and the sample is a large part of it. The Poisson distribution is an approximation for a large sample size and a small fraction defective (this site’s guidance).
- Can n and c be found from the AQL?
- This page does not choose the plan (n, c). The tables that give the sample size n and the acceptance number c from the AQL, the inspection level and the lot size are in the standards and not on this page. To choose a plan, see a standard such as JIS Z 9015-1. You can check the OC curve of a plan you have chosen, and the risks at p₁ and p₂, on this page.
- Is the fraction defective not entered for the hypergeometric distribution?
- For the hypergeometric distribution, enter the number of defectives in the lot D as a whole number (the defectives in a lot are a whole number of units). The fraction defective is shown as D ÷ N. The points for the producer’s and the consumer’s risk are also entered as numbers of defectives D₁ and D₂.
Scope
The probability of acceptance of a single sampling plan (n, c) for each lot fraction defective (binomial, hypergeometric and Poisson approximation), the OC curve, and the producer’s and the consumer’s risk at the fractions defective you decide.
Not covered by this calculation:
- Choosing the plan (n, c) from the AQL, the inspection level and the lot size, and the tables of standards such as JIS Z 9015-1 and ISO 2859-1 (sample size code letters, switching between normal, tightened and reduced inspection)
- Double, multiple and sequential sampling, and sampling inspection by variables
- Average outgoing quality (AOQ) and average total inspection (ATI)
- Plans with a sample size above 100,000 units