\magnification=\magstep1
\def\sol{\bigskip\item{}{\it Solution: \/}}
\centerline{Mathematics 375 -- Probability and Statistics 1}
\centerline{Solutions for Final Examination -- December 17, 2005}
\bigskip
\noindent
{\it Directions:}  
Do problems I - X in the blue exam booklet.  There are 200 possible 
regular points and 20 Extra Credit points.  Notes:
\item{1)}  If an answer can be expressed in terms of factorials, 
binomial coefficients, the gamma function, etc., it is 
{\it preferable} to leave it in that form.
\item{2)}  Even if you 
don't see how to derive a complete solution to a problem, don't leave
it blank.  Partial credit will be given for relevant definitions, 
ideas that could lead to solutions, and so forth.  
\bigskip
\noindent
I. 20 students in a statistics class were asked to report the 
number of pets in their families, giving the following data:
$$\matrix{
3, & 3, & 2, & 4, & 1, & 0, & 1, & 2, & 3, & 5,\cr
1, & 2, & 2, & 1, & 1, & 0, & 2, & 4, & 3, & 1\cr}$$
\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 data points are within one sample standard
deviation of the sample mean?  

\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} - s,\overline{x} + s]$ is approximately
$[.69,3.41]$.  15 out of the 20 data points are in this range.

\bigskip
\noindent
II.  Suppose that you have a key ring with $N$ keys, exactly
one of which is your house key.  You get home after dark 
and can't see the keys or the ring.  So you try the keys 
in your front door lock one by one until you find the right one. 
\item{A)} (5) Assuming that you 
are not careful and you mix up the keys before each try,
what is the probability that you first
find the correct key on the $y$th try ($y = 1,2,\ldots$)?
\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 find the key first on the $y$th trial is 
$((N-1)/N)^{y-1} (1/N)$.  
\bigskip
\item{B)} (5)  Let $Y_A$ be the discrete random variable
giving the number of the trial on which
you find the correct key by the method from part A.  
What is the expected value of $Y_A$? 
\sol
From the formula for geometric random variables,
$E(Y_A) = 1/p = N$.  
\bigskip
\item{C)} (5) Same question as part A, but now you put aside
each key as you try it so it does not get mixed back in with
the ones you have not tried.  
\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, and an
$(N-2)/(N-1)$ probability of not finding the correct one.
Similarly for the later trials.  The probability of 
finding the correct key on the $y$th trial is 
$${N-1\over N}\cdot {N-2\over N-1}\cdot {N-3\over N-2} \cdots {N - y + 1 \over N - y + 2} \cdot {1\over N-y+1} = {1\over N}$$
(the same for all trials $y = 1, \ldots, N$), and zero for $y > N$.

\bigskip
\item{D)} (5) Let $Y_C$ be the discrete random variable
giving the number of the trial on which
you first find the correct key by the method from part C.  
What is the expected value of $Y_C$?
Which method is superior?  

\sol 
$$E(Y_C) = 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. A tea distributor randomly places a miniature porcelain 
figurine of one of 10 different endangered animals in each of its  
boxes of tea.  
\item{A)} (15) What is the probability of getting a
complete set of all 10 animals if you purchase exactly 
10 boxes of the tea?  Explain how you are deriving your answer.

\sol Think of buying the boxes one by one and placing the animals
you get in an ordered row.  There are $10^{10}$ different (ordered) 
collections of 10 animals (including possible duplicates).  
Of those collections, $10 \cdot 9 \cdot 8 \cdots 2\cdot 1 = 10!$
consist of 10 distinct animals.  So the probability of getting
a complete set when you buy just 10 boxes is 
$${10!\over 10^{10}}$$
(This is $\doteq .000363$ -- not very likely!)
\bigskip
\item{B)} {\it Extra Credit} (10)  What is the expected number
of boxes of tea you need to purchase to obtain a complete
set of all 10 animals?  (Hint:  You get one in the first
box you buy.  What is the expected number of boxes until you 
get a second, different animal?  After you have two, what is the
expected number of boxes to get the third?  etc.)

\sol  After you get the first animal, since the animals are random,
you have a 
$9/10$ chance of getting something different from the first with
each box from that point on.  The number of the box on which you first
get something different from the first is {\it geometric}
with $p = 9/10$, so the expected number of boxes until you 
get something different is $1/p = 10/9$.  Once you 
do get a different second animal, you're in the same situation,
but now there is a probability of $p = 8/10$ that you get
something different from the first two distinct ones.  You 
expect a further $10/8$ tries to get a third distinct animal.
Keep going the same way.  The expected number of boxes
for a complete set is:
$$1 + 10/9 + 10/8 + \cdots + 10/2 + 10/1 = 
10\left({1\over 10} + {1\over 9} + {1\over 8} + \cdots + {1\over 2} + {1\over 1}\right) \doteq 29.29$$
(smaller than you might expect!)
\bigskip
\noindent
IV.  
\item{A)} (5) State Bayes' Rule.
\sol
Bayes' Rule states that if a sample space $S$ is partitioned into
subsets $S_1,\ldots,S_k$ and $E\subset S$ is an event, then
$$P(S_j|E) = {P(E | S_j)P(S_j)\over \sum_{i=1}^k P(E|S_i)P(S_i)}$$


