\documentstyle[12pt]{article}

\oddsidemargin 5pt \evensidemargin 5pt \marginparwidth 68pt
\marginparsep 10pt \topmargin 10pt \headheight 10pt
\headsep 15pt \footskip 35pt
\textheight = 625pt  \textwidth 440pt \columnsep 10pt \columnseprule 5pt

\pagestyle{myheadings}
\def\la{\langle}  \def\ra{\rangle}
\def\header{{\hfill Exam 2 \hfill A. Miller \hfill Spring  99
                                       \hfill Math 210\hfill}}
\markboth\header\header
\newcount\probno
\newcount\total
\newwrite\examTBLFile

\probno=0
\def\prob#1{\advance\probno by 1 \newpage  % \par
    \noindent\the\probno . (#1 \%) \advance\total by #1
    \immediate\write\examTBLFile{\the\probno
       \string& #1 \string&
       \string\qquad \string\\ \string\hline}}

\def\probx#1{\advance\probno by 1 % \newpage  % \par
    \noindent\the\probno . \advance\total by #1
    \immediate\write\examTBLFile{\the\probno
       \string& #1 \string&
       \string\qquad \string\\ \string\hline}}
\def\finishtbl{
    \immediate\write\examTBLFile{Total \string& \the\total
    \string& \qquad \string\\ \string\hline}
     }

\newwrite\ans
\immediate\openout\ans=answers
\outer\def\answer{\par\medbreak
  \immediate\write\ans{}
  \immediate\write\ans{\string\bigskip \the\probno . }
  \copytoblankline}
\outer\def\putanswer{\par\medbreak
  \immediate\write\ans{}
  \copytoblankline}
