Acceptance Sampling Plan Simulator Back
Quality Engineering

Acceptance Sampling Plan Simulator

Design a single-sampling acceptance plan that decides a lot's fate from a sample alone. Adjust the lot size, sample size and acceptance number to see the probability of acceptance, the average outgoing quality, and the OC curve with its producer's-risk and consumer's-risk trade-off update in real time.

Parameters
Lot size N
pcs
Total number of items in one inspected lot
Sample size n
pcs
Number of items drawn at random from the lot
Acceptance number c
pcs
Accept if sample defectives are at most this
Actual defect rate p
%
The true fraction of defectives the lot contains
Results
Mean defectives np
Prob. of acceptance Pa (%)
Rejection probability (%)
Avg outgoing quality AOQ (%)
Sampling fraction n/N (%)
Lot verdict tendency
Lot sampling — accept/reject animation

A random sample of n items is drawn from the lot and its defectives (red) are compared with the acceptance number c. At most c accepts the lot; more rejects it and a stamp is applied.

OC curve — true defect rate p vs probability of acceptance Pa
Average Outgoing Quality AOQ vs defect rate p
Theory & Key Formulas

$$P_a=\sum_{k=0}^{c}\frac{e^{-np}\,(np)^{k}}{k!},\qquad \text{AOQ}=p\cdot P_a\cdot\frac{N-n}{N}$$

Probability of acceptance Pa (the Poisson probability that the sample defectives are ≤ c) and the average outgoing quality AOQ. n: sample size, c: acceptance number, p: true defect rate, N: lot size.

The OC curve is Pa plotted against the true defect rate p. The probability that a good lot (near the AQL) is rejected is the producer's risk, and the probability that a bad lot is accepted is the consumer's risk; both are read straight off the OC curve.

What is acceptance sampling?

🙋
Acceptance sampling means inspecting only some of the items instead of all of them, right? Can that really guarantee quality? It sounds a bit like cutting corners.
🎓
I get the worry, but it isn't cutting corners. Inspecting a big lot one item at a time costs an enormous amount of time and money. And for tests where checking destroys the product — a bolt torque-to-failure test, a destructive food test — full inspection would leave nothing to sell. So you draw a random sample of n items from the lot and count the defectives. If that count is at most the acceptance number c, you accept the whole lot. That is a single-sampling plan.
🙋
I see. But if I happen to draw a good sample, won't a bad lot slip through? And if I'm unlucky with defectives, a good lot could fail.
🎓
That is exactly the heart of it. The "luck of the draw" is captured precisely by the OC curve — the Operating Characteristic curve. It puts the lot's true defect rate on the horizontal axis and the probability of acceptance Pa on the vertical axis. Even a genuinely good lot can be rejected by bad luck — that is the producer's risk. A genuinely bad lot can slip through and be accepted — that is the consumer's risk. Move the defect-rate slider on the right and you will see the operating point travel along the OC curve.
🙋
So if I crank the sample size n way up, can I drive both of those risks to zero?
🎓
Here's the thing — no sampling plan can drive both risks to zero at once. Increasing n makes the OC curve steeper, so the plan separates good lots from bad ones more sharply. But it only becomes a perfect vertical step when you inspect every item. And a bigger n means a bigger inspection cost. What sampling gives you is not absolute certainty, but a quantified, deliberately chosen balance of risk. That is worth keeping firmly in mind.
🙋
There's also this AOQ — Average Outgoing Quality — figure. What does it represent?
🎓
AOQ is the average defect rate of the lots that actually ship after passing inspection. We assume a rejected lot gets 100% inspected and its defectives replaced with good items. The interesting part: when the incoming defect rate p is low, almost no defectives get through, so AOQ is low. When p is high, most lots are rejected and fully inspected, so AOQ is low again. So it peaks in the middle — that peak is the AOQL. Check the chart below. That AOQL is the worst outgoing defect rate this plan can guarantee.
🙋
Setting the acceptance number c to 0 makes the strictest possible inspection, doesn't it? Wouldn't that be best?
🎓
Intuitively it feels that way. But the OC curve for c=0 drops sharply the moment the defect rate rises even slightly. That means a perfectly decent lot with just a trace of defectives gets ruthlessly rejected — the producer's risk shoots up. In practice you want lots near the AQL to pass. So engineers usually take c around 1 to 3 and tune it together with n to balance the producer's and consumer's risks.

Frequently Asked Questions

The Operating Characteristic (OC) curve plots the lot's true defect rate on the horizontal axis against the probability that the sampling plan accepts the lot, Pa, on the vertical axis. The more steeply the curve falls, the better the plan distinguishes good lots from bad ones. The OC curve makes it easy to read off, at a glance, how likely a lot of any given defect rate is to be accepted, so you can objectively evaluate and compare sampling plans. This tool draws the OC curve from the n and c you enter and marks the operating point for the current defect rate.
In a single-sampling plan you draw n items from the lot and accept it if the number of defectives is at most the acceptance number c. The expected number of defectives in the sample is np (n times the defect rate). This tool uses the Poisson approximation: Pa = Σ(k=0 to c) e^(−np)·(np)^k / k!. For example, with n=80, a defect rate of 2% and c=2, np=1.60 and Pa = e^(−1.6)·(1+1.6+1.28) ≈ 0.783, so the lot is accepted about 78% of the time.
The producer's risk (α) is the probability that a genuinely good lot at or near the Acceptable Quality Level is rejected by bad luck of the draw. The consumer's risk (β) is the probability that a genuinely bad lot slips through and is accepted because no defectives happened to appear in the sample. No sampling plan can drive both risks to zero at once. Increasing the sample size n makes the OC curve steeper and sharpens the plan's discrimination, but at a higher inspection cost. Sampling delivers not certainty, but a quantified and deliberately chosen balance of risk.
The Average Outgoing Quality (AOQ) is the average defect rate of the lots that ship after passing acceptance sampling, assuming rejected lots are 100% inspected and their defectives replaced with good items. AOQ = p·Pa·(N−n)/N. When the incoming defect rate p is low, few defectives get through and AOQ is low; when p is high, most lots are rejected and fully inspected, so AOQ is again low. In between it peaks — the Average Outgoing Quality Limit (AOQL), which is the worst outgoing defect rate the plan can guarantee.

