\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 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 SHOW YOUR WORK!} 

{\bf 1.} (20) Just above (10.39), p.318, supposed it said, ``The nodes
collectively will repeatedly cycle through idle and busy periods, termed
I and B periods,'' instead of defining I and B in terms of just node 0.
Here we are in an I period if no nodes are active, and in a B period if
at least one node is active.  How would (10.39) change?

{\bf 2.} (20) Exercise 20, Chapter 5, p.155.

{\bf 3.} Consider the board game in Sec. 2.8, pp.14-15.  This can be
modeled as a Markov chain, with state space \{0,1,2,...,7\}.

\begin{itemize}

\item [(a)] (10) Find $p_{67}$.

\item [(b)] (10) Find the long-run fraction of turns in which you get a
bonus roll, expressed as a function of $\pi$.  Note:  If you roll and
hit 3, and then roll a second time for the bonus, that still only counts
one turn, not two.

\end{itemize}

{\bf 4.} The moment generating function of the random pair (X,Y) is
defined by

$$
m_{X,Y}(u,v) = E[e^{uX+vY}]
$$

\begin{itemize}

\item [(a)] (10) For the density (5.17), p.105, find $m_{X,Y}(u,v)$.
Express your answer in integral form.

\item [(b)] (10) For a general random pair (X,Y), express Cov(X,Y) in
terms of moment generating functions.  

\end{itemize}

{\bf 5.} (20) Consider a Markov chain \{$X_n$\}.  Let $X_0$ have the
distribution $\pi$ (an example is discussed in Sec. 10.1.2.4).  Show
that ``given the present, the past and the future are independent,'' in
the sense that for $i > 0$, $X_{i-1}$ and $X_{i+1}$ are independent,
given $X_i$.

{\bf Solutions:}

{\bf 1.}  Again I will have a geometric distribution.  However, the
``success probability'' (the parameter p in (3.66)) changes.
``Success'' here will be that at least one of the n nodes becomes
active, i.e. generates a message to send.  This occurs with probability 

$$
1 - P(\textrm{no one generates a message}) = 1 - (1-q)^n
$$

So, 

$$
E(I) = \frac{1}{[1 - (1-q)^n]} 
$$

{\bf 2.}  From the Law of Total Variance,

$$
Var(N) = E[Var(N|L)] + Var[X(N|L)]
$$

Since the conditional distribution of N given L is Poisson with
parameter L, $Var(N|L) = E(N|L) = L$.  The result follows.

{\bf 3.a} We can go from square 6 to square 7 either directly, by
rolling a 1, or via a bonus, by rolling a 5 to get to 3, then rolling a
4 to get to 7.  The probability of this is

$$
\frac{1}{6} + (\frac{1}{6})^2 = \frac{7}{36}
$$

{\bf 3.b}  We can only get a bonus from squares 0 (by rolling a 3), 1
(by rolling a 2), 2, 5, 6 and 7.  It's impossible from square 4, and we
are never on square 3 anyway.  So,

$$
P(\textrm{get a bonus in turn i} ) =
\sum_s P(X_{i-1} = s) \cdot P(\textrm{get a bonus turn} | X_{i-1} = s) =
\frac{1}{6} \cdot 
(\pi_0 + \pi_1 + \pi_2 + \pi_5 + \pi_6 + \pi_7)
$$

{\bf 4.a}  Use (5.15):

$$
m_{X,Y}(u,v) = E[e^{uX+vY}] 
= \int_{0}^{1} \int_{0}^{t} 
e^{us+vt} 8st ~ ds ~ dt
$$

{\bf 4.b}  For example, to get E(XY), note that

$$
\frac{\partial^2}{\partial u \partial v} E[e^{uX+vY}] =
E[XY e^{uX+vY}]
$$

Thus

$$
E(XY) = 
\frac{\partial^2}{\partial u \partial v} m_{X,Y}(u,v) |_{u=v=0}
$$

{\bf 5.} We must show that

\begin{equation}
\label{toshow}
P(X_{i-1} = k \textrm{ and } X_{i+1} = m | X_i = n) =
P(X_{i-1} = k | X_i = n) \cdot 
P(X_{i+1} = m | X_i = n) 
\end{equation}

But the left-hand side of (\ref{toshow}) is

\begin{equation}
\frac
{P(X_{i-1} = k \textrm{ and } X_{i+1} = m \textrm{ and } X_i = n)} 
{P(X_i = n)}
=
\frac{\pi_k p_{kn} p_{nm}} 
{\pi_n} 
\label{lhs}
\end{equation}

while the two factors in the right-hand side are

\begin{equation}
\label{factor1}
\frac
{P(X_{i-1} = k \textrm{ and } X_i = n)} 
{P(X_i = n)} =
\frac{\pi_k p_{kn}}{\pi_n}
\end{equation}

and

\begin{equation}
\label{factor2}
p_{nm}
\end{equation}

Multiplying (\ref{factor1}) by (\ref{factor2}), we find that the product
matches (\ref{lhs})!  So we're done.

\end{document} 
