\documentclass[twocolumn]{article}

\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textwidth}{7.0in}
\setlength{\textheight}{9.5in}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.05in}
\setlength{\columnseprule}{0.3pt}
\usepackage{fancyvrb}
\usepackage{relsize}
\usepackage{hyperref}
\usepackage{listings}

\begin{document}

Name: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Directions: {\bf \Large Work only on this sheet} (on both sides, if
needed); do not turn in any supplementary sheets of paper. There is
actually plenty of room for your answers, as long as you organize
yourself BEFORE starting writing.

{\bf 1.}  Consider the ALOHA simulation on p.47.

\begin{itemize}

\item [(a)] (20) On what line do we simulate the possible creation of a
new message?

\item [(b)] (20) Change line 10 so that it uses {\bf sample()} instead of
{\bf runif()}.

\end{itemize}

{\bf 2.} (20) Say we roll two dice, a blue one and a yellow one.  Let B
and Y denote the number of dots we get, respectively.  Now let G denote
the indicator random variable for the event S = 2.  Find E(G).

{\bf 3.} Suppose $I_1, I_2 \textrm{ and } I_3$ are independent indicator
random variables, with $P(I_j = 1) = p_j$, j = 1,2,3.  Find the
following in terms of the $p_j$, writing your derivation in ``stacked
equation'' form [as for example in (3.53)-(3.55)], {\it with reasons in
the form of mailing tube numbers}.  You should do reasonable algebraic
simplfication of your expressions.

Let $S = I_1 + I_2 I_3$.

\begin{itemize}

\item [(a)] (20) ES

\item [(b)] (20) Var(S)

\end{itemize}

\onecolumn

{\bf Solutions:}

{\bf 1.a} 14

{\bf 1.b} 

\begin{Verbatim}[fontsize=\relsize{-2}]
numsend <- numsend + sample(0:1,1,prob=c(p,1-p))
\end{Verbatim}

{\bf 2.}  EG = P(G = 1) = P(B+Y = 1) = 1/36

{\bf 3.a}

\begin{eqnarray}
ES &=& EI_1 + EI_2 \cdot EI_3  ~~~~ \textrm{ (3.13), (3.16)}  \\ 
&=& p_1 + p_2 p_3 ~~~~ \textrm{(3.43)}
\end{eqnarray}

{\bf 3.b}

\begin{eqnarray}
Var(S) &=& Var(I_1) + Var(I_2 I_3)  ~~~~ \textrm{ (3.64)}  \\ 
&=& p_1 (1-p_1) + Var(I_2 I_3) ~~~~ \textrm{(3.44)}
\end{eqnarray}

Let $A_j$ denote the event associated with $I_j$, j = 1,2,3, and let $A$
denote the event that $A_2$ and $A_3$ both occur.  Then $I_2 I_3$ is the
indicator random variable for $A$.  Thus

\begin{eqnarray}
Var(I_2 I_3) &=& P(A) [1-P(A)] ~~~~ \textrm{(3.44)} \\ 
&=& (p_2 p_3) [1 - p_2 p_3] ~~~~ \textrm{indep.}
\end{eqnarray}

\end{document}

