**6. A New Acceptance Sampling Design Using Bayesian Modelling and Backwards Induction [8]**

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 de‐ termined 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.

#### **6.1. Notations**

The following notations are used throughout the paper.

Set of decisions: *A*={*a*1, *a*2}is defined the set of possible decisions where *a*1 and *a*2 refer to ac‐ cepting and rejecting the batch, respectively.

State space: *P* ={*pl* ; *l* =1, 2, ...; 0< *pl* <1}is defined the state of the process where *pl* represents nonconforming proportion items of the batch in *l th* state of the process. The decision maker believes the consequences of selecting decision*a*1 or *a*2 depend on *P* that cannot be deter‐ mined with certainty. However, the probability distribution function of the random variable *p* can be obtained using Bayesian inference.

Set of experiments: *E* ={*ei* ;*i* =1, 2, ...}is the set of experiments to gather more information on *p*and consequently to update the probability distribution of*p*. Further, *ei* is defined an ex‐ periment in which *i*items of the batch are inspected.

Sample space: *Z* ={*zj* ; *j* =0, 1, 2, ..., *i*}denotes the outcomes of experiment *ei* where *zj* shows the number of nonconforming items in*ei* .

Cost function: The function *u*(*e*, *z*, *a*, *p*) on *E* ×*Z* × *A*×*P* denotes the cost associated with per‐ forming experiment*e*, observing*z*, making decision*a*, and finding*p*.


*p* = *AQL* →Probability of accepting the batch≥1−*α*

From the inequalities in (50), the proper values of the thresholds *L* and *U* are determined and among the feasible ones, we select one that has the least value for expected number of

**6. A New Acceptance Sampling Design Using Bayesian Modelling and**

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 de‐ termined 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

Set of decisions: *A*={*a*1, *a*2}is defined the set of possible decisions where *a*1 and *a*2 refer to ac‐

nonconforming proportion items of the batch in *l th* state of the process. The decision maker believes the consequences of selecting decision*a*1 or *a*2 depend on *P* that cannot be deter‐

; *l* =1, 2, ...; 0< *pl* <1}is defined the state of the process where *pl*

(50)

represents

*p* = *LQL* →Probability of accepting the batch≤*β*

inspected items that is obtained using Eq. (49).

requiring very low fractions of nonconformities.

cepting and rejecting the batch, respectively.

The following notations are used throughout the paper.

**6.1. Notations**

