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

%\hidesolutions
\showsolutions

\begin{document}

\newcommand{\qf}{\text{"}F\text{"}}

\recitation{18}{April 22, 2005}

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

\noindent
The \emph{Law of Total Probability} is a handy tool for breaking down
the computation of a probability into distinct cases. More precisely,
suppose we are interested in the probability of an event $E$:
$\pr{E}$. Suppose also that the random experiment can evolve in two
different ways; that is, two different cases $X$ and $\overline{X}$
are possible. Suppose also that
\begin{itemize}
\item  
it is easy to find the probability \emph{of each case}: 
$\pr{X}$ and $\pr{\overline{X}}$,
\item 
it easy to find the probability of the event \emph{in each case}:
$\pr{E\mid X}$ and $\pr{E\mid \overline{X}}$.
\end{itemize}
Then finding the probability of $E$ is only two multiplications and an
addition away. 

\begin{theorem}[Law of Total Probability]
Let $E$ and $X$ be events, and  $0 < \pr{X} < 1$.  Then
%
\[
\pr{E} \quad=\quad 
\pr{X} \cdot \pr{E \mid X}  
\quad+\quad
\pr{\overline{X}} \cdot \pr{E \mid \overline{X}} 
\]
%
\end{theorem}

\begin{proof}
Let's simplify the right-hand side.
%
\begin{align*}
\lefteqn{\pr{E \mid X} \cdot \pr{X} +
	\pr{E \mid \overline{X}} \cdot \pr{\overline{X}}} \hspace{1in} \\
    &\qquad = \frac{\pr{E \cap X}}{\pr{X}} \cdot \pr{X} +
	\frac{\pr{E \cap \overline{X}}}{\pr{\overline{X}}} \cdot \pr{\overline{X}} \\
    &\qquad = \pr{E \cap X} + \pr{E \cap \overline{X}} \\
    &\qquad = \pr{E}
\end{align*}
%
The first step uses the definition of conditional probability.  On the
next-to-last line, we're adding the probabilities of all outcomes in
$E$ \textit{and} $X$ to the probabilities of all outcomes in $E$ and
\textit{not} in $X$.  Since every outcome in $E$ is either in $X$ or
not in $X$, this is the sum of the probabilities of all outcomes in
$E$, which equals $\pr{E}$.
\end{proof}

\noindent 
What happens if the experiment can evolve in more than two different
ways? That is, what if there are $n$ cases, $X_1, \ldots, X_n$, which
are \emph{mutually exclusive} (no two cases can happen simultaneously)
and \emph{collectively exhaustive} (at least one case must happen)? If
it is still easy to find the probability \emph{of each case} and the
probability of the event \emph{in each case}, then again finding
$\pr{E}$ is trivial.
%
\begin{theorem}
Let $E$ be an event and let $X_1, \ldots, X_n$ be disjoint events
whose union exhausts the sample space. Then
%
\[
\pr{E} = \sum_{i=1}^n \pr{E \mid X_i} \cdot \pr{X_i}
\]
%
provided that $\pr{X_i}\neq 0$.
\end{theorem}

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

\newpage

\begin{problem}
There is a rare and deadly disease called \textit{Nerditosis} which
afflicts about 1 person in 1000.  On symption is a compulsion to refer
to everything--- fields of study, classes, buildings, etc.--- using
numbers.  It's horrible.  As victims enter their final, downward
spiral, they're awarded a degree from MIT.  Two doctors claim that
they can diagnose Nerditosis.
\end{problem}

\bparts

\ppart Doctor $X$ received his degree from Harvard Medical School.  He
practices at Massachusetts General Hospital and has access to the
latest scanners, lab tests, and research.  Suppose you ask Doctor $X$
whether you have the disease.
%
\begin{itemize}
\item If you have Nerditosis, he says ``yes'' with probability 0.99.
\item If you don't have it, he says ``no'' with probability 0.97.
\end{itemize}
%
Let $D$ be the event that you have the disease, and let $E$ be the
event that the diagnosis is erroneous.  Use the Total Probability Law
to compute $\pr{E}$, the probability that Doctor $X$ makes a mistake.

\solution[\vspace{1in}]{By the Total Probability Law:
%
\begin{align*}
\pr{E}
    & = \pr{E \mid D} \cdot \pr{D} +
        \pr{E \mid \overline{D}} \cdot \pr{\overline{D}} \\
    & = 0.01 \cdot 0.001 + 0.03 \cdot 0.999 \\
    & = 0.02998
\end{align*}}

