\documentclass[a4paper,12pt]{article}
\begin{document}
\parindent=0pt

QUESTION

Large batches of components are delivered to two factories $A$
   and $B.$ Each batch is subjected to an acceptance sampling scheme
   as follows:

   Factory $A$: Accept the batch if a random sample of 10 components
   contains less than 2 defectives. Otherwise reject the batch.

   Factory $B$:Take a random sample of 5 components. Accept the
   batch if this sample contains no defectives. Reject the batch
   if this sample contains 2 or more defectives. If the sample
   contains 1 defective, take a further sample of 5 and accept the
   batch if this sample contains no defectives.

   If the fraction defective in the batch is $p,$ find the
   probabilities of accepting a batch under each scheme.

   Write down an expression for the average number sampled in
   factory $B$ and find its maximum value.

\bigskip

ANSWER

 $n=10,$ $p$=proportion defective.\\
   $A$: accept if less than 2 defectives.
   $P$(accept)$=q^{10}=10q^9p=(1-p)^9(1+9p)$

   \setlength{\unitlength}{.5in}

\begin{picture}(8,6)
\put(2.7,5){first} \put(2.6,4.7){sample} \put(5.9,5){second}
\put(5.9,4.7){sample} \put(0,1.9){$\bullet$}
\put(0,2){\line(3,2){3}} \put(0,2){\line(1,0){3}}
\put(0,2){\line(3,-2){3}} \put(3.1,0){2} \put(3.1,2){1}
\put(3.1,4){0 Accept} \put(0.8,3.3){$(1-p)^5$}
\put(1,2.1){$5p(1-p)^4$} \put(3.4,2){\line(3,2){3}} \put(6.5,4){0
Accept} \put(3.8,3.2){$(1-p)^5$}

\end{picture}

\bigskip

   $P$(accept)$=(1-p)^5+5p(1-p)^9$

   Expected number sampled$=5+5\times 5p(1-p)^4=E\\
   \frac{\partial E}{\partial p}=-25p(1-p)^3\times 4 +25(1-p)^4=0$
    when $4p=1-p\ \ p=0.2$
    
$E=5+5\times 0.8^4=7.048$ (check
   $\frac{\partial^2 E}{\partial p^2}\leq 0$ when $p=0.2$).


\end{document}
