\magnification=\magstep1
\def\sol{\bigskip\item{}{\it Solution: \/}}
\centerline{Mathematics 375 -- Probability and Statistics I}
\centerline{Final Examination Solutions -- December 14, 2009}
\bigskip
\noindent
{\it Directions}
\bigskip
Do all work in the blue exam booklet.  There are 200 possible regular points and
10 possible Extra Credit points.  If an answer can be expressed in terms of
binomial or multinomial coefficents, factorials, the gamma function, etc. please leave it in that
form rather than evaluating.  Even if you cannot see how to completely solve a problem,
do not leave it blank.  Partial credit will be given for relevant definitions, ideas
that could lead to solutions, and so forth.
\bigskip
\noindent
I.  Twenty students in a probability and statistics class were asked to report
the number of pets in their families, giving the following data:
$$3,3,2,4,1,0,1,2,3,5,1,2,2,1,1,0,2,4,3,1$$
\item{A)} (10)  Construct a relative frequency histogram for this
data using one ``bin'' for each integer value.
\sol
There are two 0's, six 1's, five 2's, four 3's, two 4's, and one 5 in the data.
So the relative frequency histogram will show a rectangle of height
2/20 = 1/10 for the value 0, a rectangles of height 6/20 = 3/10
for the value 1, 5/20 = 1/4 for the value 2, 4/20 = 1/5 for the value 
3, 2/20 = 1/10 for the value 4, and 1/20 for the value 5.
\bigskip
\item{B)} (10) How many of the data values are within two sample standard
deviations of the sample mean?  How does this compare with the ``empirical rule?''
\sol
 The sample mean is $\overline{x} = (\sum_{i=1}^{20} x_i)/20 = 2.05$.
The sample standard deviation is 
$$s = \sqrt{{1\over 19} \sum_{i=1}^{20} (x_i - \overline{x})^2} \doteq 1.36$$
So the interval $[\overline{x} - 2s,\overline{x} + 2s]$ is approximately
$[-.67,4.77]$.  19 out of the 20 data points are in this range.  This 
is exactly $95\%$ of the data points, so there is close agreement with the 
``empirical rule.''
\bigskip
\noindent
II.  Suppose you have a key ring with $N$ keys, exactly one of which is 
your car key.  You are parked in a country lane on a moonless night and can't see the keys or
the ring.  So you try the keys in your car door lock one by one until you
find the right one.
\medskip
\item{A)}  (10) Assuming you are not careful and you mix up all the keys after 
each try, what is the probability that you take at least $y$ tries to 
find the right key?
\sol
Since you mix the keys back up each time, you have a probability
of finding the correct key of $1/N$ on each try, and 
the tries are independent.  The number of the 
try on which you first find the key is a {\it geometric}
random variable with $p = 1/N$ and $q = (N-1)/N$.  The probability that
you take at least $y$ tries to find the right key is the sum of 
the geometric series:
$$\sum_{n=y}^\infty p q^{n-1} = {p q^{y-1}\over 1 - q} = q^{y-1} = ((N-1)/N)^{y-1}.$$ 
\item{B)} (5)  Let $Y$ be the discrete random variable giving the number of the 
trial on which you find the right key.  What is the expected value of $Y$?
\sol
From the formula for geometric random variables,
$E(Y) = 1/p = N$. 
\medskip 
\item{C)} (10)  Now suppose you are more careful and you take each wrong key 
off the key ring and put it aside
after you try it so that it does not get mixed back in with the keys you 
have not tried.  Let $Z$ be the discrete random variable giving the number of the
trial on which you find the right key by this method.  What is the expected value of $Z$?
\sol 
Now, you have a probability of $1/N$ of finding the 
correct key on the first trial and a probability of $(N-1)/N$
of not finding the correct one.  If you don't find the
correct one, then the first choice is removed from 
the ``pool'' and you have a $1/(N-1)$ chance of 
finding the correct key on the second try (given that you didn't find it on the first), and an
$(N-2)/(N-1)$ probability of not finding the correct one.
Similarly for the later trials.  The unconditional probability of 
finding the correct key on the $z$th trial is 
$${N-1\over N}\cdot {N-2\over N-1}\cdot {N-3\over N-2} \cdots {N - z + 1 \over N - z + 2} \cdot {1\over N-z+1} = {1\over N}$$
(the same for all trials $z = 1, \ldots, N$), and zero for $z > N$.
$$E(Z) = 1\cdot {1\over N} + 2\cdot {1\over N} + \cdots + N\cdot {1\over N}
= {N(N+1)\over 2}\cdot {1\over N} = {N+1\over 2}$$
As should be intuitively clear, this method is superior to the 
one from part A.  You'll find the correct key faster on average
this way!
\bigskip
\noindent
III. (Hypothetical)  In the city of Worcester, 50 percent of 
registered voters are Democrats, 30 percent are Republicans,
and 20 percent are Independents.  
 In the recent Senate primary, 15 percent of Democrats voted,
 10 percent of Republicans voted, and 35 percent of Independents
 voted.
\medskip
\item{A)} (10)  If a single voter is selected at random, what
is the probability that he or she voted in the Senate primary?
\sol
Let $V$ be the event that the voter voted in the primary, and 
$D$, $R$, $I$ be the three party affiliations.
By the Law of Total Probability, 
$$\eqalign{
P(V) &= P(V|D)P(D) + P(V|R)P(R) + P(V|I)P(I)\cr
 &= (.15)(.5) + (.10)(.30) + (.35)(.20)\cr 
 &= .175.\cr}$$
