The algorithm described below determines the minimum cost parameter values (sample size n* and ac~eptance nUJ?ber c*) for single sample acceptance plans which incorporate mspec!or errors in quality control and auditing problems w~en th~ p~or distribution of lot or account quality and sampling distribution are discrete. In quality control, for example, such plans involve: (1) drawing a single sample of n items from a lot of size N, (2) determining the number of defective items, y, in the sample (perhaps erroneously observed ~d reported), and (3) rejecting the lot if more than c defectives are observed. In principle, three different approaches can be used to determine the parameter values for an error prone (or erro.r fr~e) single sample attribute acceptance plan when a cost crlten.on is applied. First, Bayesian decision tree methods can be .appbed to determine an exact optimal solution by complete implicit enumeration of all possible solutions (Raiffa & Schlaifer, 1961). However, this involves substantial computational effort, since all of the branches of the decision tree must be evaluated and the computations of the various probabilities, if in~pector error is involved can become onerous. Second, analytical methods can be used when the distribution of the lot fraction defective can be approximated by a standard density function such as the Beta or Polya distribution (Collins, 1974, and references cited therein). Although this procedure reduces the computational requirements, nonoptimal solutions to the real problem may be produced as a result of these approximations, since the densities may not be sufficiently rich to adequately capture the true prior distribution. Finally, direct num~rical search techniques can be used to reduce the computational effort, but such methods may not converge on an optimal solution because of the bumpy nature of the cost surface in such problems. The programmed algorithm described below is a general algorithm that determines the optimal par~meter values for Bayesian single sampling attribute plans With (or without) inspector error. It has been shown to be clearly superior to the above alternate approaches, produ~ing the optimal solution with minimal computational requirements over a wide range of problem types (Moskowitz & Fink, 1975). The algorithm is applicable to a broad range of acceptance sampling and auditing problems, assuming only that the sampling or auditing cost is either a linear or strictly convex function of the sample size. The algorithm can accommodate both constant as well as nonconstant inspector errors, which, for example, might reflect the effects of fatigue on inspector performance. Description. The program of the algorithm consists of three principal aspects: (1) recursion routines for generating the probability matrices relating the quality states (F), actual defectives (X), and reported or adjudged defectives (Y) for the sample