Tutorials › VEE Mathematical Statistics › Hypergeometric Applications in Quality Inspection

VEE Mathematical Statistics · Hypergeometric and Discrete Uniform Models · Tutorial 136 of 880

Hypergeometric Applications in Quality Inspection

Learn to calculate and interpret acceptance probabilities for quality-inspection samples drawn without replacement from a finite lot.

Intermediate 10 min read

What You'll Learn

  • Translate finite-lot inspection information into hypergeometric parameters.
  • Determine the feasible numbers of defectives in a sample.
  • Calculate acceptance and rejection probabilities for an acceptance number.
  • Use complements and count ranges efficiently in inspection problems.
  • Check how a sampling plan performs when the lot’s defective count changes.

Why Quality Inspection Uses a Hypergeometric Model

A quality inspector often samples items from a particular, finite lot and decides whether to accept the lot based on the number of defective items found. The key feature is that the sample is drawn without replacement: once an item has been inspected, it is not returned to the lot before the next draw. The chance of finding a defective item therefore changes as the sample is drawn.

The hypergeometric model represents this setting directly. For a quality-inspection problem, identifying the lot size, the number of defectives in the lot, the sample size, and the acceptance rule is usually more important than beginning with a calculation. A small mistake in interpreting “accept at most” or “reject if at least” can change the event being calculated.

Definition: Suppose a lot contains \(N\) items, exactly \(K\) of which are defective. A simple random sample of \(n\) distinct items is drawn without replacement. Let \(X\) be the number of defectives in the sample. Then \(X\) has a hypergeometric distribution with parameters \(N\), \(K\), and \(n\), and $$ P(X=x)=\frac{\binom{K}{x}\binom{N-K}{n-x}}{\binom{N}{n}}. $$ The feasible values satisfy \(\max(0,n-(N-K))\le x\le\min(n,K)\).

In a single-sampling plan, the acceptance number \(c\) is the largest number of defectives allowed in the sample for the lot to be accepted. Thus the lot is accepted when \(X\le c\), and rejected when \(X>c\). The probability of acceptance is \(P(X\le c)\); the probability of rejection is \(P(X>c)=1-P(X\le c)\). These probabilities describe the sampling decision for a lot with the specified fixed composition. They do not mean that an accepted lot contains no defectives.

Translating an Inspection Rule into a Probability

Begin by recording the model information in context. Here \(N\) is the total number of items in the lot, \(K\) is the known number of defectives in that lot, and \(n\) is the number inspected. The random variable \(X\) counts sampled defectives. The acceptance number \(c\) determines which values of \(X\) count as acceptance.

For an acceptance number \(c\), the probability can be written as a sum of hypergeometric probabilities:

$$ P(\text{accept})=P(X\le c) =\sum_{x=\max(0,n-(N-K))}^{\min(c,n,K)} \frac{\binom{K}{x}\binom{N-K}{n-x}}{\binom{N}{n}}. $$

If the lower bound exceeds the upper bound, no feasible sample count satisfies the acceptance rule, so the acceptance probability is zero. Similarly, if every feasible value of \(X\) is at most \(c\), the acceptance probability is one. Checking the support first can identify these cases without unnecessary arithmetic.

Why the Hypergeometric Probability Applies

Each possible sample of \(n\) distinct items is equally likely under simple random sampling. There are \(\binom{N}{n}\) such samples in total. To obtain exactly \(x\) defectives, choose \(x\) of the \(K\) defective items and \(n-x\) of the \(N-K\) nondefective items. The number of qualifying samples is therefore \(\binom{K}{x}\binom{N-K}{n-x}\). Dividing this count by the total number of samples gives the probability mass function.

This counting argument also explains the practical assumptions. The lot’s composition is fixed during sampling, every item is classified correctly, and the sample is selected randomly without replacement. If items are returned before each draw, or if the sample is not selected randomly, this exact model does not describe the procedure as stated.

1
Specify the lot.
Write down \(N\) and \(K\), distinguishing the total number of items from the number of defectives.
2
Define the count.
Let \(X\) be the number of defectives among the \(n\) sampled items, and check its feasible values.
3
Translate the rule.
For acceptance number \(c\), acceptance means \(X\le c\); rejection means \(X>c\).
4
Calculate and check.
Sum the relevant hypergeometric probabilities, or use a complement, then verify that acceptance and rejection probabilities add to one.

Worked Inspection Problems

Worked Example: Acceptance with a Small Sample

A hypothetical lot contains \(N=20\) circuit connectors, exactly \(K=4\) of which are defective. An inspector randomly selects \(n=4\) connectors without replacement. The lot is accepted if the sample contains at most one defective. Find the acceptance and rejection probabilities.

Model and event. Let \(X\) be the number of defectives among the four sampled connectors. Then \(X\) is hypergeometric with \(N=20\), \(K=4\), and \(n=4\). The acceptance number is \(c=1\), so acceptance is \(X\le1\). The feasible values are \(0,1,2,3,4\).

Count all samples. The number of samples of four connectors is \(\binom{20}{4}=4845\).

Count accepted samples with zero defectives. Choose all four from the 16 nondefective connectors: \(\binom{4}{0}\binom{16}{4}=1(1820)=1820\).

Count accepted samples with one defective. Choose one of the four defectives and three of the 16 nondefectives: \(\binom{4}{1}\binom{16}{3}=4(560)=2240\).

The acceptance probability is therefore \(P(X\le1)=(1820+2240)/4845=4060/4845\approx0.8380\). The rejection probability is \(1-4060/4845=785/4845\approx0.1620\).

