\documentclass[11pt,twoside]{article}

\usepackage{latex-macros/course}

\begin{document} 
\inclassproblems{14, Wed.}

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

\begin{problem}
Here is a fun game.  You pick a number between 1 and 6.  Then you roll
three fair, independent dice.

\begin{itemize}

\item If your number never comes up, then you lose one dollar.

\item If you number comes up once, then you win one dollar.

\item If your number comes up twice, then you win two dollars.

\item If your number comes up three times, then you win $k$ dollars.

\end{itemize}

\bparts

\item Compute your expected payoff as a function of $k$.

\solution[\vspace{2in}]{ Let the random variable $P$ be your payoff.
Then we can compute $\expect{P}$ as follows:
\begin{align*}
\expect{P}  & = -1 \cdot \pr{\text{0 matches}} +
             1 \cdot \pr{\text{1 match}} +
             2 \cdot \pr{\text{2 matches}} +
             k \cdot \pr{\text{3 matches}} \\
        & = -1 \cdot \left(\frac{5}{6}\right)^3 +
             1 \cdot 3\left(\frac{1}{6}\right)\left(\frac{5}{6}\right)^2 +
             2 \cdot 3\left(\frac{1}{6}\right)^2\left(\frac{5}{6}\right) +
             k \cdot \left(\frac{1}{6}\right)^3 \\
        & =  \frac{-125 + 75 + 30 + k}{216}
\end{align*}
}

\item For what value of $k$ is this game fair?

\solution{ The game is fair when $\expect{P} = 0$.  This happens when $k =
20$.}

\eparts

\end{problem}

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

\instatements{\newpage}

\begin{problem}
Suppose that we create a a national database of DNA profiles.  Let's
make some simplistic assumptions:
\begin{itemize}
\item Each person can be classified into one of \underline{20 billion}
different ``DNA types''.
\item Each DNA type is equally probable.
\item The DNA types of Americans are mutually independent random variables.
\end{itemize}

\bparts

\ppart A congressman argues that there are only about 250 million
Americans, so the probability of a coincidental match is very small.
How large must the database actually be in order for the probability
of at least one coincidental match be about even?

\solution[\vspace{2in}]{By the birthday principle, the probability of
a match is around half when the number of entries is:
\begin{equation*}
\sqrt{2 \cdot 20,000,000,000} = 200,000
\end{equation*}
}

\ppart Suppose that DNA from all 250 million Americans is placed in
the database.  What is the expected number of coincidental matches?
(Let $I_{xy}$ be an indicator for the event that person $x$ and person
$y$ have the same DNA type and use linearity of expectation.)

\solution[\vspace{2in}]{The number of coincidental matches in the
database is:
\[
\sum_{x \neq y} I_{xy}
\]
where $x$ and $y$ range over all 250,000,000 Americans.  The expected
number of coincidental matches is:
\begin{align*}
\expect{\sum_{x \neq y} I_{xy}}
    & = \sum_{x \neq y} \expect{I_{xy}} \\
    & = \binom{250,000,000}{2} \cdot \frac{1}{20,000,000} \\
    & \approx 1.5 \text{ million}
\end{align*}
}

\ppart Person $x$ is arrested for a crime that was committed by person
$y$.  The crime lab says $x$ and $y$ have the same DNA type.  The
prosecutor argues that the probability that $x$ and $y$ are different
people is only 1 in 20 billion.  Write the prosecutor's assertion in
mathematical notation and explain her error.

\solution[\vspace{1in}]{The prosecutor is asserting that:
\begin{equation*}
\prcond{x \neq y}{I_{xy} = 1} = 2 \cdot 10^{-10}
\end{equation*}
This turns around the correct assertion:
\begin{equation*}
\prcond{I_{xy} = 1}{x \neq y } = 2 \cdot 10^{-10}
\end{equation*}
}

\eparts

\end{problem}

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

\instatements{\newpage}

\begin{problem}
A classroom has sixteen desks arranged as shown below.

\bigskip
\centerline{\resizebox{!}{1.5in}{\includegraphics{desks}}}
\bigskip

If there is a girl in front, behind, to the left, or to the right of a
boy, then the two of them {\em flirt}.  One student may be in multiple
flirting couples; for example, a student in a corner of the classroom
can flirt with up to two others, while a student in the center can
flirt with as many as four others.

Suppose that desks are occupied by boys and girls with equal
probability and mutually independently.  What is the expected number
of flirting couples?  Justify your answer.

\solution{First, let's count the number of pairs of adjacent desks.
There are three in each row and three in each column.  Since there are
four rows and four columns, there are $3 \cdot 4 + 3 \cdot 4 = 24$
pairs of adjacent desks.

Number these pairs of adjacent desks from 1 to 24.  Let $F_i$ be an
indicator for the event that occupants of the desks in the $i$-th pair
are flirting.  The number we want is then:

\begin{align*}
\expect{\sum_{i=1}^{24} F_i}
	& = \sum_{i=1}^{24} \expect{F_i} \\
	& = \sum_{i=1}^{24} \pr{F_i = 1}
\end{align*}

The first step uses linearity of expectation, and the second step uses
the fact that the expecatation of an indicator is equal to the
probability that it is 1.

The occupants of adjacent desks are flirting if the first holds a girl
and the second a boy or vice versa.  Each of these events happens with
probability $\frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}$, and so the
probability that the occupants flirt is $\pr{F_i = 1} = \frac{1}{4} +
\frac{1}{4} = \frac{1}{2}$.  Plugging this into the previous
expression gives:

\begin{align*}
\expect{\sum_{i=1}^{24} F_i}
	& = \sum_{i=1}^{24} \pr{F_i = 1} \\
	& = 24 \cdot \frac{1}{2} \\
	& = 12
\end{align*}
}
\end{problem}

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

\end{document}