\item{B)} (10)  Given that a registered voter did vote, what is
the probability that the voter was an Independent? 
\sol
We want $P(I|V)$, so we apply Bayes' Rule:
$$P(I|V) = {P(V|I)P(I)\over P(V|D)P(D) + P(V|R)P(R) + P(V|I)P(I)} = {(.35)(.20)\over .175} = .4.$$
\bigskip
\noindent
IV. Let $X$ be a random variable for which $E(X) = \mu$ and 
$V(X) = \sigma^2$.  Let $c$ be an arbitrary constant.
\item{A)}  (10)  Show that $E((X - c)^2) = (\mu - c)^2 + \sigma^2$.
\sol 
By the linearity of the expected value,
$$E((X - c)^2 = E(X^2 - 2cX + c^2) = E(X^2) - 2c E(X) + c^2 = E(X^2) - 2 c\mu + c^2.\leqno(1)$$
Now by one of our standard results $V(X) = \sigma^2 = E(X^2) - \mu^2$.  So $E(X^2) = \sigma^2+ \mu^2$.
Therefore, substituting into (1), we have
$$E((X - c)^2) = \sigma^2 + \mu^2 - 2c\mu + c^2 = \sigma^2 + (\mu - c)^2,$$
which is what we wanted to show.
\medskip
\item{B)}  (5)  For which $c$ is $E((X - c)^2)$ a minimum?
\sol
Note that $(\mu - c)^2 \ge 0$ for all $c$ and $= 0$ only if $c = \mu$.  Therefore,
$E((X - c)^2)$ is minimized when $c = \mu$.    
\bigskip
\noindent
V.  The number of customers arriving at a fast food restaurant
in a typical hour has a Poisson distribution with mean $20$. 
\item{A)}  (5) What is the probability that 17 customers
arrive in a given hour?
\sol
Let $Y$ be the number of customers.  From the Poisson pmf formula:
$$P(Y = 17) = {20^{17} e^{-20}\over 17!} \doteq .076.$$
\item{B)}  (10)  If the store is open 12 hours a day, 
what is the probability that exactly 17 customers
will arrive in exactly 4 out of the 12 hours?
\sol
Assuming the numbers of customers in each hour are independent
of each other, then the number $N$ of hours in which 17 customers
arrive has a binomial distribution with $n = 12$ and $p = .076$
from part A.  Hence
$$P(N = 4) = {12\choose 4} (.076)^4(.924)^{8} \doteq .0088.$$
\bigskip
\noindent
VI.  A continuous random variable $Y$ has p.d.f 
$$f(y) = \cases{ c(y^2 + y) & if $1 \le y \le 2$\cr
                     0 & otherwise\cr}$$