State space: *P* ={*pl*

**Backwards Induction [8]**

70 Practical Concepts of Quality Control


#### **6.2. Problem Definition**

Consider a batch of size *N* with an unknown percentage of nonconforming *p* and assume *m* 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 ac‐ cept the batch, reject it, or to perform more inspections by taking more samples. As Raiffa & Schlaifer [9] stated "the problem is how the decision maker chose *e*and then, having ob‐ served*z*, choose *e*such that *u*(*e*, *z*, *a*, *p*) is minimized. Although the decision maker has full control over his choice of *e*and*a*, he has neither control over the choices of *z*nor*p*. 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*p*, referring to Jeffrey's prior (Nair et al. [10]), we first take a Beta prior distribution with parameters *v*<sup>0</sup> =0.5 and *u*<sup>0</sup> =0.5 to model the absolute uncertainty. Then, the posterior probability density function of *p* using a sample of *v* + *u* inspected items is

$$f\left(p\right) = \text{Beta}\left(v + 0.5, \,\mu + 0.5\right) = \frac{\Gamma\left(v + \mu + 1\right)}{\Gamma\left(v + 0.5\right)\Gamma\left(u + 0.5\right)} \, p^{\,\,v - 0.5} (1 - p)^{\,\,u - 0.5} \tag{51}$$

where *v*is the number of nonconforming items and *u* is the number of conforming items in the sample. Moreover, to allow more flexibility in representing prior uncertainty it is con‐ venient to define a discrete distribution by discretization of the Beta density (Mazzuchi, & Soyer [11]). In other words, we define the prior distribution for *pl* as

$$\Pr\{p = p\_l\} = \int\_{p\_1 \stackrel{\delta}{\to} \frac{\delta}{2}}^{p\_1 \stackrel{\delta}{\to} \frac{\delta}{2}} f\left(p\right) dp\tag{52}$$

Pr{*z* = *zj* |*e* =*ei*

Pr{*p* = *p*<sup>1</sup> | *z* = *zj*

=∑ *l*=1 *m* (*Cj i p*1 *j*

=

2. The conditional probability Pr{*p* = *pl* | *z* = *zj*

*Cj i p*1 *j*

∑ *k*=1 *m Cj i pk j*

tained by

ple size.

respectively.

lowing equation.

**6.4. Backward Induction**

} =∑ *l*=1 *m*

(1− *p*1)*<sup>i</sup>*<sup>−</sup> *<sup>j</sup> ∫*

*<sup>p</sup>*1−*<sup>δ</sup>* 2

In other words, applying the Bayesian rule, the probability Pr{*p* = *pl* | *z* = *zj*

, *e* =*ei* } =

> *pl* −*δ* 2

> > *pk*−*<sup>δ</sup>* 2

> > *pk*+*<sup>δ</sup>* 2

*f* (*p*)*dp*

*f* (*p*)*dp*

In the next Section, a backward induction approach is taken to determine the optimal sam‐

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 *e*the decision maker should select when he does not know the outcomes of the random events. This meth‐ od of working back from the outermost branches of the decision tree to the initial starting point is often called "backwards induction" [9]. As a result, the steps involved in the solution

1. Probabilities Pr{*p* = *pl*} and Pr{( *j*, *i*)| *p* = *pl*} are determined using Eq. (52) and Eq. (54),

, *e* =*ei*

3. With a known history(*e*, *z*), since *p*is a random variable, the costs of various possible ter‐ minal decisions are uncertain. Therefore the cost of any decision *a* for the given (*e*, *z*) is set as a random variable*u*(*e*, *z*, *a*, *p*). Applying the conditional expectation, *Ep*<sup>|</sup>*z*, which takes the expected value of *u*(*e*, *z*, *a*, *p*) with respect to the conditional probability *Pp*<sup>|</sup>*z*(Eq. 57), the conditional expected value of the cost function on state variable *p*1 is determined by the fol‐

*pl* +*δ* 2

(1− *p*1)*<sup>i</sup>*<sup>−</sup> *<sup>j</sup> ∫*

(1− *pk* )*i*<sup>−</sup> *<sup>j</sup> ∫*

algorithm of the problem at hand using the backwards induction becomes

*<sup>p</sup>*1+*<sup>δ</sup>* 2

Pr{*p* = *p*1, *z* = *zj* |*e* =*ei*

Pr{*p* = *p*1, *z* = *zj* |*e* =*ei*

Pr{*z* = *zj* |*e* =*ei*

}Pr{*p* = *pl*}

}

} is determined using Eq. (57).

}

*<sup>f</sup>* (*p*)*dp*) (56)

, *e* =*ei*

New Models of Acceptance Sampling Plans http://dx.doi.org/10.5772/50835

} can be ob‐

73

(57)

where *p*<sup>1</sup> =( <sup>2</sup>*<sup>l</sup>* <sup>−</sup> <sup>1</sup> <sup>2</sup> )*<sup>δ</sup>* and *<sup>δ</sup>*<sup>=</sup> <sup>1</sup> *<sup>m</sup>* for *l* =1, 2, ..., *m*

Now, define ( *j*, *i*);*i* =1, 2, ..., *n*and *j* =0, 1, 2, ..., *i* the experiment in which *j* nonconforming items are found when *i*items are inspected. Then, the sample space *Z* becomes *Z* ={( *j*, *i*):0≤ *j* ≤*i* ≤*n*}, resulting in the cost function representation of *u ei* , ( *j*, *i*), *ak* , *p*<sup>1</sup> ; *k* =1, 2 that is associated with taking a sample of *i*items, observing *j*nonconforming and adopting *a*1or *a*2when the defective proportion is*pl* . Using the notations defined, the cost function is determined by the following equations:

$$\begin{aligned} \text{(1) for accepted batch} \\ u(e\_{i'} \text{ (j, i), } a\_{1'} \ p\_1) &= \text{CN} \ p\_1 + \text{Se}\_i \\ \text{(2) for rejected batch} \\ u(e\_{i'} \text{ (j, i), } a\_{2'} \ p\_1) &= \text{R} + \text{Se}\_i \end{aligned} \tag{53}$$

Moreover, the probability of finding *j* nonconforming items in a sample of *i* inspected items, i.e., Pr{( *j*, *i*)| *p* = *p*1}, can be obtained using a binomial distribution with parameters (*i*, *p* = *pl*) as:

$$\Pr\{\left(j\_{\prime}\text{ i}\right)\mid p=p\_{1}\}=\mathbb{C}\_{\neq}^{i}p\_{1}^{j}(1-p\_{1})^{i-j}\tag{54}$$

Hence, the probability Pr{*p* = *p*1, *z* = *zj* |*e* =*ei* } can be calculated as follows

$$\Pr\{p = p\_1, \ z = z\_j \mid e = e\_i\} = \Pr\{z = z\_j \mid p = p\_1, \ e = e\_i\} \Pr\{p = p\_1\}$$

$$\mathbb{P}\_{p\_1 \stackrel{\rho\_1 \stackrel{\delta}{\le}}{\le}} \mathbb{P}\_2^{\stackrel{\rho\_1 \stackrel{\delta}{\le}}{\le}} \int f\{p\} dp$$

Thus,

$$\begin{aligned} \Pr\{z = z\_j \mid e = e\_i\} &= \sum\_{l=1}^m \Pr\{p = p\_{1^r} \mid z = z\_j \mid e = e\_i\} \Pr\{p = p\_l\} \\ &= \sum\_{l=1}^m \left( \mathsf{C}\_j^{-i} p\_1^{-j} (1 - p\_1)^{i-j} \int\_{p\_1^{-i}} f(p) dp \right) \end{aligned} \tag{56}$$

In other words, applying the Bayesian rule, the probability Pr{*p* = *pl* | *z* = *zj* , *e* =*ei* } can be ob‐ tained by

$$\Pr\{p = p\_1 \mid z = z\_{j^\*}, \ e = e\_i\} = \frac{\Pr\{p = p\_1, \ z = z\_j \mid e = e\_i\}}{\Pr\{z = z\_j \mid e = e\_i\}}$$

$$\frac{C\_j^{\
u} p\_1^{\langle \rangle} (1 - p\_1)^{j - j} \int\_{p\_1^{\triangleleft}} f(p) dp}{\sum\_{p\_1^{\triangleleft}}^{\infty} p\_2^{\triangleleft}}}{\sum\_{k = 1}^m C\_j^{\langle \rangle} p\_k^{\langle \rangle} (1 - p\_k)^{j - j} \int\_{p\_1^{\triangleleft}} f(p) dp}}\tag{57}$$