\ppart ``Doctor'' $Y$ received his genuine degree from a
fully-accredited university for \$49.95 via a special internet offer.
He knows that Nerditosis stikes 1 person in 1000, but is a little
shakey on how to interpret this.  So if you ask him whether you have
the disease, he'll helpfully say ``yes'' with probability 1 in 1000
regardless of whether you actually do or not.

Let $D$ be the event that you have the disease, and let $F$ be the
event that the diagnosis is faulty.  Use the Total Probability Law to
compute $\pr{F}$, the probability that Doctor $Y$ made a mistake.

\solution[\vspace{1in}]{By the Total Probability Law:
%
\begin{align*}
\pr{F}
    & = \pr{F \mid D} \cdot \pr{D} +
        \pr{F \mid \overline{D}} \cdot \pr{\overline{D}} \\
    & = 0.999 \cdot 0.001 + 0.001 \cdot 0.999 \\
    & = 0.001998
\end{align*}}

\ppart Which doctor is more reliable?

\solution{Doctor $X$ makes more than 15 times as many errors as Doctor
$Y$.}

\eparts

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

\newpage

\begin{problem}
A Barglesnort makes its lair in one of three caves:
%
\begin{center}
\includegraphics[height=0.75in]{caves}
\end{center}
%
The Barglesnort inhabits cave 1 with probability $\frac{1}{2}$, cave 2
with probability $\frac{1}{4}$, and cave 3 with probability
$\frac{1}{4}$.  A rabbit subsequently moves into one of the two
unoccupied caves, selected with equal probability.  With probability
$\frac{1}{3}$, the rabbit leaves tracks at the entrance to its cave.
(Barglesnorts are much too clever to leave tracks.)  What is the
probability that the Barglesnort lives in cave 3, given that there are
no tracks in front of cave 2?

\noindent
Use a tree diagram and the four-step method.
\end{problem}

\solution{A tree diagram is given below.  Let $B_3$ be the event that
the Barglesnort inhabits cave 3, and let $T_2$ be the event that there
are tracks in front of cave 2.  Taking data from the tree diagram, we
can compute the desired probability as follows:
%
\begin{align*}
\pr{B_3 \mid \overline{T_2}}
	& = \frac{\pr{B_3 \cap \overline{T_2}}}{\pr{\overline{T_2}}} \\
	& = \frac{\frac{1}{24} + \frac{1}{12} + \frac{1}{12}}
		{1 - \frac{1}{12} - \frac{1}{24}} \\
	& = \frac{5}{21}
\end{align*}
%
In the denominator, we apply the formula $\pr{\overline{T_2}} = 1 -
\pr{T_2}$ for convenience.
%
\begin{center}
\includegraphics[height=3in]{bargle}
\end{center}
}

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

\newpage

\begin{problem}
There is a deck of cards on the table. Either John or Mary shuffled it
and we have no reason to believe in one case more than the other. Now,
John is a well-known cheater with well-known preferences: he always 
steals the ace of diamonds while shuffling. Mary, on the other hand,
is a very honest girl: a deck suffled by her is always a full 52-card
deck.  
\bparts
\ppart
You pick the topmost card on the deck and you see a queen of hearts. 
Before you do any calculations: Who is more likely to have shuffled
the deck? Explain.

\solution[\vspace{1cm}]{
A shuffling by John strictly increases the fraction of non-aces in the 
deck. Hence, between the two worlds:
\begin{enumerate}
\item[(1)] the world where John has shuffled the deck and  
\item[(2)] the world where Mary has shuffled the deck
\end{enumerate}
it is the first world rather than the second one that favors the event
of the topmost card being a non-ace. Since we know this event is a
fact and the two worlds are otherwise equally likely, we should bet we
live in world~(1).} 

\ppart
Now calculate. What is the probability that John has shuffled the
deck? What is the probability that it has been Mary?

