\documentclass[twoside,12pt]{article}
\usepackage{latex-macros/course}

\renewcommand{\reading}{Week 12 Notes. Week 13 Notes, Sections 1 and 2
(Random Variables and the Birthday Principle).}


\begin{document}

\problemset{9}

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

\begin{problem}
Professor Plum, Mr. Green, and Miss Scarlet are all plotting to shoot
Colonel Mustard.  If one of these three has both an
\textit{opportunity} and the \textit{revolver}, then that person shoots
Colonel Mustard.  Otherwise, Colonel Mustard escapes.  Exactly one of
the three has an \textit{opportunity} with the following
probabilities:
%
\begin{align*}
\pr{\text{Plum has opportunity}} & = 1 / 6 \\
\pr{\text{Green has opportunity}} & = 2 / 6 \\
\pr{\text{Scarlet has opportunity}} & = 3 / 6
\end{align*}
%
Exactly one has the \textit{revolver} with the following
probabilities, regardless of who has an opportuntity:
%
\begin{align*}
\pr{\text{Plum has revolver}} & = 4 / 8 \\
\pr{\text{Green has revolver}} & = 3 / 8 \\
\pr{\text{Scarlet has revolver}} & = 1 / 8
\end{align*}

\bparts

\ppart Draw a tree diagram for this problem.  Indicate edge and
outcome probabilities.

\solution{
\begin{center}
\begin{picture}(120,270)(0,-30)
\put(0,120){\line(2,3){60}}
\put(0,120){\line(1,0){60}}
\put(0,120){\line(2,-3){60}}
\put(60,30){\line(2,-1){60}}
\put(60,30){\line(1,0){60}}
\put(60,30){\line(2,1){60}}
\put(60,120){\line(2,-1){60}}
\put(60,120){\line(1,0){60}}
\put(60,120){\line(2,1){60}}
\put(60,210){\line(2,-1){60}}
\put(60,210){\line(1,0){60}}
\put(60,210){\line(2,1){60}}
\put(30,180){\makebox(0,0){P}}
\put(30,130){\makebox(0,0){G}}
\put(30,60){\makebox(0,0){S}}
\put(110,245){\makebox(0,0){P}}
\put(110,220){\makebox(0,0){G}}
\put(110,175){\makebox(0,0){S}}
\put(110,155){\makebox(0,0){P}}
\put(110,130){\makebox(0,0){G}}
\put(110,85){\makebox(0,0){S}}
\put(110,65){\makebox(0,0){P}}
\put(110,40){\makebox(0,0){G}}
\put(110,-5){\makebox(0,0){S}}
\put(45,160){\makebox(0,0){$1/6$}}
\put(30,110){\makebox(0,0){$2/6$}}
\put(45,80){\makebox(0,0){$3/6$}}
\put(85,235){\makebox(0,0){$4/8$}}
\put(110,200){\makebox(0,0){$3/8$}}
\put(85,185){\makebox(0,0){$1/8$}}
\put(85,145){\makebox(0,0){$4/8$}}
\put(110,110){\makebox(0,0){$3/8$}}
\put(85,95){\makebox(0,0){$1/8$}}
\put(85,55){\makebox(0,0){$4/8$}}
\put(110,20){\makebox(0,0){$3/8$}}
\put(85,5){\makebox(0,0){$1/8$}}
\put(30,15){\makebox(0,0){\text{opportunity}}}
\put(90,-20){\makebox(0,0){\text{revolver}}}
\put(150,-20){\makebox(0,0){\text{prob.}}}
\put(150,240){\makebox(0,0){$4/48$}}
\put(150,210){\makebox(0,0){$3/48$}}
\put(150,180){\makebox(0,0){$1/48$}}
\put(150,150){\makebox(0,0){$8/48$}}
\put(150,120){\makebox(0,0){$6/48$}}
\put(150,90){\makebox(0,0){$2/48$}}
\put(150,60){\makebox(0,0){$12/48$}}
\put(150,30){\makebox(0,0){$9/48$}}
\put(150,0){\makebox(0,0){$3/48$}}
\end{picture}
\end{center}
}

\ppart What is the probability that Colonel Mustard is shot?