In the next Section, a backward induction approach is taken to determine the optimal sam‐ ple size.

#### **6.4. Backward Induction**

where *v*is the number of nonconforming items and *u* is the number of conforming items in the sample. Moreover, to allow more flexibility in representing prior uncertainty it is con‐ venient to define a discrete distribution by discretization of the Beta density (Mazzuchi, &

as

*f* (*p*)*dp* (52)

. Using the notations defined, the cost function is

(1− *p*1)*<sup>i</sup>*<sup>−</sup> *<sup>j</sup>* (54)

, ( *j*, *i*), *ak* , *p*<sup>1</sup> ; *k* =1, 2

(53)

(55)

Soyer [11]). In other words, we define the prior distribution for *pl*

where *p*<sup>1</sup> =( <sup>2</sup>*<sup>l</sup>* <sup>−</sup> <sup>1</sup>

72 Practical Concepts of Quality Control

(*i*, *p* = *pl*) as:

Thus,

<sup>2</sup> )*<sup>δ</sup>* and *<sup>δ</sup>*<sup>=</sup> <sup>1</sup>

*a*1or *a*2when the defective proportion is*pl*

Hence, the probability Pr{*p* = *p*1, *z* = *zj* |*e* =*ei*

=*Cj i p*1 *j*

Pr{*p* = *p*1, *z* = *zj* |*e* =*ei*

(1− *p*1)*<sup>i</sup>*<sup>−</sup> *<sup>j</sup> ∫*

*p*1− *δ* 2

*<sup>p</sup>*1+*<sup>δ</sup>* 2

*f* (*p*)*dp*

determined by the following equations:

Pr{*p* = *pl*} = *∫*

*<sup>m</sup>* for *l* =1, 2, ..., *m*

*Z* ={( *j*, *i*):0≤ *j* ≤*i* ≤*n*}, resulting in the cost function representation of *u ei*

1) for accepted batch

2) for rejected batch

