Statistical Methods
Calculate an Acceptance Probability for a Count-Based Sampling Rule
Define the task
Specify a sampling rule as a sample size n and a maximum allowed number c of nonconforming units. Under independent trials with a common nonconformance probability p, acceptance occurs when the count is at most c. The resulting operating characteristic is P(X≤c) for X following a binomial distribution. This is a quality-control teaching calculation, not a clinical safety threshold or regulatory acceptance recommendation. Define the unit, defect criterion and sampling process before using it.
Carry out the check
Evaluate the cumulative binomial probability at each prespecified p. Record both acceptable and unacceptable quality scenarios and the consequences of incorrect acceptance or rejection. Sampling without replacement from a small finite lot may require a hypergeometric model; correlated defects invalidate the independent-trial model. The tool supports n up to 200, c from zero to n and several probability scenarios. It does not optimize a plan, estimate an unknown defect rate or certify a lot. A favorable result depends on the assumptions as well as the count rule.
Worked hypothetical example
For a hypothetical rule n=10,c=0 at p=0.1, acceptance requires ten conforming units and has probability 0.9^10≈0.348678. At p=0 the acceptance probability is one; at p=1 it is zero unless c=n. With c=n every possible sample is accepted, so the rule discriminates nothing. Include these boundaries in verification and state the probability scenario explicitly when reporting an operating characteristic.
Method checked 18 November 2026 against Primary method documentation: scipy.stats.binom.