Real-World Applications

Incoming inspection (purchased parts): Manufacturers run acceptance sampling on lots of parts received from suppliers before letting them into the factory. Inspecting every one of several thousand to tens of thousands of bolts, connectors or electronic components is impractical, so engineers select n and c for the chosen AQL from the attributes sampling tables of ISO 2859 (JIS Z 9015). Drawing the OC curve with this tool lets you confirm in advance that the purchasing specification's AQL and the actual sampling plan are consistent.

Products that require destructive testing: Tensile testing of weld joints, seam-strength testing of cans, function testing of pyrotechnics, compression testing of concrete specimens — for uses where inspecting the product destroys it, full inspection is physically impossible. Acceptance sampling is the only option, and the design of the sample size n and acceptance number c becomes the substance of quality assurance itself.

Outgoing and in-process inspection: Acceptance sampling is also used for the final inspection before products ship to a customer and for intermediate inspection between process steps. On a continuous production line, each lot is sampled and rejected lots are sent for 100% sorting; the AOQL then guarantees an upper bound on outgoing quality. This tool's AOQ chart is a visualisation of exactly that idea.

Standards and procurement negotiation: When a customer and a supplier agree on "what defect rate counts as acceptable", the OC curve becomes a shared language. The producer wants good lots not to be rejected (lower producer's risk), the consumer wants not to receive bad lots (lower consumer's risk) — interests conflict, but by specifying two points on the OC curve (Pa at the AQL and Pa at the LTPD) both sides can settle objectively on an n and c they can accept.

Common Misconceptions and Pitfalls

The biggest misconception is assuming that "accepted" means "the lot has zero defectives". Acceptance of a sampling plan only means "the sample contained at most c defectives" — it does not mean the lot as a whole is free of defectives. With an acceptance number c of 2, a sample with two defectives still passes, and the lot itself may carry a substantial number of defectives that simply did not appear in the sample. What sampling guarantees is that the lot's defect rate follows a certain probability distribution — not that there are zero defectives.

Next, the belief that "keeping the sampling fraction (n/N) constant protects quality equally". Always drawing, say, 5% sounds intuitively fair, but the shape of the OC curve is set almost entirely by the sample size n and the acceptance number c, and depends little on the lot size N. Drawing 5% (a small number) from a small lot gives extremely poor discrimination, while drawing 5% (a large number) from a big lot is over-inspection. That is why formal sampling tables such as ISO 2859 derive n from N via a "sample size code letter" rather than via a sampling fraction. Avoid designs that fix n/N.

Finally, do not assume the Poisson approximation always applies. This tool computes Pa by approximating the binomial distribution with the Poisson distribution. That approximation is good when the sample size n is large and the defect rate p is small (as a rule of thumb, when np stays modest). For cases where the sampling fraction n/N is large (you draw a substantial part of the lot) or the defect rate is very high, the hypergeometric or binomial distribution should really be used, and the Poisson approximation introduces error. When building a precise plan in practice, always check that the assumptions of the approximation hold.

How to Use

  1. Enter lot size (N) between 50–10,000 units in the lotRange field to define your production batch
  2. Set sample size (n) in sampRange; typical values are 50–500 units depending on AQL requirements per ANSI/ASQ Z1.4
  3. Specify acceptance number (c) in acRange—for AQL 1.0% with n=125, use c=3 to limit producer risk to 5%
  4. Input number of nonconforming units found in defNum to calculate acceptance probability and AOQ
  5. Review the OC curve slope and lot verdict tendency to assess whether the plan meets your consumer risk (β) tolerance

Worked Example

Automotive fastener lot: N=2,500 bolts, n=200 samples, AQL=1.0%, acceptance number c=4. Inspector finds 2 defects in sample. Mean defectives np=2.0; Pa=92.3%; rejection probability=7.7%; AOQ=0.78%; sampling fraction=8.0%. Lot is accepted. If instead 6 defects appear (exceeding c), Pa drops to 11.4%, triggering 100% inspection or rejection per contract terms.

Practical Notes

  1. For tighter AQL (0.65% electronics), reduce c relative to n; for looser AQL (2.5% non-critical parts), increase c to balance inspection cost against defect risk
  2. AOQ peaks near the indifference quality level; monitor AOQ curve to set maximum acceptable outgoing defect rate (typically 0.5–1.5% for safety-critical assemblies)
  3. Sampling fraction below 10% assumes stable process; above 15%, consider 100% inspection or reduce lot size to improve detection sensitivity
  4. Producer risk (α) of 5% and consumer risk (β) of 10% are industry standard; adjust acceptance number if OC curve shows insufficient discrimination between good and bad lots