\solution{Denote each outcome with a pair indicating who has the
opportunity and who has the revolver.  In this notation, the event
that Colonel Mustard is shot consists of all outcomes where a single
person has both:
%
\[
\set{(P,P),(G,G),(S,S)}
\]
%
The probability of this event is the sum of the outcome probabilities:
%
\begin{align*}
\pr{\set{(P,P),(G,G),(S,S)}}
    & = \pr{(P,P)} + \pr{(G,G)} + \pr{(S,S)} \\
    & = 4/48 + 6/48 + 3/48 \\
    & = 13/48
\end{align*}
}

\ppart What is the probability that Colonel Mustard is shot, given
that Miss Scarlet does not have the revolver?

\solution{Let $S$ be the event that Colonel Mustard is shot, and let
$N$ be the event that Miss Scarlet does \textit{not} have the
revolver.  The solution is:
%
\begin{align*}
\prcond{S}{N}
    & = \frac{\pr{S \cap N}}{\pr{N}} \\
    & = \frac{\pr{(P,P),(G,G)}}{\pr{(P,P),(P,G),(G,P),(G,G),(S,P),(S,G)}} \\
    & = \frac{\frac{4}{48}+\frac{6}{48}}
             {\frac{4}{48}+\frac{3}{48}+\frac{8}{48}+
              \frac{6}{48}+\frac{12}{48}+\frac{9}{48}} \\
    & = \frac{5}{21}
\end{align*}
}

\ppart What is the probability that Mr. Green had an opportunity,
given that Colonel Mustard was shot?

\solution{Let $G$ be the event that Mr. Green has an opportunity, and
again let $S$ be the event that Colonel Mustard is shot.  Then the
solution is:
%
\begin{align*}
\prcond{G}{S}
    & = \frac{\pr{G \cap S}}{\pr{S}} \\
    & = \frac{\pr{(G,G)}}{\pr{(P,P),(G,G),(S,S)}} \\
    & = \frac{\frac{6}{48}}
             {\frac{4}{48}+\frac{6}{48}+\frac{3}{48}} \\
    & = \frac{6}{13}
\end{align*}
}

\eparts

\end{problem}

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

\begin{problem}
There are three prisoners in a maximum-security prison for fictional
villains: the Evil Wizard Voldemort, the Dark Lord Sauron, and Little
Bunny Foo-Foo.  The parole board has declared that it will release two
of the three, chosen uniformly at random, but has not yet released
their names.  Naturally, Sauron figures that he will be released to
his home in Mordor, where the shadows lie, with probability
$2/3$.

A guard offers to tell Sauron the name of one of the other prisoners
who will be released (either Voldemort or Foo-Foo).  However, Sauron
declines this offer.  He reasons that if the guard says, for example,
``Little Bunny Foo-Foo will be released'', then his own probability of
release will drop to $1/2$.  This is because he will then know
that either he or Voldemort will also be released, and these two
events are equally likely.

Using a tree diagram and the four-step method, either prove that the
Dark Lord Sauron has reasoned correctly or prove that he is wrong.
Assume that if the guard has a choice of naming either Voldemort or
Foo-Foo (because both are to be released), then he names one of the
two uniformly at random.
\end{problem}

