# Decision Problem on Imperfect Inspections Combined under Two-Stage Inspection Policy
## 3 Two-Stage Inspection Policy with Imperfect Second Stage-Methodology
### Mathematical Model of Two-Stage Inspection Policy
\begin{array}{c}F_{II}(t_{i},T,n\_II\_1,n\_II\_2)=\sum\limits_{z=1}^{z=i}P\{t_ {z-1}<U<t_{z}\ \wedge\ t_{i-1}<U+H<t_{i}\}\cdot(1-\alpha_{n\_II\_1}\cdot\alpha_{n\_II\_2})^{z-1 }=\\ \qquad=\sum_{z=1}^{z=i}\int_{t_{z-1}}^{t_{z}}f_{U}(x)\cdot[F_{H}(t_{i}-x)-F_{ H}(max\{t_{i-1}-x,0\})]dx\cdot(1-\alpha_{n\_II\_1}\cdot\alpha_{n\_II\_2})^{z-1 }\end{array}  \tag{2}\]  
The probability that the system is in the defective state when the \(i\)-th inspection takes place should be estimated like in the previous case. The probability results from the following scenarios:  
1. a defect appeared in the system during a previous inspection interval, however, it became undiscovered due to false negative inspections, and the system is still in the defective state at the moment \(t_{i}\);
2. the defect came after the (\(i\)-1)-th inspection, and the system still operates at the moment \(t_{i}\). Thus, the defective state probability is:  
\[ \begin{array}{c}D_{II}(t_{i},T,n\_II\_1,n\_II\_2)=\sum\limits_{z=1}^{z=i}P\{t _{z-1}<U<t_{z}\ \wedge\ U+H>t_{i}\}\cdot\beta_{n\_II\_1}^{i-z}\cdot(1-\alpha_{n\_II\_1}\cdot \alpha_{n\_II\_2})^{z-1}=\\ \qquad=\sum_{z=1}^{z=i}\int_{t_{z-1}}^{t_{z}}f_{U}(x)\cdot[1-F_{H}(t_{i}-x)]dx \cdot\beta_{n\_II\_1}^{i-z}\cdot(1-\alpha_{n\_II\_1}\cdot\alpha_{n\_II\_2})^{ z-1}\end{array}  \tag{3}\]  
If \(\beta_{n\_II\_1}=0\), Expression 3 changes into:  
\[ \begin{array}{c}D_{II}(t_{i},T,n\_II\_1,n\_II\_2)=\sum\limits_{z=1}^{z=i}P\{ t_{z-1}<U<t_{z}\ \wedge\ U+H>t_{i}\}\cdot(1-\alpha_{n\_II\_1}\cdot\alpha_{n\_II\_2})^{z-1}=\\ \qquad=\sum_{z=1}^{z=i}\int_{t_{z-1}}^{t_{z}}f_{U}(x)\cdot[1-F_{H}(t_{i}-x)]dx \cdot(1-\alpha_{n\_II\_1}\cdot\alpha_{n\_II\_2})^{z-1}\end{array}  \tag{4}\]  
The probability of system being in the good state at the moment of \(i\)-th inspection is independent of the probability of the false negative mistake, and can be calculated:  
\[ \begin{array}{c}R_{II}(t_{i},T,n\_II\_1,n\_II\_2)=P\{U>t_{i}\}\cdot(1-\alpha _{n\_II\_1}\cdot\alpha_{n\_II\_2})^{i-1}=(1-F_{U}(t_{i}))\cdot(1-\alpha_{n\_II \_1}\cdot\alpha_{n\_II\_2})^{i-1}\end{array}  \tag{5}\]  
Based on Probabilities 1-5, one can formulate the expected number of events that can take place during a renewal cycle of the system. The expected number of failures in a renewal cycle is equal:  
\[ \begin{array}{c}NF_{II}(T,n\_II\_1,n\_II\_2)=\sum\limits_{i=1}^{\infty}F_{II }(t_{i},T,n\_II\_1,n\_II\_2)\end{array}  \tag{6}\]  
The considered system may end its renewal cycle as the result of two exclusive possibilities-it may fail or may be preventively renewed if a defect is recognised. Thus, the expected number of preventive replacements of the system is:  
\[\begin{array}{c}ND_{II}(T,n\_II\_1,n\_II\_2)=\left\{ \begin{array}{c}\sum \limits_{i=1}^{\infty}D_{II}(t_{i},T,n\_II\_1,n\_II\_2)\cdot(1-\beta_{n\_II\_1})+ \\ \sum\limits_{i=1}^{\infty}R_{II}(t_{i},T,n\_II\_1,n\_II\_2)\cdot\alpha_{n\_II \_1}\cdot\alpha_{n\_II\_2}\end{array} \right\}=1-NF_{II}(T,n\_II\_1,n\_II\_2) (7)  
The expected number of inspections is the sum of inspections carried out in the first and the second stages of an inspection. Their numbers, respectively, can be calculated according to the Formulas 8-9. The number of the first-stage inspections is:  
\[\begin{array}{c}NI\_1 st_{II}(T,n\_II\_1,n\_II\_2)=\sum_{i=1}^{\infty}R_{II}(t _{i},T,n\_II\_1,n\_II\_2)+\sum_{i=1}^{\infty}D_{II}(t_{i},T,n\_II\_1,n\_II\_2) (8)  
The expected number of the second-stage inspections is equal:  
\[ \begin{array}{c}NI\_2 st_{II}(T,n\_II\_1,n\_II\_2)=\sum_{i=1}^{\infty}R_{II}(t _{i},T,n\_II\_1,n\_II\_2)\cdot\alpha_{n\_II\_1}\\ +\sum_{i=1}^{\infty}D_{II}(t_{i},T,n\_II\_1,n\_II\_2)\cdot(1-\beta_{n\_II\_1}) \end{array}  \tag{9}\]  
\[ \begin{array}{c}D_{I}(t_{i},T,n\_l\_1)=\sum\limits_{z=1}^{z=i}P\{t_{z-1}<U<t_{z} \ \wedge\ U+H>t_{i}\}\cdot\beta_{n\_l\_1}^{i-z}.(1-\alpha_{n\_l\_1})^{z-1}=\\ =\sum\
olimits_{z=1}^{z=i}\int_{t_{z-1}}^{t_{z}}f_{I}(x)\cdot[1-F_{H}(t_{i}-x) ]dx\cdot\beta_{n\_l\_1}^{i-z}.(1-\alpha_{n\_l\_1})^{z-1}\end{array}