How to use the acceptance sampling calculator
- Evaluate a plan. Enter the sample size n and the acceptance number c (and the lot size N if you have one). You get the probability of acceptance at your incoming quality, the OC curve, the AOQ curve with its AOQL, the ATI, and the quality levels accepted 95%, 50% and 10% of the time.
- Design a plan. Enter the quality you want to accept (AQL, with producer’s risk α) and the quality you want to reject (LTPD or RQL, with consumer’s risk β). The tool searches for the smallest n and c that satisfy both.
- c = 0 plan. Enter a confidence and a reliability to get the zero-failure sample size, or enter your sample size to see what it demonstrates.
What a single sampling plan is
In a single sampling plan by attributes you draw n units at random from a lot, count the defective ones (d), and accept the lot if d ≤ c. Because only a sample is inspected, both good and bad lots can be misjudged. The operating characteristic (OC) curve shows the probability of acceptance Pa for every possible incoming fraction defective p, and is the complete description of what a plan does.
The formulas
| Model | Probability of acceptance | Use when |
|---|---|---|
| Binomial (type B) | Pa = Σk=0…c C(n,k) pk(1−p)n−k | Lots come from a continuing process, or n is under about 10% of N |
| Hypergeometric (type A) | Pa = Σk=0…c C(D,k) C(N−D,n−k) ⁄ C(N,n) | An isolated lot of N units containing D defectives — exact |
| Poisson | Pa = Σk=0…c e−np(np)k ⁄ k! | Approximation for small p and large n; also defects per unit |
The calculator evaluates these sums directly in logarithmic space (using the log-gamma function), so they stay accurate for samples of thousands of units. Nothing is read from a table or approximated by a normal curve.
- AOQ — average outgoing quality under rectifying inspection (rejected lots are screened 100% and defectives replaced): AOQ = Pa · p · (N − n) ⁄ N. Its maximum over all p is the AOQL, the worst long-run quality that can leave inspection.
- ATI — average total inspection per lot: ATI = n + (1 − Pa)(N − n).
- Design. The plan must satisfy Pa(AQL) ≥ 1 − α and Pa(LTPD) ≤ β. For each c = 0, 1, 2, … the tool finds the smallest n that holds β and stops at the first c that also holds α.
- Success-run (c = 0). If n units all pass, then with confidence C the reliability is at least R when Rn ≤ 1 − C, i.e. n = ln(1 − C) ⁄ ln(R).
How to read the results
- The Pa = 95% point is the quality the plan accepts almost always. It plays the role of an AQL, but it is a property of the plan, not the AQL index of a standard.
- The Pa = 10% point is the LTPD (lot tolerance percent defective), also called RQL or LQ: lots this bad are rejected nine times out of ten. This is the customer’s protection.
- The Pa = 50% point is the indifference quality. A steep curve between the 95% and 10% points means a discriminating plan; the ratio LTPD ⁄ AQL is the operating ratio.
- A c = 0 plan has no shoulder: its OC curve falls at once, so even good lots are rejected fairly often.
Worked example
Plan: n = 125, c = 3, lot size N = 2000, incoming quality 2% defective (D = 40 defective units).
Hypergeometric: Pa = P(0) + P(1) + P(2) + P(3) with P(k) = C(40,k)·C(1960,125−k) ⁄ C(2000,125), which gives Pa ≈ 76.2%. The binomial model gives 75.9% — close, because the sample is only about 6% of the lot.
AOQ = 0.7624 × 0.02 × (2000 − 125) ⁄ 2000 ≈ 1.43%. ATI = 125 + (1 − 0.7624) × 1875 ≈ 570 units per lot.
Zero-failure plan: for 95% confidence of 99% reliability, n = ln(0.05) ⁄ ln(0.99) = 298.07 → 299 units with no failures.
About ANSI/ASQ Z1.4 and ISO 2859-1
The AQL standards (ANSI/ASQ Z1.4, ISO 2859-1, formerly MIL-STD-105E) are sampling schemes: code letters by lot size and inspection level, plans indexed by AQL, and switching rules between normal, tightened and reduced inspection. This tool does not reproduce those tables. Take the code letter, n, Ac and Re from your copy of the standard, then enter n and c here to see the real OC curve, LTPD and AOQL of that plan — information the tables alone do not show. Note that the AQL in those standards is an index of the scheme; a single lot at the AQL is typically accepted between about 88% and 99% of the time, depending on the sample size.
Assumptions and limitations
- Samples are random and inspection is error-free. Inspector error flattens the real OC curve.
- Single sampling by attributes only (defective / not defective). Double, multiple and sequential plans and variables plans (Z1.9) are not covered.
- AOQ and ATI assume rectifying inspection with replacement of defectives.
- Sampling does not improve quality; it only estimates it. For ongoing control use an attribute control chart, and translate percent defective into DPMO with the sigma level calculator. To experiment with random sampling itself, try the probability simulator.
The method follows Montgomery, Introduction to Statistical Quality Control (acceptance sampling chapters) and Schilling & Neubauer, Acceptance Sampling in Quality Control.
Frequently asked questions
What is an OC curve in acceptance sampling?
The operating characteristic curve plots the probability of accepting a lot against the incoming percent defective for a given sampling plan. It shows how well the plan discriminates between good and bad lots, including the producer’s risk at the AQL and the consumer’s risk at the LTPD.
What is the difference between AQL and LTPD?
AQL (acceptable quality level) is the poorest quality that is still considered satisfactory as a process average; lots at the AQL should be accepted most of the time, typically 95%. LTPD (lot tolerance percent defective), also called RQL or LQ, is the quality that should be rejected most of the time, typically accepted only 10% of the time.
How do I calculate the sample size for a c = 0 sampling plan?
Use the success-run formula n = ln(1 − C) / ln(R), rounded up, where C is the confidence and R the reliability (fraction conforming). For 95% confidence and 99% reliability, n = ln(0.05) / ln(0.99) = 299 units with zero failures allowed.
What is AOQL?
AOQL is the average outgoing quality limit: the maximum of the average outgoing quality curve over all possible incoming quality levels, assuming rejected lots are 100% inspected and defectives replaced. It is the worst average quality the customer will receive in the long run.
When should I use the hypergeometric instead of the binomial distribution?
Use the hypergeometric distribution for an isolated lot of known size, especially when the sample is more than about 10% of the lot, because sampling without replacement changes the odds from draw to draw. For lots from a continuing process, or small sampling fractions, the binomial gives practically the same answer.
Does this calculator replace ANSI/ASQ Z1.4 or ISO 2859-1 tables?
No. Those standards define sampling schemes with code letters and switching rules, and the plan must be taken from the standard itself. This calculator computes the exact probabilities for any n and c, so you can check the OC curve, LTPD and AOQL of a plan taken from the standard or design a custom plan from two points.