When a customer buys a large quantity of a certain article from a producer, it is customary to inspect a random sample before acceptance. If the number of defective articles in the sample does not exceed the so-called acceptance number, the customer accepts the lot; otherwise, he rejects it. How can we determine the sample size and acceptance number so that there is less than 1 chance in 10 that a lot with 5% defectives is accepted and there are less than 5 chances in 100 that a lot with only 2% defectives is rejected?
The general form of this problem, posed by Pˇlya [Pˇlya, 1968] is known to anyone familiar with the basic principles of statistical analysis. Yet its solution takes a considerable amount of numerical work. Pˇlya remarks: "We shall not discuss the numerical work." So in this respect, our discussion starts where Pˇlya stops.
First, we read in the appropriate standard package.
Then, we define the distribution function for the binomial distribution with parameters and .
The acceptance number is the 0.95-quantile of the binomial distribution with parameters and . It depends on the sample size .
Remember that we are looking for both the acceptance number and the sample size . If we had , we could also compute . Suppose now that . The probability of acceptance is then given by
and we are ready to look for the smallest such that this probability is less than . Here is a plot of for :
We zoom in between 260 and 360 to look for the smallest such that this probability is less than .
Using , we readily find the first index for which the probability is less than .
Thus the sample size is . The corresponding acceptance number is
and the problem is solved.
In practical applications there are typically many alternatives to the hypothesis. The probability of accepting the hypothesis, considered as a function whose domain is the set consisting of the hypothesis and all the alternatives, is called the operating characteristic of the test. Clearly, it is desirable that the value of this function at a given alternative be low or, equivalently, that the power of the test be high.
We conclude with a graphical illustration of the operating characteristic relevant to our problem.
Document converted by Mathematica of Wolfram Research