\item{A)} (5)  What is the value of $c$?
\sol
In order for $f(y)$ to be a legal p.d.f., we must have 
$$1 = \int_1^2 c(y^2 + y)\ dy = c \left(\left.{y^3\over 3} + {y^2\over 2}\right|_1^2\right) 
= {23c\over 6}.$$   
So $c = {6\over 23}$. 
\medskip
\item{B)} (5)  What is $P(1 \le y \le 3/2)$?
\sol
This probability is given by the integral
$$\eqalign{
P(1 \le y \le 3/2) &= \int_1^{3/2} {6\over 23}(y^2 + y)\ dy\cr
&= {6\over 23}\left(\left.{y^3\over 3} + {y^2\over 2}\right|_1^{3/2}\right)\cr
&={17\over 46} \doteq .3696.\cr}$$
\item{C)} (10) Find $E(Y)$ and $V(Y)$.
\sol
Proceeding as usual, 
$$E(Y) = \int_1^2 y\cdot{6\over 23}(y^2 + y)\ dy = {73\over 46}.$$
Then 
$$E(Y^2) = \int_1^2 y^2\cdot{6\over 23}(y^2 + y)\ dy = {597\over 230}.$$
So 
$$V(Y) = {597\over 230} - \left({73\over 46}\right)^2 = {817\over 10580}.$$
\bigskip
\noindent
VII. (15) The diameters of the bolts in a large box follow
a normal distribution with mean $2$ cm and a standard
deviation of $0.03$ cm.  The diameters of the holes
in the nuts in another large box are also normally
distributed, but with mean $2.02$ cm and standard deviation
$0.04$ cm.  A bolt and a nut will fit together if the
hole in the nut is larger than the diameter of the
bolt, but the difference is no larger than $.05$ cm.
If a nut and a bolt are selected independently and 
randomly from the two boxes, what is the probability 
that they will fit together? 
\sol
Let $Y_1$ be the diameter of the bolt and $Y_2$ be
the diameter of the hole in the nut.  We want to know the probability
$$P(Y_1 \le Y_2 \le Y_1 + .05) = P(0 \le Y_2 - Y_1 \le .05).$$
Now by our standard results, $U = Y_2 - Y_1$ has a normal distribution 
with mean $2.02 - 2 = .02$ and standard deviation 
$\sqrt{(.03)^2 + (.04)^2} = .05$.  Hence we standardize and use the 
normal table:
$$\eqalign{
P(0 \le U \le .05) &= P\left({0 - .02\over .05} \le Z \le {.05 - .02\over .05}\right)\cr
&= P(-.4 \le Z \le .6) = 1 - .3446 - .2743 = .3811.\cr}$$   
\bigskip
\noindent
VIII.  Let $X$ and $Y$ be independent random variables with 
moment-generating functions 
$$m_X(t) = m_Y(t) = e^{t^2 + 3t}$$
\item{A)} (10) What is the moment generating function of $Z = 3X + 2Y - 4$?
\sol
The moment generating function of $Z$ is 
$$m_Z(t) = m_X(3t)m_Y(2t)e^{-4t} = e^{9t^2 + 9t}\cdot e^{4t^2+6t}\cdot e^{-4t}
= e^{13 t^2 + 11t}.$$
\item{B)} (10) What is the distribution of $Z$?
\sol
By the Uniqueness Theorem, this is the moment-generating function of 
a normally-distributed random variable with mean $\mu = 11$ and variance
$\sigma^2 = 26$.  
\bigskip
\noindent
IX.  Twenty students in a probability and statistics class take
a final examination independently of one another.  The number
of minutes each student requires to complete the 
exam is a random variable with an exponential distribution with mean $120$ minutes. 
The students all start work at 8:30am. 
\item{A)} (10) What is the probability that at least one student
out of the 20 will complete the exam by 10:00 am?
\sol
Let $Y$ be the time that one student takes to finish.
The probability we want is the complementary probability to the 
probability of the event that all the students take $90$ minutes or
more.  Since
$$P(Y \ge 90) = \int_{90}^\infty e^{-y/120}/120\ dy = e^{-90/120} = e^{-3/4} \doteq .4724,$$
the desired probability is 
$$1 - \left(e^{-3/4}\right)^{20}.$$
(This is very close to 1.)  An alternate method is to compute $P(Y \le 90) = .5276$, and 
then use the binomial probability:
$$\sum_{y=1}^{20} {20\choose y} (.5276)^y (.4724)^{20-y}.$$
\item{B)} (10) What is the distribution of the total time
taken by all of the students to complete the exam?
\sol
Using moment-generating functions, by the independence,
if $T = Y_1 + \cdots + Y_{20}$ is the total time, 
$$m_T(t) = \left({1\over (1 - 120 t)}\right)^{20} = {1\over (1 - 120 t)^{20}}.$$
By the Uniqueness Theorem, we see that $T$ has a gamma
distribution with $\alpha = 20$ and $\beta = 120$.  
\bigskip
\noindent
X.  Suppose $Y_1, Y_2$ have joint density
$$f(y_1,y_2) = \cases{24 y_1y_2 & if $y_1 \ge 0$, $y_1 + y_2 \le 1$ \cr
                           0 & otherwise\cr}$$