\def\copytoblankline{\begingroup\setupcopy\copyans}
\def\setupcopy{\def\do##1{\catcode`##1=12}\dospecials
     \catcode`\|=12\obeylines}
{\obeylines \gdef\copyans#1
  {\def\next{#1}%
  \ifx\next\empty\let\next=\endgroup%
  \else\immediate\write\ans{\next}\let\next=\copyans\fi\next}}
\def\printanswers{\newpage\begin{center} Answers \end{center}
    \immediate\closeout\ans\input answers}

\begin{document}
\noindent  \header

\bigskip

\begin{center}
No calculators.  No note or index cards.   \\
Show all work.  Explain your answers.      \\
In general, little credit will be given for answers alone. \\
You do not need to simplify fractions or combinatorial expressions.\\
No partial credit for examples alone.
\end{center}

\par\vskip .25in

\begin{center}
Name\makebox[3in]{\hrulefill} \\
\end{center}

\begin{center}
TA: Winston Yang\\
Circle the time of your discussion section: \\
\end{center}
\begin{center}
\hfill Tues 8:50 \hfill Tues 9:55
\hfill Thurs 8:50 \hfill Thurs 9:55 \hfill \\
\end{center}

% end file with \finishtbl
\bigskip
\begin{center} \Large
 \begin{tabular}{||c|c|c||} \hline\hline
  Problem & Points & Score \\  \hline\hline
  \input{exam.tbl}
  \hline \hline
 \end{tabular}
\end{center}

\immediate\openout\examTBLFile=exam.tbl

\setcounter{page}{0}

% Repeat from last exam.
\prob{10} The letters
  \par\bigskip
  \fbox{C} \hfill
  \fbox{D} \hfill
  \fbox{G} \hfill
  \fbox{K} \hfill
  \fbox{L} \hfill
  \fbox{O} \hfill
  \fbox{O} \hfill
  \fbox{U} \hfill
\par\bigskip\noindent are placed in a hat and mixed thourougly.
One at a time they are drawn out and placed on a table (not replaced
into the hat).  What is
the probability
that they spell out: GOODLUCK
\answer If we put subscripts on the 0's, i.e.,
$GO_1O_2DLUCK$, then there would be $8!$ permutations of these
letters and each of these permutations is equally likely to occur.
Exactly two, $GO_1O_2DLUCK$ and $GO_2O_1DLUCK$, spell out
GOODLUCK when we drop the subscripts.  Hence the probability
is ${2\over 8!}$.

% Repeat from last exam.
\prob{10} Four baskets each contain 10 balls labeled
1 thru 10.  A ball is randomly chosen from each basket.
What is the probability that at least two of the balls have
the same number?
\answer This is similar to the birthday problem.  If instead we
count the complementary event, $E^\prime$, i.e., no two balls have the same
number, then out of ${10\times 10\times 10 \times 10}$ possible choices
there are ${10\times 9\times 8 \times 7}$ choices with no number repeated,
so
$$Pr(E^\prime)= {{10\times 9\times 8 \times 7} \over
           {10\times 10\times 10 \times 10}}$$
and $Pr(E)=1-Pr(E^\prime)$ so the answer is
$$1-{{10\times 9\times 8 \times 7} \over
           {10\times 10\times 10 \times 10}}$$
We can also compute the probability of $E^\prime$ using conditional
probability.  If we let $B_1=S$, and $B_2$ be the event that
the first two balls have different numbers, $B_3$ the event that
the first 3 balls have different numbers and $B_4$ the event that
all 4 balls have different numbers.  Then $B_4=E^\prime$ and
$B_4=B_1\cap B_2\cap B_3\cap B_4$.
By conditional probability:
$$Pr(B_1\cap B_2\cap B_3\cap B_4)=
  Pr(B_1)\times Pr(B_2|B_1)\times
  Pr(B_3|(B_2\cap B_1))\times Pr(B_4|(B_3\cap B_2\cap B_1))
$$
and this product is
$$1\times {9\over 10}\times {8\over 10}\times {7\over 10}$$

% 4.2
\prob{10}
A box contains 1 red, 1 white, and 2 green balls.  A game consists
of drawing balls in succession without replacement until a white ball
is drawn.  Suppose you get 4 points for each green ball and 8 points
for each red ball drawn.  Let $X$ be the total number of points you get.
\par What are the possible values of the random variable $X$?
\par What is the probability density function for $X$?
\par What is the expected value, $\mu=E(X)$, of the random variable $X$?
\answer We make the following chart:
$$\begin{tabular}{||c|c|c|c||}
 \hline\hline
 Outcome  & Probability & Probability & Value of $X$  \\ \hline
 \hline\hline
 W    & $1/4$                      & $3/12$    & 0   \\ \hline
 RW   & $1/4\times 1/3$            & $1/12$    & 8   \\ \hline
 GW   & $2/4\times 1/3$            & $2/12$    & 4   \\ \hline
 RGW  & $1/4\times 2/3\times 1/2$   & $1/12$    & 12  \\ \hline
 GRW  & $2/4\times 1/3\times 1/2$   & $1/12$    & 12  \\ \hline
 GGW  & $2/4\times 1/3\times 1/2$   & $1/12$    & 8   \\ \hline
 RGGW & $1/4\times 2/3\times 1/2$   & $1/12$    & 16   \\ \hline
 GRGW & $2/4\times 1/3\times 1/2$   & $1/12$    & 16   \\ \hline
 GGRW & $1/4\times 2/3\times 1/2$   & $1/12$    & 16   \\ \hline
 \hline
\end{tabular}$$
We see from the chart that the possible values of $X$ are
$0,4,8,12,$ and 16.  The density function for $X$ is the
first two columns of the chart below:
$$\begin{tabular}{||c|c|c||}
 \hline\hline
 k=Value of $X$ & $Pr(X=k)$ & $k\times Pr(X=k)$ \\ \hline
 \hline\hline
 0    &  $3/12$    &  $0$      \\ \hline
 4    &  $2/12$    &  $8/12$  \\ \hline
 8    &  $2/12$    &  $16/12$   \\ \hline
 12   &  $2/12$    &  $24/12$  \\ \hline
 16   &  $3/12$    &  $48/12$  \\ \hline
 \hline
\end{tabular}$$
The expected value of $X$ is obtained by adding the numbers
$k\times Pr(X=k)$ for all possible values $k$.  Summing
the third column gives us $E(X)=(8+16+24+48)/12$.

% 3.1
\prob{10}
The axioms for a probability, $Pr(E)$ for
$E\subseteq S$, are the following:
\par (1) $0\leq Pr(E)\leq 1$ for each $E\subseteq S$,
\par (2) $Pr(S)=1$, and
\par (3) if $E_1$ and $E_2$ are disjoint subsets of $S$, then
$Pr(E_1\cup E_2)=Pr(E_1)+Pr(E_2)$.

\par\bigskip\noindent Using these axioms deduce the formula
$$Pr(A\cup B)=Pr(A)+Pr(B)-Pr(A\cap B)$$
where $A$ and $B$ are any subsets of $S$.
\answer I did this twice in lecture.  We can write
$A\cup B$ as the disjoint union
$$A\cup B= A\cup (A^\prime\cap B)$$
By
the axiom (3) we have that
$$Pr(A\cup B)=Pr(A\cup (A^\prime\cap B))=Pr(A)+ Pr(A^\prime\cap B)$$
The event $B$ can be written as a disjoint union:
$$B=(A\cap B)\cup (A^\prime\cap B)$$
and so by axiom (3)
$$Pr(B)=Pr(A\cap B)+Pr(A^\prime\cap B)$$
and so
$$Pr(A^\prime\cap B)=Pr(B)-Pr(A\cap B)$$
Substituting this into our first formula we have
$$Pr(A\cup B)=Pr(A)+ Pr(A^\prime\cap B)= Pr(A)+ Pr(B)-Pr(A\cap B)$$


\def\ch(#1,#2){\left(\begin{array}{c} #1 \\ #2 \end{array}\right)}

% 3.2
\prob{10}
Suppose there are 3 women, 2 men, and 5 children in a room.
3 of the 10 are chosen at random.  What is the probability
that at least 1 of the 3 chosen is a woman if we are given that at
least 1 of the 3 chosen is a child?
\answer Let $S$ be the set of all groups of three chosen from
these 10 people.  Let $W$ be the set of all groups of three
where at least one woman is chosen,
and $C$ be the set of all groups with at least one child.
Hence
$$Pr(\mbox{ at least one child is chosen })={|C|\over |S|}$$
The conditional probability we are asked for is:
$$Pr(\mbox{ at least one woman }| \mbox{ at least one child } )=
{{|W\cap C|/ |S|}\over {|C|/ |S|}}= {|W\cap C|\over |C|}$$
$|C^\prime|$ is the set of groups of three which includes no child.
There are $\ch(5,3)$ ways to choose 3 nonchildren,
hence
$$|C^\prime|=\ch(5,3)$$
There
$\ch(10,3)$ ways to choose 3 people from 10 so $|S|=\ch(10,3)$
and so
$$|C|=\ch(10,3)-\ch(5,3)$$
To calculate $|W\cap C|$ break it
into the three disjoint sets:
\par $B_1$: elements of $S$ consisting of one child, one woman, one man.
\par $B_2$: elements of $S$ consisting of one child, two women.
\par $B_3$: elements of $S$ consisting of two children, one woman.
\par Since $W\cap C$ is the disjoint union of $B_1,B_2,B_3$
we compute these three sizes and add the results.
\par $|B_1|$: there are $5\times 3\times 2$ groups of 3 like this, i.e.,
choose one child from 5, one woman from 3, and one man from 2.
\par $|B_2|$: there are $5\times  \ch(3,2)$ groups of 3 like this.
\par $|B_3|$: there are $\ch(5,2)\times 3$ groups of 3 like this.
Hence the answer is:
$$
{5\times 3\times 2 \;\;+\;\; 5\times\ch(3,2)\;\; + \;\;\ch(5,2)\times 3}
\over
{\ch(10,3)-{\ch(5,3)}
}$$

% 3.3
\prob{10}
A box contains 3 ripe bananas (R) and 4 green bananas (G).
A monkey reaches in and grabs a banana at random.  Since the
box has a very small opening the monkey is unable to see the
banana before he choses it and so is equally likely to pick
any of the 7 bananas.
\par If it
is green he puts it back in the box, but if it is ripe he eats it.
In either case the monkey reaches in again
and randomly grabs another banana from those now in the box.
\par He does this only two times and he eats only ripe
bananas.
\par\bigskip (a) Draw a tree to represent this experiment and compute the
probabilities of all outcomes.
\par\vspace{4in} (b) What is the probability that the monkey eats exactly
one banana?
\answer (a) The probability of each outcome is obtained
by multiplying along the branch.
\par\begin{minipage}[t]{2in}
$$\begin{tabular}{||c|c||}
 \hline\hline
 Outcome & Probability \\ \hline
 \hline\hline
 RR    &  ${3\over 7}\times {2\over 6}$    \\ \hline
 RG    &  ${3\over 7}\times {4\over 6}$    \\ \hline
 GR    &  ${4\over 7}\times {3\over 7}$    \\ \hline
 GG    &  ${4\over 7}\times {4\over 7}$    \\ \hline
 \hline
\end{tabular}$$
\end{minipage}
\begin{minipage}[t]{2in}
\par \unitlength=1.00mm
\special{em:linewidth 0.4pt}
\linethickness{0.4pt}
\begin{picture}(44.00,63.00)
\put(28.00,54.00){\makebox(0,0)[cc]{R}}
\put(28.00,26.00){\makebox(0,0)[cc]{G}}
\put(44.00,63.00){\makebox(0,0)[cc]{R}}
\put(44.00,45.00){\makebox(0,0)[cc]{G}}
\put(44.00,35.00){\makebox(0,0)[cc]{R}}
\put(44.00,17.00){\makebox(0,0)[cc]{G}}
\put(16.00,53.00){\makebox(0,0)[cc]{3/7}}
\put(16.00,29.00){\makebox(0,0)[cc]{4/7}}
\put(32.00,61.00){\makebox(0,0)[cc]{2/6}}
\put(32.00,47.00){\makebox(0,0)[cc]{4/6}}
\put(32.00,33.00){\makebox(0,0)[cc]{3/7}}
\put(32.00,19.00){\makebox(0,0)[cc]{4/7}}
\put(10.00,40.00){\line(1,1){13.00}}
\put(10.00,40.00){\line(1,-1){13.00}}
\put(32.00,54.00){\line(1,1){8.00}}
\put(32.00,54.00){\line(1,-1){7.00}}
\put(32.00,26.00){\line(1,1){8.00}}
\put(32.00,26.00){\line(1,-1){8.00}}
\end{picture}
\end{minipage}
\par\noindent He eats exactly one banana is the event $\{RG,GR\}$,
which has probablity
$$({3\over 7}\times {4\over 6})+
({4\over 7}\times {3\over 7})$$

% 3.4
\prob{10}
Max has two coins, one is fair and the other is weighted so that the
probability of heads is $2\over 3$.   One of the two coins is selected
at random (with equal probability) and then it is flipped two times.
If it comes up heads
both times, what is the probability that the unfair coin was selected?
\answer Let $F$ denote the event that the fair coin is chosen and let
$U$ denote the complementary event that the unfair coin is chosen.
Let $HH$ denote the event that two heads occur when either coin is
chosen.  We are told that
$$Pr(U)=Pr(F)={1\over 2}$$
$$Pr(HH|F)={1\over 2}\times {1\over 2}={1\over 4}$$
$$Pr(HH|U)={2\over 3}\times {2\over 3}={4\over 9}$$
and are asked what is $Pr(U|HH)$?
We know by the definition of conditional probability that
$$Pr(U|HH)={ Pr(U\cap HH)\over Pr(HH)}$$
To compute this note that $HH$ is split into the disjoint
sets $$HH=(U\cap HH)\cup (F\cap HH)$$
since the events $U$ and $F$ are complementary. Thus
$$Pr(HH)=Pr(U\cap HH)+Pr(F\cap HH)$$
Hence
$$Pr(U|HH)={ Pr(U\cap HH)\over Pr(HH)}=
{Pr(U\cap HH)\over Pr(U\cap HH)+Pr(F\cap HH) }=
{1 \over {1+ {Pr(F\cap HH) \over Pr(U\cap HH)}}}
$$
But again by the definition of conditional probability
$$Pr(HH|F)={Pr(F\cap HH) \over Pr(F)}$$
and so
$$Pr(F\cap HH)=Pr(F)\times Pr(HH|F)= {1\over 2}\times {1\over 4}={1\over 8}$$
and similarly
$$Pr(U\cap HH)=Pr(U)\times Pr(HH|U)= {1\over 2}\times {4\over 9}={2\over 9}$$
Hence
$$Pr(U|HH)= {1 \over {1+ { 1/8 \over 2/9 }}}$$
Of course, this is just another way to write Bayes formula:
$$Pr(U|HH)={ {Pr(U)  Pr(HH|U)}
              \over
             {Pr(U)  Pr(HH|U)\;\;+ \;\;Pr(F)  Pr(HH|F)}  }
          ={ {2\over 9}
              \over
             {{2\over 9}+ {1\over 8}}}
$$

% 3.5
\prob{10}
The fly-by-night FBN airline advertises that its flights are on
time 90 percent of the time.  A business woman takes 6 trips
with FBN, each of which consists of 2 flights, i.e., one to
her destination and one returning.

\par Assume that the late-not late flights are a sequence of 12
independent Bernouilli trials.

\par\bigskip (a) What is the probability that at least one of the two flights
of her first trip is late?
\par\vfill (b) What is the probability
that on all of her trips at least one of the two flights is late?
\par\vfill (c) What is the probability
that on more than one of her trips both flights are late?
\par\vfill
\answer (a) The probability that both flights are on time is
$.9\times .9=.81$  Hence the probabilty that at least one of the
two is late is  $1-.81=.19$
\par (b) Call a trip bad if at least one of the two flights is late.
By part (a) the probability of a bad trip is $.19$  Hence
the probability that all 6 trips are bad is
$$.19 \times .19 \times .19 \times .19 \times .19 \times .19=(.19)^6$$
\par (c) Call a trip superbad if both flights are late.  The probability
of a superbad flight is $.1 \times .1= .01$.   Let
$E_0, E_1,\ldots, E_6$
be the events defined by
\par $E_0$ is the event that there are no superbad trips out of six,
\par $E_1$ is the event that there is exactly  1 superbad trips out of six,
\par $E_2$ is the event that there are exactly  2 superbad trips out of six,
and so on up to
\par $E_6$ exactly $6$ superbad trips.
\par What we are asked for is
$$Pr(E_2\cup E_3\cup \cdots \cup E_6)$$
Since the $E_k$ partition our probability space
this is exactly the same as
$$1-Pr(E_0)-Pr(E_1)$$
We have that $Pr(E_0)=(.99)^6$ and $Pr(E_1)=6\times (.01)\times(.99)^5$
We get the six here because there are 6 choices for which trip
is superbad.
Thus the answer is
$$1-(.99)^6 -6\times (.01)\times(.99)^5$$

% 4.2
\prob{10}  An experiment consists of rolling a fair die and noting
the number that comes up.  A random variable $X$ is defined by
$X=1$ if the die comes up 1,2,3,4, or 5 and by $X=2$ if the die comes up 6.
\par Find the expected value $\mu=E(X)$ and the variance
$\sigma^2=Var(X)$.
\par\bigskip (Hint: $\sigma^2=E((X-\mu)^2)=E(X^2)-\mu^2$ and
the expected value of $X^2$ is the sum of all $k^2Pr(X=k)$
for $k$ a possible value of $X$.)
\answer $Pr(X=1)={5\over 6}$ and $Pr(X=2)={1\over 6}$.
$$\mu=E(X)=1\times Pr(X=1)+2\times Pr(X=2)={5\over 6}+{2\over 6}=
{7\over 6}
$$
$$E(X^2)=1^2\times Pr(X=1)+2^2\times Pr(X=2)= {5\over 6}+{4\over 6}=
{10\over 6}$$
$$Var(X)=E(X^2)-\mu^2={10\over 6} - \left({7\over 6}\right)^2$$


% 4.3
\prob{10} In table below the first column is $a$ and the second column
is  Pr($0<Z<a$) (rounded) where $Z$ has the standard normal
distribution.
\par \begin{minipage}[t]{2in}
$$\begin{tabular}{||c|c||}
 \hline\hline
 $ a$  & Pr($0<Z<a$) \\ \hline
 \hline\hline
 0.0  & .00  \\ \hline
 0.1  & .04  \\ \hline
 0.2  & .08  \\ \hline
 0.3  & .12  \\ \hline
 0.4  & .16  \\ \hline
 0.5  & .19  \\ \hline
 0.6  & .23  \\ \hline
 0.7  & .26  \\ \hline
 0.8  & .29  \\ \hline
 0.9  & .32  \\ \hline
 1.0  & .34  \\ \hline
 1.1  & .36  \\ \hline
 1.2  & .38  \\ \hline
 1.3  & .40  \\ \hline
 1.4  & .42  \\ \hline
 1.5  & .43  \\ \hline
 1.6  & .45  \\ \hline
 1.7  & .46  \\ \hline
 1.8  & .46  \\ \hline
 1.9  & .47  \\ \hline
 2.0  & .48  \\ \hline
 2.1  & .48  \\ \hline
 2.2  & .49  \\ \hline
 2.3  & .49  \\ \hline
 2.4  & .49  \\ \hline
 2.5  & .49  \\ \hline
 2.6  & .50  \\ \hline
 2.7  & .50  \\ \hline
 2.8  & .50  \\ \hline
 2.9  & .50  \\ \hline
 3.0  & .50  \\ \hline
 \hline
\end{tabular} $$
\end{minipage}
\def\skip{\par\vspace{1.5in}}
\begin{minipage}[t]{1in}
\phantom{AAA}
\end{minipage}
\begin{minipage}[t]{3in}
\par\vspace{.25in}
Using this table find: \par\vspace{.25in}
(a) Pr($0<Z<2.3$) \skip
(b) Pr($1.2<Z$)   \skip
(c) Pr($-1<Z<1)$   \skip
(d) $X$ is normally distributed with mean $\mu=60$ and
standard deviation $\sigma=5$.  \par Find Pr($X<67.5$)
\end{minipage}
\answer (a) $.49$ (b) $.12$ (c) $.68$ (This is the only value I remember
by heart. The probability that a normal distribution is within one
standard deviation of its mean is 68\%.)
\par (d) If $X$ is a random variable with a normal distribution and mean
$\mu$ and standard deviation $\sigma$, then
${{X-\mu}\over \sigma}=Z$ is the standard normal distribution. (This
can be taken to be its definition.)  The inequality
$$X<67.5$$ is equivalent to
$$X-60 < 67.5-60 = 7.5$$
and then by dividing by $5$ we get
$${X-60\over 5} < {7.5\over 5}=1.5$$
It follows that
$$Pr(X<67.5)=Pr\left({X-60\over 5} < 1.5\right)= Pr(Z < 1.5)$$
the last can be read off from the chart as
$$Pr(Z < 1.5)=Pr(Z<0)+Pr(0<Z<1.5)=.5+.43=.93$$


\finishtbl
\printanswers

\end{document}