\item{B)} (15) According to the American Lung Association, $7\%$ of the 
population has lung disease.  Of those people having
lung disease, $90\%$ are smokers.  Of those not having 
lung disease, $74.7\%$ are nonsmokers.  What is the 
probability that a smoker has lung disease?

\sol In the sample space $S$ consisting of the whole population, 
we have the partition $S = L \cup \overline{L}$, where
$L$ are the people with lung disease.  We also have $A \subset S$, the 
set of smokers.  The given information is
$P(L) = .07$ and $P(A|L) = .9$, $P(\overline{A}|\overline{L}) = .747$.
We want $P(L|A)$.  Because of the ``switch'' we see that
Bayes' Rule will apply to this situation.  Applying the complement rule, 
$$P(L|A) = {P(A|L)P(L) \over P(A|L)P(L) + P(A|\overline{L})P(\overline{L})}
= {(.9)(.07)\over (.9)(.07) + (.253)(.93) } \doteq .211$$ 
\bigskip
\noindent
V.  The number of customers arriving at a furniture 
store in a one-hour period has a Poisson distribution 
with mean $5$.  
\item{A)}  (10) What is the probability that more than 7 customers
arrive in one hour?
\sol
From the Poisson table for $\lambda = 5$, 
$P(Y > 7) = 1 - P(Y \le 7) = 1 - .867 = .133$.
\bigskip
\item{B)}  (10) What is the probability that more than
7 customers arrive in exactly 4 out of the 8 hours 
that the store is open in one day?  (Assume the numbers in
each hour are independent.)  

\sol Since the hours are independent, the number $Y$ of hours
where more than 7 customers arrive is a binomial random 
variable with $n = 8$, $p = .133$, $q = .867$:
$$P(Y = 4) = {8\choose 4} (.133)^4 (.867)^4 \doteq .0124$$

\bigskip
\noindent
VI.  The pdf for a continuous random variable $Y$ has 
the form 
$$f(y) = \cases{k(9 - y^2) & if $-3 \le y \le 3$\cr
                   0 & otherwise\cr}$$
\item{A)} (10) Determine the value of $k$.
\sol
The value of $k$ is determined by the equation 
$$1 = k \int_{-3}^3 9 - y^2\ dy = k \left(9y - y^3/3\right|_3^3 = 36k$$
So $k = 1/36$.  
\bigskip
\item{B)} (15) What are the expected value and variance of $Y$?
$$E(Y) = \int_{-3}^3 y\cdot (9 - y^2)/36\ dy = 0$$ 
(Note no computation needed here -- integral of an odd function over
a symmetric interval!)  Then
$$V(Y) = \int_{-3}^3 y^2\cdot (9 - y^2)/36\ dy - 0^2 ={9\over 5}$$

\bigskip
\noindent
VII.  Professional golfers' tee shot distances are normally 
distributed with $\mu = 282.2$ yards and $\sigma = 8.12$ yards.  
\item{A)} (10) What
is the probability that a tee shot goes more than 300 yards?  
\sol  
Standardize and use the standard normal table:
$$P(Y > 300) = P\left({Y - 282.2\over 8.12} > {300 - 282.2\over 8.12}\right)
= P(Z > 2.19) = .0143.$$

\item{B)} (10) What
is the probability that a tee shot goes between 270 and 290 yards?  
\sol
Same idea:
$$\eqalign{
P(270 < Y < 290) &\doteq P(-1.50 < Z < .96) \cr
&= 1 - P(Z < -1.50) - P(Z > .96) = 1 - .0668 - .1685 = .7647\cr}$$

\bigskip
\noindent
VIII. (15) Two phone calls are made independently in a fixed 1-hour
period.  Each call occurs at a random time uniformly distributed
on the interval $[0,1]$.  
 Find the joint density function for the times $Y_1, Y_2$
of the two calls and use it to find the probability that the 
two calls are made within 5 minutes of each other 
(i.e. $|Y_1 - Y_2| \le 5/60$).
\sol
Because the times are independent, the joint density is 
the product of the uniform densities for $Y_1$ and $Y_2$:
$$f(y_1,y_2) = \cases{1 & if $0 \le y_1, y_2 \le 1$\cr
                      0 & otherwise\cr}$$
