\documentclass[twoside,12pt]{article}
\usepackage{light}

%\hidesolutions
\showsolutions

\newcommand{\prcond}[2]{\pr{#1\mid#2}}

\begin{document}

\problemset{11}{May 3, 2005}{5PM on Friday, May 6}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\noindent \textbf{This is a mini-problem set.  The first problem
reviews basic facts about expectation.  The second and third are
typical final exam questions.}

\begin{problem}
Answer the following questions about expectation.

\bparts

\ppart There are several equivalent definitions of the expectation of
a random variable.  If $R$ is a random variable over sample space $S$,
then we can compute $\ex{R}$ by summing over individual outcomes or by
summing over values in the range of $R$.  Write down these two
equivalent definitions of $\ex{R}$.

\solution{
\begin{align*}
\ex{R}
    & = \sum_{w \in S} R(w) \pr{w}
    & = \sum_{v \in \text{ Range($R$)}} v \cdot \pr{R = v}
\end{align*}}

\ppart Give another expression for $\ex{R}$ that holds when $R$ is a
natural-valued random variable.

\solution{
\begin{align*}
\ex{R} & = \sum_{k=0}^{\infty} \pr{R > k}
\end{align*}}

\ppart Give a simple expression for $\ex{R}$ that is valid when $R$ is
an indicator random variable.

\solution{
\begin{align*}
\ex{R} = \pr{R = 1}
\end{align*}}

\ppart The expectation of a random variable can often be computed from
expectations of simpler random variables.  Rewrite each of the
expressions below in terms of $\ex{R}$ and $\ex{S}$.  Note any
conditions that $R$ and $S$ must satisfy in order for your equations
to hold.  Here $c$ is a constant.
%
\[
\ex{c R} \qquad
\ex{R + S} \qquad
\ex{R \cdot S}
\]

\solution{
\begin{align*}
\ex{c R} & = c \ex{R} \\
\ex{R + S} & = \ex{R} + \ex{S} \\
\ex{R \cdot S} & = \ex{R} \cdot \ex{S}
\end{align*}
%
The third equation holds only if $R$ and $S$ are independent.}

\ppart The expected value of a random variable $R$ given that some
event $E$ occurs is denoted $\ex{R \mid E}$.  Write down two
equivalent expressions for $\ex{R \mid E}$ based on your answers to
part (a).

\solution{
\begin{align*}
\ex{R \mid E}
    & = \sum_{w \in S} R(w) \pr{w \mid E}
    & = \sum_{v \in \text{ Range($R$)}} v \cdot \pr{R = v \mid E}
\end{align*}
}

\ppart Sometimes the job of computing $\ex{R}$ is best broken down
into cases.  Let $E_1, \ldots, E_n$ be events that partition the
sample space.  Suppose you can compute $\ex{R \mid E_k}$ and
$\pr{E_k}$ for all $k$.  How do you then compute $\ex{R}$?

\solution{
\begin{align}
\ex{R} = \sum_{k=1}^n \ex{R \mid E_k} \pr{E_k}
\end{align}
}

\ppart Many problems involve a sequence of independent trials, each of
which succeeds with probability $p$.  What is the expected number of
trials needed to obtain one success?

\solution{$1/p$}

\eparts

\end{problem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{problem}
MIT students sometimes delay laundry for a few days.  Assume all
random values described below are mutually independent.

\bparts

\ppart A \term{busy} student must complete 3 problem sets before doing
laundry.  Each problem set requires 1 day with probability $2/3$ and 2
days with probability $1/3$.  Let $B$ be the number of days a busy
student delays laundry.  What is $\ex{B}$?

Example: If the first problem set requires 1 day and the second and
third problem sets each require 2 days, then the student delays for $B
= 5$ days.

\solution{ The expected time to complete a problem
set is:
%
\[
1 \cdot \frac{2}{3} + 2 \cdot \frac{1}{3} = \frac{4}{3}
\]
%
Therefore, the expected time to complete all three problem sets is:
%
\begin{align*}
\ex{B}
    & = \ex{\text{pset1}} + \ex{\text{pset2}} + \ex{\text{pset3}} \\
    & = \frac{4}{3} + \frac{4}{3} + \frac{4}{3} \\
    & = 4
\end{align*}
}

\ppart A \term{relaxed} student rolls a fair, 6-sided die in the
morning.  If he rolls a 1, then he does his laundry immediately (with
zero days of delay).  Otherwise, he delays for one day and repeats the
experiment the following morning.  Let $R$ be the number of days a
relaxed student delays laundry.  What is $\ex{R}$?

Example: If the student rolls a 2 the first morning, a 5 the second
morning, and a 1 the third morning, then he delays for $R = 2$ days.

\solution{If we regard doing laundry as a failure, then the mean time
to failure is $1 / (1/6) = 6$.  However, this counts the day laundry
is done, so the number of days delay is $6 - 1 = 5$.  Alternatively,
we could derive the answer as follows:
%
\begin{align*}
\ex{R}
    & = \sum_{k=0}^{\infty} \pr{R > k} \\
    & = \frac{5}{6} + \paren{\frac{5}{6}}^2 + \paren{\frac{5}{6}}^3 + \ldots \\
    & = \frac{5}{6} \cdot
            \paren{1 + \frac{5}{6} + \paren{\frac{5}{6}}^2 + \ldots} \\
    & = \frac{5}{6} \cdot \frac{1}{1 - 5/6} \\
    & = 5
\end{align*}
}

\ppart Before doing laundry, an \term{unlucky} student must recover
from illness for a number of days equal to the product of the numbers
rolled on two fair, 6-sided dice.  Let $U$ be the expected number of
days an unlucky student delays laundry.  What is $\ex{U}$?

Example: If the rolls are 5 and 3, then the student delays for $U =
15$ days.

\solution{Let $D_1$ and $D_2$ be the two die rolls.  Recall that a die
roll has expectation $7/2$.  Thus:
%
\begin{align*}
\ex{U}
    & = \ex{D_1 \cdot D_2} \\
    & = \ex{D_1} \cdot \ex{D_2} \\
    & = \frac{7}{2} \cdot \frac{7}{2} \\
    & = \frac{49}{4}
\end{align*}
}

\ppart A student is \term{busy} with probability $1/2$, \term{relaxed}
with probability $1/3$, and \term{unlucky} with probability $1/6$.
Let $D$ be the number of days the student delays laundry.  What is
$\ex{D}$?

\solution{
\[
\ex{D} = \frac{1}{2} \ex{B} + \frac{1}{3} \ex{R} + \frac{1}{6} \ex{U}
\]
}

\eparts

\end{problem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{problem}
I have twelve cards:
%
\[
\fbox{1}\ \fbox{1}\quad \fbox{2}\ \fbox{2}\quad \fbox{3}\ \fbox{3}\quad
\fbox{4}\ \fbox{4}\quad \fbox{5}\ \fbox{5}\quad \fbox{6}\ \fbox{6}
\]
%
I shuffle them and deal them in a row.  For example, I might get:
%
\[
\fbox{1}\ \fbox{2}\ \fbox{3}\ \fbox{3}\ \fbox{4}\ \fbox{6}\ 
\fbox{1}\ \fbox{4}\ \fbox{5}\ \fbox{5}\ \fbox{2}\ \fbox{6}
\]
%
What is the expected number of adjacent pairs with the same value?  In
the example, there are two adjacent pairs with the same value, the 3's
and the 5's.
\end{problem}

\solution{Consider an adjacent pair.  The left card matches only one
of the other 11 cards, which is equally likely to be in any of the 11
other positions.  Therefore, the probability that an adjacent pair
matches is $1/11$.  Since there are 11 adjacent pairs, the expected
number of matches is $11 \cdot 1/11 = 1$ by linearity of expectation.}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