\item{A)}  (10)  Are $Y_1,Y_2$ independent?  
\sol 
We need the marginal densities to determine this.  
Computing,
$$f_1(y_1) = \int_0^{1 - y_1} 24 y_1y_2\ dy_2 = 12 y_1(1 - y_1)^2$$
if $0 \le y_1 \le 1$ and zero otherwise.  For future reference,
note that this says $Y_1$ has a beta distribution with $\alpha = 2$ 
and $\beta = 3$.  By symmetry, 
$$f_2(y_2) = \int_0^{1 - y_2} 24 y_1y_2\ dy_1 = 12 y_2(1 - y_2)^2$$
if $0 \le y_2 \le 1$ and zero otherwise.  So $Y_1$ and $Y_2$
are actually identically distributed(!)
Since $f_1(y_1)f_2(y_2) \ne f(y_1,y_2)$, $Y_1$ and $Y_2$ are
{\it not independent}.
\medskip
\item{B)}  (10)  What is $V(8Y_1 - 2Y_2)$?
\sol
There are many ways to do this, some harder and some easier.  Perhaps
the most ``painless'' way is to use the observation made above
in part A that $Y_1$ and $Y_2$ both have beta distributions.  This
means that we can immediately write down:
$$E(Y_1) = E(Y_2) = {\alpha \over \alpha + \beta} = {2\over 5}$$
and 
$$V(Y_1) = V(Y_2) = {\alpha\beta\over (\alpha + \beta)^2(\alpha+ \beta + 1)} = 
{1\over 25}.$$
The only integral we need to compute is 
$$E(Y_1Y_2) = \int_0^1\int_0^{1-y_1} 24 y_1^2y_2^2\ dy_2\ dy_1 = {2\over 15}.$$
Then 
$${\rm Cov}(Y_1,Y_2) = {2\over 15} - \left({2\over 5}\right)^2 = -{2\over 75}.$$
Finally,
$$\eqalign{V(8Y1 - 2Y_2) &= 64V(Y_1) + 4V(Y_2) - 32{\rm Cov}(Y_1,Y_2)\cr 
&= {64\over 25}+{4\over 25}+{64\over 75}\cr
&= {268\over 75} \doteq 3.5733.\cr}$$
\item{C)}  (10)  Use the method of distribution functions to find
the density function for $U = Y_1 + Y_2$.
\sol
We have 
$$\eqalign{F_U(u) &= P(U \le u) \cr
&= P(Y_1 + Y_2 \le u) \cr
&=\int_0^u \int_0^{u-y_1} 24 y_1y_2\ dy_2\ dy_1\cr
&=u^4 \cr}$$
if $0 \le u \le 1$, 1 if $u \ge 1$, and zero otherwise.
Then $f_U(u) = 4u^3$ if $0 \le u \le 1$ and zero otherwise.
(That is, $U$ has a beta distribution with $\alpha = 4$ and $\beta = 1$.)
\bigskip
\noindent
{\it Extra Credit}  (10) One form of the Law of Large Numbers states that 
if $X_1,\ldots,X_n$ are independent and identically distributed random
variables for which $E(X_i) = \mu$ and $V(X_i)=\sigma^2$ exist, then for any
$\epsilon > 0$,
$$\lim_{n\to\infty} P(|\overline{X} - \mu| < \epsilon) = 1.$$
Prove this statement without assuming anything else about the
distribution of the $X_i$.   
\sol
The random variable $\overline{X} = {1\over n}(X_1 + \cdots + X_n)$ 
has mean $\mu$ and variance $\sigma^2 = {1\over n^2} V(X_1) + \cdots + {1\over n^2}V(X_n) = {\sigma^2\over n}$. 
For a given $\epsilon$, we apply Tchebysheff's Theorem with $k = {\epsilon n\over \sigma^2}$:
$$\eqalign{P(|\overline{X} - \mu| < \epsilon) &=
P(|\overline{X} - \mu| < k {\sigma^2 \over n}) \cr
&\ge 1 - {\sigma^4\over \epsilon^2 n^2}.\cr}$$
As $n\to \infty$ the last line here approaches $1$, which implies what we wanted to show.  
\bye