Note this is nonzero exactly on the unit square in the 
$(y_1,y_2)$ plane.  The region $R$ corresponding to the 
condition $|y_1 - y_2| \le 1/12$  is a diagonal strip
down the middle of the square bounded by the lines
$y_2 = y_1 + 1/12$ and $y_2 = y_1 - 12$.  Then
$$P(|Y_1 - Y_2| \le 1/12) = \int\int_R  f(y_1,y_2)\ dA$$
is the area of $R$.  We can find this by subtracting the
areas of the two triangles outside the strip:
$${\rm area}(R) = 1 - 2\cdot {1\over 2}\cdot {11\over 12}\cdot {11\over 12} = {23\over 144}$$
\bigskip
\noindent
IX.  Two random variables $Y_1,Y_2$ have joint density 
$$f(y_1,y_2) = \cases{2 e^{-y_1-y_2} & if $0 \le y_1 \le y_2 < \infty$\cr
                           0 & otherwise\cr}$$
\item{A)} (10) Find $P(Y_2 \le 2 + Y_1)$.  (Draw a picture!)
\sol
The region where the joint density is nonzero is the region in the
first quadrant above the line $y_2 = y_1$.  So to compute
$P(Y_2 \le 2 + Y_1)$, note the line $y_2 = y_1 + 2$ is parallel
to the boundary line and 
$$\eqalign{
P(Y_2 \le 2 + Y_1) &= \int_0^\infty \int_{y_1}^{y_1+2} 2e^{-y_1-y_2}\ dy_2 dy_1\cr
&= \int_0^\infty -2 e^{-2y_1 - 2} + 2 e^{-2y_1}\ dy_1\cr
&= 1 - e^{-2}\cr}$$
\bigskip
\item{B)} (10) Find the marginal density $f_1(y_1)$. 
What is the distribution of $Y_1$?  
\sol
$$f_1(y_1) = \int_{y_1}^\infty 2 e^{-y_1 - y_2}\ dy_2 = 2 e^{-2y_1}$$
(if $y_1 > 0$; 0 otherwise).  This is the density for
an exponential random variable with $\beta = 1/2$.  
\bigskip
\item{C)} (10) Let $U = 3Y_1 + 2Y_2$.  Find the mean $\mu_U$.
\sol
By linearity, $E(U) = 3E(Y_1) + 2E(Y_2)$.  Using part B, $E(Y_1) = {1\over 2}$.
Now setting up the double integral with $dy_2$ outside: 
$$\eqalign{
E(Y_2) &= \int_0^\infty \int_0^{y_2} y_2\cdot 2e^{-y_1-y_2}\ dy_1 dy_2\cr
&= \int_0^\infty -2y_2 e^{-2y_2} +2 y_2 e^{-y_2}\ dy_2\cr
&= -{2\over 4}\Gamma(2) + 2\Gamma(2) = 
{3\over 2}\cr}$$
So $E(U) = 3\cdot {1\over 2} + 2\cdot {3/2} = {9\over 2}$.
\bigskip
\item{D)} {\it Extra Credit} (10) Find the variance $\sigma_U^2$ for $U$ from part C.\bigskip
\item{} {\it Answer:}  $V(U) = {41\over 4}$.  The easiest
way to do this is {\it not to compute the covariance matrix}.  Instead,
since you already have the mean from part C, just compute 
$E(U^2) - (9/2)^2$.
\bigskip
\noindent
X.  
\item{A)} (10) Let $Y$ have a gamma distribution
with $\alpha=3.2$, and $\beta=1$.  Derive a general formula
for $E(Y^k)$, where $k \ge 1$ is an integer.   (See note 1 in the directions!)
\sol
$$E(Y^k) = \int_0^\infty y^k \cdot {y^{2.2} e^{-y}\over \Gamma(3.2)}\ dy
= {\Gamma(3.2 + k) \over \Gamma(3.2)}$$
\bigskip
\item{B)} (10) Let $Y_1,\ldots,Y_n$ be independent,
all with gamma distributions with the same $\alpha$, and $\beta$.
Using moment-generating functions, 
determine the distribution of the mean 
$\overline{Y} = {1\over n}\sum_{i=1}^n Y_i$.  
\sol
By independence,
$$m_{\overline{Y}}(t) = \prod_{i=1}^n m_{Y_i}(t/n) = 
\left({1\over (1 - (\beta/n) t)^\alpha} \right)^n = {1\over (1 - (\beta/n) t)^{n\alpha}}$$
By the Uniqueness Theorem, $\overline{Y}$ also has a gamma distribution
with parameters $n\alpha, \beta/n$.  

\bye