\solution[\vspace{5cm}]{Let $J$ be the event that John shuffles the
deck and $A$ that the topmost card is an ace. We want the probabilities
$$
\pr{ J \mid \overline{A} }
\qquad\text{and}\qquad
\pr{ M \mid \overline{A} }
$$
Clearly, $M=\overline{J}$ and therefore $\pr{ M \mid \overline{A} } =
\pr{ \overline{J} \mid \overline{A} } = 1 - \pr{ J \mid
\overline{A}}$, so that we need only calculate the probability about
John. By the definition of conditional probability (first equation)
and then the product rule (on the enumerator) and the law of total
probability (on the denominator), we know
$$
\pr{ J \mid \overline{A} } = 
\frac{ \pr{J\cap\overline{A}} }{ \pr{\overline{A}} } = 
\frac{ 
   \pr{J}\cdot\pr{\overline{A}\mid J} 
}{ 
   \pr{J}\cdot\pr{\overline{A}\mid J} 
  +\pr{M}\cdot\pr{\overline{A}\mid M} 
}
$$
and everything in this last fraction is known:
$$
\pr{ J \mid \overline{A} } = 
\frac{ 
   \frac{1}{2} \cdot \frac{48}{51}
}{ 
   \frac{1}{2} \cdot \frac{48}{51}
 + \frac{1}{2} \cdot \frac{48}{52}
} =
\frac{ \frac{1}{51} }{ \frac{1}{51}+\frac{1}{52} } =
\frac{52}{52+51} = 
\frac{52}{103}
$$
which is (slightly, but) strictly greater than $\frac{1}{2}$, as expected.}
\eparts
Like John, Peter is also a well-known cheater: when he shuffles the
deck, he also steals a card from it; but (unlike John) he steals a
\emph{random} card. That is, every card is equally likely to be stolen
when Peter is shuffling.
\bparts \setcounter{problempart}{2}
\ppart
Suppose you know that Mary shuffled the deck and you are about to pick
the topmost card. What is the probability that you will see an ace?

\solution[\vspace{1cm}]{If we know Mary shuffled the deck, we know
the deck if a full 52-card deck. So, easily, the probability is
$\frac{4}{52}$.}  

\ppart
Suppose you know that Peter shuffled the deck and you are about to
pick the topmost card. What is the probability that you will see an
ace?  (Hint: What is this probability if Peter steals an ace? What if
Peter steals a non-ace?)

\solution[\vfill]{
Suppose Peter shuffles the deck. Then there are two cases about what
card he steals: it's either an ace or a non-ace. Let $S_A$ be the event
that he steals an ace. Since he steals a card at random, we know he
steals an ace with probability $\pr{S_A}=\frac{4}{52}$ and a non-ace
with probability $\pr{\overline{S_A}}=\frac{48}{52}$. 

Now, as before, let $A$ be the event that the topmost card is an
ace. If we know what case we are in with respect to the stolen card,
it is easy to calculate the probability of $A$:
$$
\pr{A\mid S_A} = \frac{3}{51}
\qquad\text{and}\qquad
\pr{A\mid\overline{S_A}} = \frac{4}{51}
$$

So, we know the probability \emph{in each case} and we also know the
probability \emph{of each case}. This rings the bell of the law of
total probability:
$$
\pr{A}
= 
 \pr{S_A}\cdot\pr{A\mid S_A} 
+\pr{\overline{S_A}}\cdot\pr{A\mid\overline{S_A}} 
=
 \tfrac{ 4}{52}\cdot\tfrac{3}{51}
+\tfrac{48}{52}\cdot\tfrac{4}{51}
=
\tfrac{4\cdot(3+48)}{52\cdot 51}
=
\tfrac{4}{52}.
$$
So the probability that the topmost card is an ace is
$\frac{4}{52}$.}

\ppart
Anything strange with the answers to parts (c) and (d)? 

\solution{The two answers are identical. In other words,
whether the deck is missing a card or not does not affect the
probability that the topmost card is an ace! How can that be? 

Here is an explanation. The situation of part (c) is identical to the
following: 
\begin{quote}
we pick the top two cards of a well-shuffled 52-card deck;\\
what is the probability that the \emph{first} card is an ace?  
\end{quote}
(because the selection of the second card is irrelevant). Similarly,
the situation of part (d) is identical to the following: 
\begin{quote}
we pick the top two cards of a well-shuffled 52-card deck;\\
what is the probability that the \emph{second} card is an ace?  
\end{quote}
(because the effect of Peter stealing a card at random and shuffling is
identical to the effect of us drawing the topmost card). Now the two
situations we have just introduced are identical, because the number
of pairs where the first card is an ace is equal to the number of
pairs where the second card is an ace, for obvious reasons of
symmetry.} 
\eparts
\end{problem}


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

\end{document}

