\documentclass{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}

\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 \Large Unless otherwise stated, give numerical answers as
expressions, e.g. $\frac{2}{3} \times 6 - 1.8$.  Do NOT use
calculators.}

{\bf 1.} (20) Consider the ALOHA example from the text, for general p and q,
and suppose that $X_{0} = 0$, i.e. there are no active nodes at the
beginning of our observation period.  Find $P(X_1 = 0)$.

{\bf 2.}  Consider a three-sided die, as opposed to the standard
six-sided type.  The game is to keep rolling the die until we get a
total of at least 3.  Let N denote the number of times we roll the die.
For example, if we get a 3 on the first roll, N = 1.  If we get a 2 on
the first roll, then N will be 2 no matter what we get the second time.  
The largest N can be is 3.  The rule is that one wins if one's final
total is exactly 3.

\begin{itemize}

\item [(a)] (20) Find the probability of winning.

\item [(b)] (20) Find P(our first roll was a 1 $|$ we won).

\item [(c)] Extra Credit:  How could we construct such a die?

\end{itemize}

{\bf 3.} Consider the ALOHA simulation example on pp.11-12.

\begin{itemize}

\item [(a)] (20) Suppose we wish to find 
$P(X_2 = 1 | X_1 = 1)$
instead of
$P(X_2 = 2 | X_1 = 1)$.
What line(s) would we change, and how would we change them?

\item [(b)] (20) In which line(s) are we in essence checking for a
collision?

\end{itemize}

{\bf Solutions:}

{\bf 1.} $(1-q)^2 + 2q(1-q) p$

{\bf 2a.} $P(\textrm{win}) = 
P(3 \textrm{ or }   1,2 \textrm{ or }   2,1 \textrm{ or }  1,1,1) =
\frac{1}{3} +
(\frac{1}{3})^2 +
(\frac{1}{3})^2 +
(\frac{1}{3})^3 
$

{\bf 2b.} $
P(\textrm{1st was 1} | \textrm{we won}) =
\frac
{P(\textrm{1st was 1 and we won})}
{P(\textrm{we won})}$

$P(\textrm{1st was 1 and we won}) = P(1,2) = 
(\frac{1}{3})^2$

Then divide.

{\bf 2c.} For example, construct the die as a cylinder, with the proper
ratio of height to radius to achieve the right balance.

{\bf 3a.} Line 34, writing {\tt X2 == 1}, and making the same change in
the output labeling in line 40.  (Latter not counted wrong if missing.)

{\bf 3b.} Line 13.

\end{document}