Check. The exact numerators sum to \(4060+785=4845\), and the rounded probabilities sum to \(0.8380+0.1620=1.0000\). The method is to count the acceptable sample compositions; it avoids treating successive draws as independent.

Worked Example: Find Rejection Probability by a Complement

A hypothetical shipment has \(N=25\) components, including \(K=5\) defectives. A random sample of \(n=5\) is inspected without replacement. The shipment is accepted if there are at most one defective. Find the probability of rejection.

Model and event. Let \(X\) count sampled defectives. Then \(X\) is hypergeometric with \(N=25\), \(K=5\), and \(n=5\). Rejection means \(X\ge2\). It is shorter to calculate the complement, acceptance \(X\le1\), and subtract from one.

The total number of samples is \(\binom{25}{5}=53130\). For zero defectives, the number of samples is \(\binom{5}{0}\binom{20}{5}=1(15504)=15504\). For exactly one defective, it is \(\binom{5}{1}\binom{20}{4}=5(4845)=24225\).

Thus the number of accepted samples is \(15504+24225=39729\), and \(P(\text{accept})=39729/53130\). Therefore, \(P(\text{reject})=1-39729/53130=13401/53130\approx0.2522\), to four decimal places.

Check. The rejection numerator can also be obtained directly by counting samples with two, three, four, or five defectives; these are precisely the samples excluded from the acceptance count. The acceptance and rejection numerators add to \(39729+13401=53130\). The complement method avoids a longer sum, while retaining the correct strict inequality \(X\ge2\) for rejection.

Worked Example: Choosing an Acceptance Number to Meet a Target

A hypothetical lot contains \(N=12\) sensor housings, exactly \(K=3\) of which have a defect. Four housings are randomly inspected without replacement. A proposed plan should have an acceptance probability of at least \(0.80\) for this lot. Find the smallest acceptance number \(c\) that meets the target.

Model and decision rule. Let \(X\) be the number of defectives among the \(n=4\) sampled housings. Then \(X\) has parameters \(N=12\), \(K=3\), and \(n=4\). The denominator for all samples is \(\binom{12}{4}=495\).

For \(c=0\), only samples with zero defectives are accepted. Their count is \(\binom{3}{0}\binom{9}{4}=1(126)=126\), giving acceptance probability \(126/495\approx0.2545\). This is below \(0.80\).

For \(c=1\), add samples with exactly one defective: \(\binom{3}{1}\binom{9}{3}=3(84)=252\). The cumulative accepted count is \(126+252=378\), so the probability is \(378/495\approx0.7636\), still below \(0.80\).

For \(c=2\), add samples with exactly two defectives: \(\binom{3}{2}\binom{9}{2}=3(36)=108\). Now the accepted count is \(378+108=486\), and the probability is \(486/495=0.9818\), to four decimal places.

Conclusion and check. The smallest acceptance number meeting the target is \(c=2\): neither \(c=0\) nor \(c=1\) meets the target, while \(c=2\) does. The remaining nine samples out of 495 contain all three defectives, so the rejection probability is \(9/495=0.0182\); it complements \(486/495\) to one.

Interpretation and Common Traps

An acceptance probability is conditional on the lot composition specified in the problem. In the first example, it was calculated for a lot known to contain exactly four defectives. A different value of \(K\) generally produces a different acceptance probability, even if the inspection sample size and acceptance number stay fixed.

  • Using the wrong inequality. “Accept at most one defective” means \(X\le1\); rejection is \(X\ge2\), not \(X\ge1\).
  • Confusing lot size with sample size. \(N\) counts the whole lot; \(n\) counts only inspected items. The number of nondefectives is \(N-K\).
  • Using a with-replacement calculation. The sample is without replacement, so the draws are dependent. Use the hypergeometric model under the stated sampling assumptions.
  • Ignoring impossible counts. A sample cannot contain more defectives than the lot has, or more items of either type than are available. Respect the support of \(X\).
  • Interpreting acceptance as proof of quality. Acceptance is a decision based on a sample, not a statement that the lot has no defectives.
Key takeaway: For a fixed lot sampled randomly without replacement, model the sample defective count with a hypergeometric distribution. Translate acceptance number \(c\) as \(X\le c\), use the feasible counts, and check that acceptance and rejection probabilities sum to one.

Check Your Understanding

For each problem, identify the hypergeometric count and apply the stated inspection rule. Probabilities are rounded to four decimal places where needed.

  1. A hypothetical lot has \(N=15\) valves, of which \(K=3\) are defective. A sample of \(n=3\) is accepted only if it has no defectives. Find the acceptance probability. (Answer: \(220/455=44/91\approx0.4835\))
  2. A lot contains \(N=18\) miniature pumps, including \(K=4\) defectives. Four are sampled without replacement; acceptance allows at most one defective. Find the acceptance probability. (Answer: \(2457/3060\approx0.8029\))
  3. A hypothetical lot of \(N=20\) optical parts has exactly \(K=5\) defectives. A sample of \(n=4\) is rejected if it contains at least two defectives. Find the rejection probability. (Answer: \(1205/4845\approx0.2487\))
  4. A shipment has \(N=24\) fittings, of which \(K=6\) are defective. Inspect \(n=5\) without replacement and accept if at most one is defective. Find the acceptance probability. (Answer: \(26928/42504\approx0.6335\))
  5. A lot contains \(N=10\) units with exactly \(K=2\) defectives. What is the smallest sample size \(n\) for which the probability of finding both defectives is at least \(0.50\)? (Answer: \(n=8\), since \(P(\text{find both})=\binom{8}{2}/\binom{10}{2}=28/45\approx0.6222\), whereas for \(n=7\) it is \(21/45\approx0.4667\))
Clinical Biostats