Acceptance sampling is a procedure used for sentencing incoming batches. Sampling plan consist of a sample size and a decision making rule. The sample size is the number of items to sample or the number of measurements to take. The decision making rule involves the acceptance threshold and a description of how to use the sample result to accept or reject the lot. Acceptance sampling plans are also practical tools for quality control applications, which involve quality contracting on product orders between the vendor and the buyer. Those sampling plans provide the vendor and the buyer rules for lot sentencing while meeting their preset requirements on product quality. Scientific sampling plans are the primary tools for quality and performance management in industry today. In an industrial plant, sampling plans are used to decide either to accept or reject a received batch of items. With attribute sampling plans, these accept/reject decisions are based on a count of the number of defective items. The sample size is assumed constant in traditional sampling plans.
In this section, several new decision making policies for the acceptance sampling problem are introduced. The objective of these models is to find constant control thresholds for lot sentencing problem.
The single stage acceptance sampling plan based on the control threshold policy is presented in section 2, the acceptance sampling policy based on number of successive conforming items is presented in section 3, and acceptance sampling policy using the minimum angle method is presented in sections 4. Acceptance sampling policy based on cumulative sum of conforming Items run lengths comes in section 5 and acceptance sampling policy based on Bayesian inference comes in section 6. Finally the chapter is concluded in section 7.
2. Single Stage Acceptance Sampling Plan based on the Control Threshold Policy 
We suppose a batch of size is received which its proportion of the defectives items is equal to . For a batch of size , random variable is defined as the number of inspected items and is defined as the number of items classified as 'defective' after inspection. The number of inspected items has an upper threshold equal to . For inspected items ( ) the batch will be rejected if where is the upper control level for batch acceptance. In the other words, when the number of defective items in the inspected items gets more than the control threshold then decision making process stops and the batch is rejected.
The probability distribution function of is determined by the following equations,
In Eq. (1), indicates that all items are inspected therefore, the number of defective items has been less than or defective item has been inspected item. For the case , defective item has been inspected item thus, the probability distribution function of follows a negative binomial distribution. The expected mean of the number of inspected items is determined as follows:
Since is a negative binomial distribution thus using the approximation method of estimating negative binomial probabilities with Poisson distribution , following is concluded,
where is the parameter of Poisson distribution. In order to improve the accuracy of this approximation, and should be sufficiently large numbers. Using the above approximation method, following is concluded,
Now, let denotes the probability of rejecting the batch. The batch is rejected if the number of defective items is more than or equal to thus the value of is determined by the following equation,
In order to calculate the total cost, including the cost of rejecting the batch, the cost of inspection and the cost of defective items, assume is the cost of rejecting the batch, is the inspection cost of one item and is the cost of one defective item, so the total cost, , is determined by conditioning on two events of rejecting or accepting the batch, thus the objective function is written as follows:
Thus we have,
In Eq. (7), is the total cost of inspection and is the total cost of defective items. The optimal value of is determined by minimizing the value of objective function . Using the optimization methods, it is concluded that,
To evaluate above equation, following equality is considered,
Since is a sufficiently large number thus the value of is approximately equal to zero therefore it is concluded that,
To ensure that minimizes the objective function (7), it is necessary to find the value of that satisfies following inequalities:
Now If , then,
Since with increasing the value of the value of binomial distribution with parameters and decreases thus according to the properties of binomial distribution, it is concluded that therefore, the optimal value of is determined using the following formula,
Also The objective function, , should be minimized regarding two constraints on Type-I and Type-II errors associated with the acceptance sampling plans. Type-I error is the probability of rejecting the batch when the nonconformity proportion of the batch is acceptable. Type-II error is the probability of accepting the batch when the nonconforming proportion of the batch is not acceptable. Then, in one hand, if , the probability of rejecting the batch should be less than . On the other hand, in case where , the probability of accepting the batch should be less than where is the AQL (Accepted Quality Level ) and is the LQL (Limiting Quality Level) and is the probability of Type-I error and is the probability of Type-II error in making a decision, therefore, the optimal value of is determined using the following formula,
When , It is concluded that Eq. (16) is positive for all values of so . In this case, if one defective item is found in an inspected sample then the batch would be rejected. In this case, the rejection cost is less than the total cost of inspecting items and the cost of defective items, hence rejecting the batch would be the optimal decision. However, in practice the rejection cost is usually big enough so that, we overlooked that case.
3. Acceptance Sampling Policy Based on Number of Successive Conforming Items 
In a typical acceptance-sampling plan, when the number of conforming items between successive nonconforming items is more than an upper control threshold, the batch is accepted, and when it is less than a lower control threshold, the batch is rejected otherwise, the inspection process continues. This initiates the idea of employing a Markovian approach to model the acceptance-sampling problem. As a result, in this method, a new acceptance-sampling policy using Markovian models is proposed, in which determining the control thresholds are aimed. The notations required to model the problem at hand are given as:
: The number of items in the batch
: The proportion of nonconforming items in the batch
: The cost of inspecting one item
: The cost of one nonconforming item
: The cost of rejecting the batch
: The expected total cost of the system
: The expected total cost of accepting the batch
: The expected total cost of rejecting the batch
: The expected total cost of inspecting the items of the batch
: The upper control threshold
: The lower control threshold
Consider an incoming batch of items with a proportion of nonconformities , of which items are randomly selected for inspection and based on the number of conforming items between two successive nonconforming items, the batch is accepted, rejected, or the inspection continues. The expected total cost associated with this inspection policy can be expressed using Eq. (17).
Let be the number of conforming items between the successive and nonconforming items, the upper and the lower control thresholds. Then, if the batch is accepted, if the batch is rejected. Otherwise, if the process of inspecting items continues. The states involved in this process can be defined as follows.
State 1: falls within two control thresholds L, i.e., , thus the inspection process continues.
State 2: is more than or equal the upper control threshold, i.e., , hence the batch is accepted.
State 3: is less than or equal the lower control threshold, i.e., , hence the batch is rejected.
The transition probabilities among the states can be obtained as follows.
Probability of inspecting more items=
Probability of accepting the batch=
Probability of rejecting the batch=
where the probabilities can be obtained based on the fact that the number of conforming items between the successive and nonconforming items, , follows a geometric distribution with parameter , i.e., Then, the transition probability matrix is expressed as follows:
As it can be seen, the matrix is an absorbing Markov chain with states 2 and 3 being absorbing and state 1 being transient.
To analyze the above absorbing Markov chain, the transition probability matrix should be rearranged in the following form:
Rearranging the matrix yields the following matrix:
Then, the fundamental matrix can be obtained as follows ,
Where is the identity matrix and denotes the expected long-run number of times the transient state 1 is occupied before absorption occurs (i.e., accepted or rejected), given that the initial state is 1. The long-run absorption probability matrix, , is calculated as follows ,
The elements of the matrix, , denote the probabilities of the batch being accepted or rejected, respectively.
The expected cost can be obtained using Eq. (17) containing the batch acceptance, rejection, and inspection costs. The expected acceptance cost is the cost of nonconforming items ( ) multiplied by the probability of the batch being accepted (i.e., ). The expected rejection cost is the rejection cost ( ) multiplied by the probability of the batch being rejected (i.e., ). Moreover, is the expected long-run number of times the transient state 1 is occupied before absorption occurs. Knowing that in each visit to transient state, the average number of inspections is (the mean of the geometric distribution), the expected inspection cost is given by
Therefore, the expected cost for acceptance-sampling policy can be expressed as a function of and as follows:
Substituting for and , the expected cost equation can be rewritten as:
Eq. (25) can be solved numerically using search algorithms to find and that minimize the expected total cost. The objective function, , should be minimized regarding two constraints on Type-I and Type-II errors associated with the acceptance sampling plans. Type-I error is the probability of rejecting the batch when the nonconformity proportion of the batch is acceptable. Type-II error is the probability of accepting the batch when the nonconforming proportion of the batch is not acceptable. Then, in one hand, if , the probability of rejecting the batch should be less than . On the other hand, in case where , the probability of accepting the batch should be less than where and are the probabilities of Type-I and Type-II errors, hence,
The optimum values of and among a set of alternative values are determined solving the model given in (25), numerically, where the probabilities are obtained using the geometric distribution.
4. Acceptance Sampling Policy Using the Minimum Angle Method based on Number of Successive Conforming Items 
The practical performance of any sampling plan is determined through its operating characteristic curve. When producer and consumer are negotiating for designing sampling plans, it is important especially to minimize the consumer risk. In order to minimize the consumer’s risk, the ideal OC curve could be made to pass as closely through , . One approach to minimize the consumers risks for ideal condition is proposed with minimization of angle between the lines joining the points , and , . Therefore in this case, the value of performance criteria in minimum angle method will be ,
where is the probability of accepting the batch when the proportion of defective items in the batch is respectively . Assume is the point , is the point and is the point thus the smaller value of , the angle approaching zero, and the chord approaching , the ideal condition.
The values of are determined as follows,
Since the values of are constant and therefore the objective function is determined as follows,
Another performance measure of acceptance sampling plans is the expected number of inspected items. Since sampling and inspecting usually has cost, therefore designs that minimizes this measure and satisfy the first and second type error inequalities are considered to be optimal sampling plans. Since the proportion of defective items is not known in the start of process, in order to consider this property in designing the acceptance sampling plans, we try to minimize the expected number of inspected items for acceptable and not acceptable lots simultaneously. Therefore the optimal acceptance sampling plan should have three properties, first it should have a minimized value in the objective function of the minimum angle method that is resulted from the ideal OC curve and also it should minimize the expected number of inspected items either in the decisions of rejecting or accepting the lot. Therefore the second objective function is defined as the expected number of items inspected. The value of this objective function is determined based on the value of where is the expected number of times in the long run that the transient state 1 is occupied before absorption occurs, since in each visit to transient state, the average number of inspections is , consequently the expected number of items inspected is given by . Now the objective functions and are defined as the expected number of items inspected respectively in the acceptable condition and not acceptable condition .
Now one approach to optimize the objective functions simultaneously is to define control thresholds for objective functions and then trying to minimize the value of objective function . For example if parameters are defined as the upper control thresholds for then the optimization problem can be defined as follows,
Optimal values of can be determined by solving above nonlinear optimization problem using search procedures or other optimization tools.
5. Acceptance Sampling Policy Based on Cumulative Sum of Conforming Items Run Lengths 
In an acceptance-sampling plan, assume is the number of conforming items between the successive and defective items. Decision making is based on the value of that is defined as,
The proposed acceptance sampling policy is defined as follows,
If then the batch is accepted
If the batch is rejected
If the process of inspecting the items continues
where is the upper control threshold and is the lower control threshold.
In each stage of the data gathering process, the index of different states of the Markov model, , is defined as:
represents the state of rejecting the batch. In this state thus the batch is rejected.
where represents the state of continuing data gathering. In this state, thus the inspecting process continues.
represents the state of accepting the batch. In this state hence the batch is accepted.
In other word, the acceptance-sampling plan can be expressed by a Markov model, in which the transition probability matrix among the states of the batch can be expressed as:
where, is probability of going from state to state in a single step and denotes the number of conforming items between the successive defective items and where denotes the proportion of defective items in the batch.
The values of are determined based on the relations among the states, for example where then according to the definition of , it is concluded that and transition probability of going form state to state is equal to the probability of rejecting the batch that is evaluated as follows,
In the other case where, , based on the definition of , we have thus it is concluded that
In the other case where, , then according to the definition of , we have thus it is concluded that,
In the other case where, , then according to the definition of j, we have thus it is concluded that,
As a result, when and for example, the transition probability matrix among the states of the system can be expressed as:
And it can be seen the matrix is an absorbing Markov chain with states 1 and 5 being absorbing and states 2, 3, and 4 being transient.
Analyzing the above absorbing Markov chain requires to rearrange the single-step probability matrix in the following form:
where is the identity matrix representing the probability of staying in a state that is defined as follows
is the probability matrix of escaping an absorbing state (always zero) that is defined as follows
is a square matrix containing the transition probabilities of going from a non-absorbing state to another non-absorbing state that is defined as follows
And is the Matrix containing all probabilities of going from a non-absorbing state to an absorbing state (i.e., accepted or rejected batch) that is defined as follows
Rearranging the matrix in the latter form yields the following:
Bowling et. al.  proposed an absorbing Markov chain model for determining the optimal process means. According to their method, matrix that is the fundamental matrix containing the expected number of transitions from a non-absorbing state to another non-absorbing state before absorption occurs can be obtained by the following equation,
For the above numerical example, i.e., when and , the fundamental matrix can be obtained as:
where is the identity matrix.
Since represents the expected number of the times in the long-run the transient state is occupied before absorption occurs (i.e., before accepted or rejected), and matrix is the absorption probability matrix containing the long run probabilities of the transition from a non-absorbing state to an absorbing state. The long-run absorption probability matrix, , can be calculated as follows:
Again when and , the elements of represent the probabilities of the batch being accepted and rejected, respectively, given that the initial state is . In this case, the probability of accepting the batch is obtained as:
Also the expected number of inspected items will be determined as follows,
This new acceptance-sampling plan should satisfy two constraints of the first and the second types of errors. The probability of Type-I error shows the probability of rejecting the batch when the defective proportion of the batch is acceptable. The probability of Type-II error is the probability of accepting the batch when the defective proportion of the batch is not acceptable. Then on the one hand if , the probability of rejecting the batch will be less than and on the other hand, in case where , the probability of accepting the batch will be less than where and are the probabilities of Type-I and Type-II errors. Hence,
From the inequalities in (50), the proper values of the thresholds and are determined and among the feasible ones, we select one that has the least value for expected number of inspected items that is obtained using Eq. (49).
6. A New Acceptance Sampling Design Using Bayesian Modelling and Backwards Induction 
In this research, a new selection approach on the choices between accepting and rejecting a batch based on Bayesian modelling and backwards induction is proposed. The Bayesian modelling is utilized to model the uncertainty involved in the probability distribution of the nonconforming proportion of the items and the backwards induction method is employed to determine the sample size. Moreover, when the decision on accepting or rejecting a batch cannot be made, we assume additional observations can be gathered with a cost to update the probability distribution of the nonconforming proportion of the batch. In other words, a mathematical model is developed in this research to design optimal single sampling plans. This model finds the optimum sampling design whereas its optimality is resulted by using the decision tree approach. As a result, the main contribution of the method is to model the acceptance-sampling problem as a cost optimization model so that the optimal solution can be achieved via using the decision tree approach. In this approach, the required probabilities of decision tree are determined employing the Bayesian Inference. To do this, the probability distribution function of nonconforming proportion of items is first determined by Bayesian inference using a non-informative prior distribution. Then, the required probabilities are determined by applying Bayesian inference in the backward induction method of the decision tree approach. Since this model is completely designed based on the Bayesian inference and no approximation is needed, it can be viewed as a new tool to be used by practitioners in real case problems to design an economically optimal acceptance-sampling plan. However, the main limitation of the proposed methodology is that it can only be applied to items not requiring very low fractions of nonconformities.
The following notations are used throughout the paper.
Set of decisions: is defined the set of possible decisions where and refer to accepting and rejecting the batch, respectively.
State space: is defined the state of the process where represents nonconforming proportion items of the batch in state of the process. The decision maker believes the consequences of selecting decision or depend on that cannot be determined with certainty. However, the probability distribution function of the random variable can be obtained using Bayesian inference.
Set of experiments: is the set of experiments to gather more information on and consequently to update the probability distribution of . Further, is defined an experiment in which items of the batch are inspected.
Sample space: denotes the outcomes of experiment where shows the number of nonconforming items in .
Cost function: The function on denotes the cost associated with performing experiment , observing , making decision , and finding .
: The total number of items in a batch
: The cost of rejecting a batch
: The cost of one nonconforming item
: The cost of inspecting one item
: An upper bound on the number of inspected item
6.2. Problem Definition
Consider a batch of size with an unknown percentage of nonconforming and assume items are randomly selected for inspection. Based on the outcome of the inspection process in terms of the observed number of nonconforming items, the decision-maker desires to accept the batch, reject it, or to perform more inspections by taking more samples. As Raiffa & Schlaifer  stated "the problem is how the decision maker chose and then, having observed , choose such that is minimized. Although the decision maker has full control over his choice of and , he has neither control over the choices of nor . However, we can assume he is able to assign probability distribution function over these choices." They formulated this problem in the framework of the decision tree approach, the one that is partially adapted in this research as well.
6.3. Bayesian Modelling
For a nonconforming proportion , referring to Jeffrey’s prior (Nair et al. ), we first take a Beta prior distribution with parameters and to model the absolute uncertainty. Then, the posterior probability density function of using a sample of inspected items is
where is the number of nonconforming items and is the number of conforming items in the sample. Moreover, to allow more flexibility in representing prior uncertainty it is convenient to define a discrete distribution by discretization of the Beta density (Mazzuchi, & Soyer ). In other words, we define the prior distribution for as
Now, define the experiment in which nonconforming items are found when items are inspected. Then, the sample space becomes , resulting in the cost function representation of that is associated with taking a sample of items, observing nonconforming and adopting when the defective proportion is . Using the notations defined, the cost function is determined by the following equations:
Moreover, the probability of finding nonconforming items in a sample of inspected items, i.e., , can be obtained using a binomial distribution with parameters as:
Hence, the probability can be calculated as follows
In other words, applying the Bayesian rule, the probability can be obtained by
In the next Section, a backward induction approach is taken to determine the optimal sample size.
6.4. Backward Induction
The analysis continues by working backwards from the terminal decisions of the decision tree to the base of the tree, instead of starting by asking which experiment the decision maker should select when he does not know the outcomes of the random events. This method of working back from the outermost branches of the decision tree to the initial starting point is often called "backwards induction" . As a result, the steps involved in the solution algorithm of the problem at hand using the backwards induction becomes
2. The conditional probability is determined using Eq. (57).
3. With a known history , since is a random variable, the costs of various possible terminal decisions are uncertain. Therefore the cost of any decision for the given is set as a random variable . Applying the conditional expectation, , which takes the expected value of with respect to the conditional probability (Eq. 57), the conditional expected value of the cost function on state variable is determined by the following equation.
4. Since the objective is to minimize the expected cost, the cost of having history and the choice of decision (accepting or rejecting) can be determined by
5. The conditional probability is determined using Eq. (56).
6. The costs of various possible experiments are random because the outcome is a random variable. Defining a probability distribution function over the results of experiments and taking expected values, we can determine the expected cost of each experiment. The conditional expected value of function on the variable is determined by the following equation.
7. Now the minimum of the values would be the optimal decision, which leads to an optimal sample size.
Acceptance sampling plans have been widely used in industry to determine whether a specific batch of manufactured or purchased items satisfy a pre-specified quality. In this chapter, new models for determining optimal acceptance sampling plans have been presented. The relationship between the cost model and a decision theory model with probabilistic utilities has been investigated. However, the acceptance sampling plan, which are derived from the optimization of these models, may differ substantially from the plans that other economic approaches suggest but optimization of these models are simple and efficient, with negligible computational requirements. In next sections, a new methodology based on Markov chain was developed to design proper lot acceptance sampling plans. In the proposed procedure, the sum of two successive numbers of nonconforming items was monitored using two lower and upper thresholds, where the proper values of these thresholds could be determined numerically using a Markovian approach based on the two points on OC curve. In last section, based on the Bayesian modelling and the backwards induction method of the decision-tree approach, a sampling plan is developed to deal with the lot-sentencing problem; aiming to determine an optimal sample size to provide desired levels of protection for customers as well as manufacturers. A logical analysis of the choices between accepting and rejecting a batch is made when the distribution function of nonconforming proportion could be updated by taking additional observations and using Bayesian modelling.
Fallahnezhad M. S. Hosseininasab H. 2011 Designing a Single Stage Acceptance Sampling Plan based on the control Threshold policy. 22 3 143 150
Hilbe J. M. 2007 Negative Binomial Regression. Cambridge, UK : Cambridge University Press
Fallahnezhad M. S. Niaki S. T. A. 2011 A New Acceptance Sampling Policy Based on Number of Successive Conforming Items.
Bowling S. R. Khasawneh M. T. Kaewkuekool S. Cho B. R. 2004 A Markovian approach to determining optimum process target levels for a multi-stage serial production system. 159 636
Fallahnezhad M. S. 2012 A New Approach for Acceptance Sampling Policy Based on the Number of Successive Conforming Items and Minimum Angle Method. 3 1 104 111
Soundararajan V. Christina A. L. 1997 Selection of single sampling variables plans based on the minimum angle. 24 2 207 218
Fallahnezhad M. S. Niaki S. T. A. Abooie M. H. 2011 A New Acceptance Sampling Plan Based on Cumulative Sums of Conforming Run-Lengths. 4 4 256 264
Fallahnezhad M. S. Niaki S. T. A. Vahdat M. A. 2012 A New Acceptance Sampling Design Using Bayesian Modeling and Backwards Induction. 25 1 45 54
Raiffa H. 2000 Schlaifer R. Applied statistical decision theory. New York Wiley Classical Library
Nair V. N. Tang B. Xu L. 2001 Bayesian inference for some mixture problems in quality and reliability. 33 16
Mazzuchi T. A. Soyer R. 1996 Adaptive Bayesian replacement strategies.(J.M. Bernardo, J. O. Berger, A. P. Dawid, and A. F. M. Smith, eds.) Elsevier 667 674