Pr{( *j*, *i*)| *p* = *p*1} =*Cj*

*u*(*ei*

*u*(*ei*

*p*1− *δ* 2

Now, define ( *j*, *i*);*i* =1, 2, ..., *n*and *j* =0, 1, 2, ..., *i* the experiment in which *j* nonconforming items are found when *i*items are inspected. Then, the sample space *Z* becomes

that is associated with taking a sample of *i*items, observing *j*nonconforming and adopting

, ( *j*, *i*), *a*1, *p*1) =*CN p*<sup>1</sup> + *Sei*

, ( *j*, *i*), *a*2, *p*1) =*R* + *Sei*

Moreover, the probability of finding *j* nonconforming items in a sample of *i* inspected items, i.e., Pr{( *j*, *i*)| *p* = *p*1}, can be obtained using a binomial distribution with parameters

> *i p*1 *j*

} =Pr{*z* = *zj* | *p* = *p*1, *e* =*ei*

} can be calculated as follows

}Pr{*p* = *p*1}

*p*1+ *δ* 2

> 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 *e*the decision maker should select when he does not know the outcomes of the random events. This meth‐ od of working back from the outermost branches of the decision tree to the initial starting point is often called "backwards induction" [9]. As a result, the steps involved in the solution algorithm of the problem at hand using the backwards induction becomes

> 1. Probabilities Pr{*p* = *pl*} and Pr{( *j*, *i*)| *p* = *pl*} are determined using Eq. (52) and Eq. (54), respectively.

2. The conditional probability Pr{*p* = *pl* | *z* = *zj* , *e* =*ei* } is determined using Eq. (57).

3. With a known history(*e*, *z*), since *p*is a random variable, the costs of various possible ter‐ minal decisions are uncertain. Therefore the cost of any decision *a* for the given (*e*, *z*) is set as a random variable*u*(*e*, *z*, *a*, *p*). Applying the conditional expectation, *Ep*<sup>|</sup>*z*, which takes the expected value of *u*(*e*, *z*, *a*, *p*) with respect to the conditional probability *Pp*<sup>|</sup>*z*(Eq. 57), the conditional expected value of the cost function on state variable *p*1 is determined by the fol‐ lowing equation.

$$
\mu \uplus \text{ } \{e\_{i'} \ z\_{j'} \ a\_k\} = \sum\_{l=1}^{m} \left(\mu \uplus \text{ } \{e\_{i'} \ z\_{j'} \ a\_{k'} \ p\_1\} \text{Pr}\{p = p\_1 \mid z = z\_{j'} \ e = e\_i\}\right) \tag{58}
$$

4. Since the objective is to minimize the expected cost, the cost of having history (*e*, *z*) and the choice of decision (accepting or rejecting) can be determined by