\solution{Sauron has reasoned incorrectly.  In order to understand his
error, let's begin by working out the sample space, noting events of
interest, and computing outcome probabilities:
%
\begin{center}
\begin{picture}(360,175)(0,-40)
%\put(0,-40){\dashbox(360,175){}} % bounding box
\put(0,60){\line(1,1){60}}
\put(0,60){\line(1,0){60}}
\put(0,60){\line(1,-1){60}}
\put(30,-10){\makebox(0,0){released}}
\put(60,120){\line(1,0){60}}
\put(60,60){\line(2,1){60}}
\put(60,60){\line(2,-1){60}}
\put(60,0){\line(1,0){60}}
\put(90,-25){\makebox(0,0){guard says}}
\put(11,90){\makebox(0,0){$F,S$}}
\put(40,68){\makebox(0,0){$F,V$}}
\put(11,30){\makebox(0,0){$V,S$}}
\put(52,96){\makebox(0,0){$1/3$}}
\put(40,50){\makebox(0,0){$1/3$}}
\put(52,24){\makebox(0,0){$1/3$}}
\put(90,128){\makebox(0,0){$F$}}
\put(90,90){\makebox(0,0){$F$}}
\put(90,30){\makebox(0,0){$V$}}
\put(90,-10){\makebox(0,0){$V$}}
\put(90,110){\makebox(0,0){$1$}}
\put(102,70){\makebox(0,0){$1/2$}}
\put(102,50){\makebox(0,0){$1/2$}}
\put(90,8){\makebox(0,0){$1$}}
\put(150,120){\makebox(0,0){$1/3$}}
\put(150,90){\makebox(0,0){$1/6$}}
\put(150,30){\makebox(0,0){$1/6$}}
\put(150,0){\makebox(0,0){$1/3$}}
\put(150,-20){\makebox(0,0){prob.}}
\put(210,120){\makebox(0,0){$\times$}}
\put(210,90){\makebox(0,0){$\times$}}
\put(210,30){\makebox(0,0){}}
\put(210,0){\makebox(0,0){}}
\put(210,-25){\makebox(0,0){\shortstack{guard says\\"Foo-foo''}}}
\put(270,120){\makebox(0,0){$\times$}}
\put(270,90){\makebox(0,0){$\times$}}
\put(270,30){\makebox(0,0){$\times$}}
\put(270,0){\makebox(0,0){}}
\put(270,-25){\makebox(0,0){\shortstack{Foo-foo\\released}}}
\put(330,120){\makebox(0,0){$\times$}}
\put(330,90){\makebox(0,0){}}
\put(330,30){\makebox(0,0){}}
\put(330,0){\makebox(0,0){$\times$}}
\put(330,-25){\makebox(0,0){\shortstack{Sauron\\released}}}
\end{picture}
\end{center}

Define the events $S$, $F$, and ``$F$'' as follows:
%
\begin{align*}
\text{``$F$''} & = \text{Guard says Foo-Foo is released} \\
F & = \text{Foo-Foo is released} \\
S & = \text{Sauron is released}
\end{align*}
%
The outcomes in each of these events are noted in the tree diagram.

Sauron's error is in failing to realize that the event $F$ (Foo-foo
will be released) is different from the event ``$F$'' (the guard
\textit{says} Foo-foo will be released).  In particular, the
probability that Sauron is released, given that Foo-foo is released,
is indeed $1/2$:
%
\begin{align*}
\prcond{S}{F}
    & = \frac{\pr{S \cap F}}{\pr{F}} \\
    & = \frac{\frac{1}{3}}{\frac{1}{3}+\frac{1}{6}+\frac{1}{6}} \\
    & = \frac{1}{2}
\end{align*}
%
But the probability that Sauron is released given that the guard
merely \textit{says so} is still $2/3$:
%
\begin{align*}
\prcond{S}{\text{``$F$''}}
    & = \frac{\pr{S \cap \text{``$F$''}}}{\pr{\text{``$F$''}}} \\
    & = \frac{\frac{1}{3}}{\frac{1}{3} + \frac{1}{6}} \\
    & = \frac{2}{3}
\end{align*}
%
So Sauron's probability of release is actually unchanged by the
guard's statement.}

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

\begin{problem}
You shuffle a deck of cards and deal your friend a 5-card hand.

\bparts

\ppart Suppose your friend says, ``I have the ace of spades.''  What
is the probablity that she has another ace?

\solution{The sample space for this experient is the set of all 5-card
hands.  All outcomes are equally likely, so the probability of each
outcome is $1 / \binom{52}{5}$.  Let $S$ be the event that your friend
has the ace of spades, and let $A$ be the event that your friend has
another ace.  Our objective is to compute:
%
\[
\prcond{A}{S} = \frac{\pr{A \cap S}}{\pr{S}}
\]
%
The number of hands containing the ace of spades is equal to the
number of ways to select 4 of the remaining 51 cards.  Therefore:
%
\[
\pr{S} = \frac{\binom{51}{4}}{\binom{52}{5}}
\]
%
The number of hands containing the ace of spades and at least one more
ace is:
%
\[
%\size{A \cap S} = \binom{3}{1} \binom{48}{3} + \binom{3}{2}
A \cap S = \binom{3}{1} \binom{48}{3} + \binom{3}{2}
\binom{48}{2} + \binom{3}{3} \binom{48}{1}
\]
%
Here the first term counts the number of hands with one additional
ace, since there are $\binom{3}{1}$ ways to choose the extra ace and
$\binom{48}{3}$ ways to choose the other cards.  Similarly, the second
term counts hands with two additional aces, and the last term counts
hands with all three remaining aces.  In probability terms, we have:
%
\[
\pr{A \cap S} = \frac{\binom{3}{1} \binom{48}{3} + \binom{3}{2} \binom{48}{2} + \binom{3}{3} \binom{48}{1}}{\binom{52}{5}}
\]
%
Substituting these results into our original equation gives the solution:
%
\[
\prcond{A}{S} = \frac{\binom{3}{1} \binom{48}{3} + \binom{3}{2} \binom{48}{2} + \binom{3}{3} \binom{48}{1}}{\binom{51}{4}} = 0.2214\ldots
\]
}

\ppart Suppose your friend says, ``I have an ace.''  What is the
probability that she has another ace?

\solution{The sample space and outcome probabilities are the same as
before.  Let $L$ be the event that your friend has at least one ace,
and $M$ be the event that your friend has more than one ace.  Our goal
it to compute:
%
\[
\prcond{M}{L} = \frac{\pr{M \cap L}}{\pr{L}} = \frac{\pr{M}}{\pr{L}}
\]
%
The second equality holds because your friend surely at least one ace
if she has more than one; that is, $M \subseteq L$.  The probability
that your friend has at least one ace is:
%
\[
\pr{L} = \frac{
  \binom{4}{1}\binom{48}{4} +
  \binom{4}{2}\binom{48}{3} +
  \binom{4}{3}\binom{48}{2} +
  \binom{4}{4}\binom{48}{1}}{\binom{52}{5}}
\]
%
The first term counts hands with a single ace, since there are
$\binom{4}{1}$ ways to choose the ace and $\binom{48}{4}$ ways to
choose the remaining four cards.  The remaining terms are similar.
The probability that your friend has more than one ace is:
%
\[
\pr{M} = \frac{
  \binom{4}{2}\binom{48}{3} +
  \binom{4}{3}\binom{48}{2} +
  \binom{4}{4}\binom{48}{1}}{\binom{52}{5}}
\]
%
Plugging these results into the original equation gives:
%
\[
\prcond{M}{L} =
  \frac{\binom{4}{2}\binom{48}{3} +
        \binom{4}{3}\binom{48}{2} +
        \binom{4}{4}\binom{48}{1}}
       {\binom{4}{1}\binom{48}{4} +
        \binom{4}{2}\binom{48}{3} +
        \binom{4}{3}\binom{48}{2} +
        \binom{4}{4}\binom{48}{1}} = 0.12285\ldots
\]
}

\ppart Are your answers to (a) and (b) the same?  Explain why.

\solution{The answers are different.  There are four aces, so there
are sixteen different subsets of aces that your friend could have.
%
\begin{itemize}
\item If your friend says, ``I have the ace of spades'', then
\textit{eight} of these subsets are ruled out: those not containing
the ace of spades.
\item However, if your friend says, ``I have an ace'', then only
\textit{one} subset is ruled out: the subset containing no aces.
\end{itemize}
%
Thus, the probability that your friend has a second ace is different
in these two cases, because we are conditioning on two very different
events!}

\eparts

\end{problem}

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

\iffalse
\begin{problem}
Using only a slightly bent coin, three roommates must decide who has
to scrub the bathtub.  They hit upon the following procedure.
%
\begin{enumerate}

\item Flip the coin three times.

\item If the coin lands the same way every time, then go to step 1.

\item Otherwise, one of the flips lands differently from the other
two.  If the $n$-th toss is the different one, then the $n$-th
roommate must clean the tub.  For example, if the last three flips are
$THT$, then the second roommate gets friendly with soapscum.

\end{enumerate}
%
Suppose that the slightly-bent coin lands heads-up with probability
$p$, where $0 < p < 1$.

(For this problem, the complete tree diagram is infinite.  However, a
tree

\bparts

\ppart What is the probability that the branch back to step 1 is
taken?

\solution{$p^3 + (1-p)^3$}

\ppart If step 3 is reached, what is the probability that two of the
last three flips were heads?

\solution{$p$}

\ppart Compute the probability that the second roommate must clean the
tub.

\eparts

(For this problem, the tree diagram is actually \textit{infinite}.
However, drawing enough of the tree diagram to see a pattern may be
helpful.  To compute the probability of an infinite envent, you must
sum an infinite number of outcome probabilities.)

\end{problem}
\fi

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

\begin{problem} \textit{Finalphobia} is a rare
disease in which the victim has the delusion that he or she is being
subjected to an intense mathematical examination.
%
\begin{itemize}
\item A person selected uniformly at random has finalphobia with probability
$1/100$.
\item A person with finalphobia has shaky hands with probability $9/10$.
\item A person without finalphobia has shaky hands with probability $1/20$.
\end{itemize}
%
What is the probablility that a person selected uniformly at random
has finalphobia, given that he or she has shaky hands?

\solution{
Let $F$ be the event that the randomly-selected person has
finalphobia, and let $S$ be the event that he or she has shaky hands.
A tree diagram is worked out below:
%
\begin{center}
\includegraphics{finalphobia}
\end{center}
%
The probability that a person has finalphobia, given that he or she
has shaky hands is:
%
\begin{align*}
\prcond{F}{S}
    & = \frac{\pr{F \cap S}}{\pr{S}} \\
    & = \frac{9/1000}{9/1000 + 99/2000} \\
    & = \frac{18}{18+99} \\
    & = \frac{18}{117}
\end{align*}

So, while it's true that someone with shaky hands is five times more
likely to have finalphobia than someone with steady hands, it remains a
poor bet --about 1 in 5 --that someone with shaky hands actually has does
have finalphobia.}

\end{problem}

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

\begin{problem}
Outside of their hum-drum duties as 6.042 TAs, Sayan is trying to
learn to levitate using only intense concentration and Jelani is
launching a ``Nelson 2008'' presidential campaign.  Suppose that Sayan's
probability of levitating is $1/6$, Jelani's chance of becoming
president is $1/4$, and the success of one does not alter the other's
chances.

\bparts

\ppart If at least one of them succeeds, what is the probability that
Sayan learns to levitate?

\solution{Let $L$ be the event that Sayan learns to levitate, and let
$P$ be the event that Jelani becomes president.  We can work out the
desired probability as follows:
%
\begin{align*}
\prcond{L}{(L \cup P)}
	& = \frac{\pr{L \cap (L \cup P)}}{\pr{L \cup P}} \\
	& = \frac{\pr{L}}{1 - \pr{\overline{L} \cap \overline{P}}} \\
	& = \frac{1/6}{1 - (1 - 1/6)(1 - 1/4)} \\
	& = \frac{4}{9}
\end{align*}
%
The first step uses the definition of conditional probability.  In the
second step, we rewrite both the top and bottom of the fraction using
set identities.  Then we substitute in the given probability and
simplify.}

\ppart If at most one of them succeeds, what is the probability that
Jelani becomes the president of the United States?

\solution{
Define events $L$ and $P$ as before.
%
\begin{align*}
\prcond{P}{\paren{\overline{L} \cup \overline{P}}}
	& = \frac{\pr{P \cap \paren{\overline{L} \cup \overline{P}}}}
		{\pr{\overline{L} \cup \overline{P}}} \\
	& = \frac{\pr{P \cap \overline{L}}}
		{1 - \pr{L \cap P}} \\
	& = \frac{(1/4) \cdot (5/6)}{1 - (1/6) \cdot (1/4)} \\
	& = \frac{5}{23}
\end{align*}
}

\ppart If exactly one of them succeeds, what is the probability that
it is Sayan?

\solution{
\begin{align*}
\prcond{L}{\paren{\paren{L \cap \overline{P}} \cup \paren{\overline{L} \cap P}}}
	& = \frac{\pr{L \cap \overline{P}}}
		{\pr{(L \cap \overline{P}) \cup
		(\overline{L} \cap P)}} \\
	& = \frac{(1/6) \cdot (3/4)}
		{(1/6) \cdot (3/4) + (5/6) \cdot (1/4)} \\
	& = \frac{3}{8}
\end{align*}
}

\eparts
\end{problem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{problem}

Suppose $n$ balls are thrown randomly into $n$ boxes, so each ball lands in
each box with uniform probability.  Also, suppose the outcome of each throw
is independent of all the other throws.

\bparts

\ppart Let $X_i$ be an indicator random variable whose value is $1$ if box
$i$ is empty and $0$ otherwise.  Write a simple closed form expression for
the probability distribution of $X_i$.   Are $X_1, X_2, \ldots, X_n$
independent random variables?

\solution{
Box $i$ is empty iff all $n$ balls land in other boxes.  The probability
that a ball will land in another box in $(n-1)/n = 1- (1/n)$, and since
the balls are thrown independently, we have
\begin{equation}\label{pxi}
\prob{X_i=1} = \paren{1 - \frac{1}{n}}^n.
\end{equation}
The $X_i$'s are not independent.  For example, 
\[
\prob{X_1=X_2=\cdots = X_n=1}=0 < \prod_{i=1}^n \prob{X_i = 1}.
\]
}

\iffalse
\ppart Find a constant, $c$, such that the expected number of empty boxes
is asymptotically equal ($\sim$) to $cn$.

\solution{The number of empty boxes is the sum of the $X_i$'s.  So the
expected number of empty boxes is the sum of the expectations of the
$X_i$'.  By~\eqref{pxi}, we now have
\[
\Ex{\text{number of empty boxes}} = n\ex{X_1} = n\paren{1 - \frac{1}{n}}^n \sim
n\cdot\frac{1}{e}
\]
That is,
\[
c = \frac{1}{e}
\]
}
\fi

\ppart Show that
\[
\prob{\text{at least $k$ balls fall in the first box}}
\leq {\binom{n}{k}} \left(\frac{1}{n}\right)^k.
\]

\solution{Let $S$ be a set of $k$ of the $n$ balls, and let $E_S$ be the
event that each of these $k$ balls falls in the first box.  Since the
probability that a ball lands in this box is $1/n$, and the throws are
independent, we have
\begin{equation}\label{ES}
\prob{E_S}=\paren{\frac{1}{n}}^k.
\end{equation}
The event that \emph{at least} $k$ balls land in the first box is the
union of all the events $E_S$.  There are $\binom{n}{k}$ subsets, $S$, of
$k$ balls, so by the Union Bound,
\[
\prob{\text{at least $k$ balls fall in the first box}}
\leq {\binom{n}{k}} \cdot \prob{E_S}.
\]
Using the value for $\prob{E_S}$ from~\eqref{ES} in the preceding
inequality yields the required bound.
}

\ppart Let $R$ be the maximum of the numbers of balls that land in each of
the boxes.  Conclude from the previous parts that
\[
\pr{R \geq k} \leq \frac{n}{k!}.
\]

\solution{ Note that $R \geq k$ exactly when some box has at least $k$
balls.  Since the bound on the probability of at least $k$ balls in the
first box applies just as well to any box, we can apply the Union Bound to
having at least $k$ balls in at least one of the $n$ boxes:
\[
\prob{R \geq k} \leq n\prob{\text{at least $k$ balls fall in the first
box}}.
\]
So from the previous problem part, we have
\begin{align*}
\prob{R \geq k} & \leq n\binom{n}{k} \paren{\frac{1}{n}}^{k}\\
                & = n\paren{\frac{n(n-1)\cdots(n-k+1)}{k!\, n^k}}\\
                & = \frac{n}{k!}
                        \paren{\frac{n}{n} \cdot \frac{n-1}{n} \cdots \frac{n-k+1}{n}}
                    \\
                & \leq \frac{n}{k!}
\end{align*}
}

\ppart Conclude that 
\[
\lim_{n \to \infty} \pr{R \geq n^{\epsilon}} = 0
\]
for all $\epsilon >0$.

\solution{Using Stirling's formula, and the upper bound from the previous
part, we have
\[
\pr{R \geq k} \leq
\frac{n}{k!} \sim \frac{n}{\sqrt{2\pi k}(k/e)^k} \leq
\frac{n}{(k/e)^k} = \frac{ne^k}{k^k} = 
\frac{e^{k + \ln n}}{e^{k \ln k}}.
\]
Now let $k= n^{\epsilon}$.  Then the exponent of $e$ in the numerator
above is $n^{\epsilon} + \ln n$, and the exponent of $e$ in the
denominator is $n^{\epsilon} \ln n^{\epsilon}= \epsilon n^{\epsilon} \ln
n$.  Since
\[
n^{\epsilon} + \ln n = o(n^{\epsilon} \ln n^{\epsilon}),
\]
we conclude
\[
\pr{R \geq n^{\epsilon}} \leq \frac{e^{n^{\epsilon} + \ln
n}}{e^{\epsilon n^{\epsilon} \ln n}} \to 0
\]
as $n$ approaches $\infty$.
}

\iffalse

\medskip

Two special cases of the Theorem are worth singling out because they come
up all the time.
\begin{corollary*}
Suppose an event has probability $1/m$.  Then the probability that the
even will occur at least once in $m$ independent trials is approximately
$1- 1/e \approx 63\%$.  There is a 50\% chance the event will occur in $n
= \log 2 m \approx 0.69m$ trials.
\end{corollary*}


\ppart
Prove the Corollary.

\solution{
From the Taylor's expansion of $e^x$, we have
\begin{equation} \label{1+xesim}
1 + x \approx e^x,
\end{equation}
for $0 \leq x \leq 1$.

In this case, $\pr{A_i}=1/m$ for $1\leq i \leq n$ and
\[
\expect{\text{\# occurrences}} = n \frac{1}{m} = \frac{n}{m}.
\]
So by the Theorem,
\[
\pr{\text{no occurrence}} \leq e^{-(n/m)},
\]
and therefore
\begin{equation}\label{1-enm}
\pr{\text{at least one occurrence}} \geq 1 - e^{-(n/m)}.
\end{equation}
In fact, it follows from by~(\ref{1+xesim}), that the $\geq$
in~(\ref{1-enm}) is an approximate equality.

So if the number, $n$ of trials is $m$, we have
\[
\pr{\text{at least one occurrence}} \approx 1- e^{-(m/m)} = 1-\frac{1}{e}.
\]

If we want
\[
1 - e^{-(n/m)} \approx \pr{\text{at least one occurrence}} \approx
\frac{1}{2},
\]
then we need
\[
e^{-(n/m)} \approx \frac{1}{2},
\]
so taking log's we conclude
\[
n \approx m\log 2.
\]
}

\fi

\eparts

\end{problem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{problem}

(An open-ended discussion question.)  Consider a set, $S$, consisting of
77 twenty-one digit numbers.  We can use the pigeonhole principle to prove
that two distinct subsets of the numbers in $S$ have the same sum, but
actually finding two such sets is can be difficult.  Naively, we could sum
the elements in all $2^{77}$ subsets and find two that match, but this is
a huge computational task.

Recall the birthday principle: If there are $d$ days in a year and
$\sqrt{2d}$ people in a room, then the probability that two share a
birthday is about $1 - 1/e = 0.632\ldots$.

How could the birthday principle help you find two distinct subsets of $S$
with the same sum using significantly fewer than $2^{77}$ operations
---say only a trillion operations?  What assumptions must you make?
\end{problem}

\solution{Assume that the sums are uniformly distributed, mutually
independent random variables taking on values in the range $[0,\dots, 77
\cdot 10^{21}]$.  Then we have a good chance of finding two subsets with
the same sum if the number of subsets we consider is about:
\[
\sqrt{2 \cdot 77 \cdot 10^{21} \approx 4 \cdot 10^{11}}
\]

Of course, the sums are not uniformly distributed; in fact, the sum of
a random subset is likely to be close to the expected value.  This
nonuniformity only improves the computational picture, however.  (If
almost everyone were born in July, then finding two people with
the same birthday would be easier.)

The sums are also not mutually independent.  However, if we sum a few
hundred billion selected at random, then the sets are likely to be
different enough that their sums are ``mostly kinda'' independent.

Overall, it seems that several billion sums should suffice to find two
subsets with the same sum.}


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

\end{document}
