\documentclass[a4paper,12pt]{article}
\begin{document}

QUESTION Transistors produced by a machine may be perfect,
slightly
  damaged or unusable. 70\% of the production are perfect and 20\%
  are slightly damaged. Let X be a variable giving the number of
  perfect transistors, Y the number of slightly damaged
  transistors and Z the number of unusable transistors in a random
  sample of 3 transistors. Copy out and complete the following
  table giving the joint and marginal distributions of X and Y.


ANSWER $\textrm{P(perfect)}=0.7 \sim X\\
   \textrm{P(slightly damaged}=0.2\sim Y\\
   \textrm{P(unusable)}=0.1 \sim Z$

  \begin{eqnarray*}
   P(X=0,Y=0)&=&P(Z=3)=0.1^3=0.001\\
   P(X=1,Y=0)&=&P(X=1,Z=2)=0.7\times 0.1^2 \times 3=0.021\\
   P(X+1,Y=1)&=&P(X=1,Y=1,Z=1)=0.7 \times 0.2 \times 0,1 \times
   6=0.084
  \end{eqnarray*}

  \begin{tabular}{c|cccc|l}
  X$\backslash$Y&0&1&2&3&marginal X\\
  \hline
  0&*0.001&*0.006&0.012&0.008&0.027\\
  1&*0.021&0.084&0.084&0&0.189\\
  2&0.147&0.294&0&0&0.441\\
  3&0.343&0&0&0&0.343\\
  \hline
  marginal Y&0.512&0.384&0.096&0.008&1
  \end{tabular}

  \begin{description}

   \item[(i)]
   $X \sim B(3,0.7)\ E(X)=2.1\ $Var(X)=0.63

   \item[(ii)]
    \begin{tabular}{ccccc}
    &0&1&2&3\\
    P(X|y=0)&$\frac{1}{512}$&$\frac{21}{512}$&$\frac{147}{512}$&$\frac{343}{512}$
    \end{tabular}\\
    $E(X|y=0)=\frac{1}{512}(21 \times 1 + 147 \times 2 + 343
    \times 3)=\frac{1344}{512}=2.625\\
    E(X^2|y=0)=\frac{1}{512}(21 \times 1^2 + 147 \times 2^2 + 343
    \times 3^2)=\frac{3696}{512}=7.21875\\
    \textrm{Var}(X|y=0)=7.21875-(2.625)^2 \approx 0.328$.

   \item[(iii)]
    $P(Z>X+Y)\ Z=3-X-Y>X+Y$ in cells of the table marked with a
    *.Hence $P(Z>X+Y)=0.028$.

  \end{description}

\end{document}