$$
\mu \triangleq (e\_{i'} \ z\_{j}) = \min\_{a\_k} \mu \triangleq (e\_{i'} \ z\_{j'} \ a\_k) \tag{59}
$$

rejecting a batch is made when the distribution function of nonconforming proportion could

New Models of Acceptance Sampling Plans http://dx.doi.org/10.5772/50835 75

[1] Fallahnezhad, M. S., & Hosseininasab, H. (2011). Designing a Single Stage Accept‐ ance Sampling Plan based on the control Threshold policy. *International Journal of In‐*

[2] Hilbe, J. M. (2007). Negative Binomial Regression. Cambridge, UK, : Cambridge Uni‐

[3] Fallahnezhad, M. S., & Niaki, S. T. A. (2011). A New Acceptance Sampling Policy Based on Number of Successive Conforming Items. *To Appear in Communications in*

[4] Bowling, S. R., Khasawneh, M. T., Kaewkuekool, S., & Cho, B. R. (2004). A Markovi‐ an approach to determining optimum process target levels for a multi-stage serial

[5] Fallahnezhad, M. S. (2012). A New Approach for Acceptance Sampling Policy Based on the Number of Successive Conforming Items and Minimum Angle Method. *To*

[6] Soundararajan, V., & Christina, A. L. (1997). Selection of single sampling variables plans based on the minimum angle. *Journal of Applied Statistics*, 24(2), 207-218.

[7] Fallahnezhad, M. S., Niaki, S. T. A., & Abooie, M. H. (2011). A New Acceptance Sam‐ pling Plan Based on Cumulative Sums of Conforming Run-Lengths. *Journal of Indus‐*

[8] Fallahnezhad, M. S., Niaki, S. T. A., & Vahdat, M. A. (2012). A New Acceptance Sam‐ pling Design Using Bayesian Modeling and Backwards Induction. *International Jour‐*

[9] Raiffa, H. (2000). Schlaifer R. Applied statistical decision theory. New York, Wiley

production system. *European Journal of Operational Research*, 159-636.

*Appear in Iranian Journal of Operations Research.*, 3(1), 104-111.

*trial and Systems Engineering*, 4(4), 256-264.

*nal of Engineering, Islamic Republic of Iran*, 25(1), 45-54.

be updated by taking additional observations and using Bayesian modelling.

Address all correspondence to: Fallahnezhad@yazduni.ac.ir

Assistant Professor of Industrial Engineering, Yazd University, Iran

*dustrial Engineering & Production Research*, 22(3), 143-150.

**Author details**

**References**

versity Press.

Classical Library.

*Statistics-Theory and Methods.*

Mohammad Saber Fallah Nezhad\*

5. The conditional probability Pr{*z* = *zj* |*e* =*ei* } is determined using Eq. (56).

6. The costs of various possible experiments are random because the outcome *z*is a ran‐ dom 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 *u* \* (*ei* , *zj* ) on the variable *zj* is determined by the following equation.

$$
\mu^\*\left(e\_i\right) = \sum\_{j=0}^i \left\{ \mu^\*\left(e\_{i^\*} \mid z\_j\right) \text{Pr}\{z = z\_j \mid e = e\_i\} \right\} \tag{60}
$$

7. Now the minimum of the values *u* \*(*ei* ) would be the optimal decision, which leads to an optimal sample size.

$$
\mu \ast^\* = \min\_{e} \mu \ast^\* \text{ (} e\_i \text{)}
\\
= \min\_{e} E\_{z^\top e} \min\_{a} E\_{p^\top z} \mu (e\_{i^\prime} \text{ } z\_{j^\prime} \text{ } a\_{k^\prime} \text{ } p\_1) \tag{61}
$$

#### **7. Conclusion**

Acceptance sampling plans have been widely used in industry to determine whether a spe‐ cific batch of manufactured or purchased items satisfy a pre-specified quality. In this chap‐ ter, new models for determining optimal acceptance sampling plans have been presented. The relationship between the cost model and a decision theory model with probabilistic util‐ ities 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 econom‐ ic approaches suggest but optimization of these models are simple and efficient, with negli‐ gible computational requirements. In next sections, a new methodology based on Markov chain was developed to design proper lot acceptance sampling plans. In the proposed proce‐ dure, 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 deter‐ mined 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 prob‐ lem; 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.
