\magnification=\magstep1
\overfullrule=0pt
\centerline{Mathematics 375 -- Probability and Statistics I}
\centerline{Solutions for Midterm Exam 2 -- November 19, 2009}
\bigskip
\noindent
I.  Birth weights of babies born in the US are normally distributed
with mean $\mu = 3315$ grams and standard deviation $\sigma = 575$ grams.
\medskip
\item{A)}  (5)  What is the probability that a baby will have
birth weight less than $2165$ grams?
\medskip
\item{} {\it Solution:}  Standardizing, we have $z = {2165 - 3315\over 575} = -2$.
From the standard normal table, $P(Z < -2) = .0228$.
\medskip
\item{B)}  (5)  What is the probability that a baby will have birth
weight between $2866.5$ grams and $3763.5$ grams?
\medskip
\item{} {\it Solution:}  Similarly, 
$$\eqalign{P\left({2866.5 - 3315\over 575} < Z < {3763.5 - 3315\over 575}\right) 
&= P(-.78 < Z < .78)\cr 
&= 1 - 2(.2177) = .5646.\cr}.$$
\item{C)}  (10)  If newborn babies are selected randomly, 
how many babies would you expect to have to weigh
to find the first one that weighs between $3735.5$ grams and $4258$ grams?
\medskip
\item{} {\it Solution:}  The probability that a single baby has a weight
in this range is 
$$\eqalign{P\left({3735.5 - 3315\over 575} < Z < {4258 - 3315\over 575}\right) 
&= P(.78 < Z < 1.64)\cr 
&= .2177 - .0505\cr 
&= .1672.\cr}$$
The number of babies weighed before we find the first in this range is
a geometric random variable with $p = .1672$.  So the expected value is
${1\over p} = {1\over .1672} \doteq 6$ babies.
\item{D)}  (5)  If we knew the mean and standard deviation, but we did not 
know the distribution of the birth weights, what could we say in general about
the probability in part A?  
\medskip
\item{} {\it Solution:}  By Tchebysheff's Theorem, we could say
$$P(Y < \mu - 2\sigma) \le P(|Y - \mu| < 2\sigma) \le {1\over 2^2} = {1\over 4}.$$
However, this includes cases $> \mu + 2\sigma$ as well as cases $< \mu - 2\sigma$.   
\bigskip
\noindent
II.  
\item{A)}  (10)  Fifteen out of a batch of 
twenty identical-looking packets of white crystals contain sugar and
five contain artificial sweetener.  
Four packets are randomly selected, found to contain
sugar, and discarded.  What is the probability that if three
packets are selected from those remaining, at least one contains
sugar?
\medskip
\item{}
{\it Solution:}  After the first four packets are tested and 
discarded, there are 16 remaining packets, of which 11 contain
sugar, and 5 contain the artificial sweetener.  The probability
that the three subsequently selected packets have at least one with
sugar is computed by the hypergeometric formula:
$${{11\choose 1}{5\choose 2}\over {16 \choose 3}} + 
{{11\choose 2}{5\choose 1}\over {16 \choose 3}} + 
{{11\choose 3}{5\choose 0}\over {16 \choose 3}}.
$$
This would also equal 
$$1 - {{11\choose 0}{5\choose 3}\over {16 \choose 3}}$$
(the complementary probability for the case where none of 
the 3 packets contain sugar).
\medskip
\item{B)}  (10)  The number of customers arriving at a 
coffee shop to place orders has a Poisson distribution with 
mean $20$ per hour.   Give a formula for computing the probability
that more than $40$ customers arrive in a given hour.  (It is not necessary
to obtain a decimal approximation for this number.) 
\medskip
\item{}
{\it Solution:}  From the formula for Poisson probabilities, if $Y$ 
is the number of customers arriving in the hour,
$$P(Y > 40) = \sum_{y=41}^\infty {20^y e^{-20}\over y!} = 
1 - \sum_{y=0}^{40} {20^y e^{-20}\over y!}.$$
Note that $y = 40$ is {\it not included} since the problem says
``more than 40'' (that is, strictly more).
\bigskip
\noindent
III. 
\item{A)} (5) Let 
$$g(x) = \cases{ {1\over 2} e^{x/2} & if $x < 0$\cr
                         0 & otherwise.\cr}$$
Show that $g$ is a legal pdf.  (This is a ``reflected exponential.'')
\medskip
\item{} {\it Solution:}  It is clear that $g(x) \ge 0$ for all real $x$.
We also have 
$$\eqalign{\int_{-\infty}^\infty g(x)\ dx &= \int_{-\infty}^0 {1\over 2}e^{x/2}\ dx\cr
&= \lim_{a\to -\infty} \left. e^{x/2} \right|_a^0\cr
&= \lim_{a\to -\infty} 1 - e^{a/2} = 1.\cr}$$
Hence $g(x)$ is a legal pdf.  
\medskip
\noindent
For the remainder of this problem let 
$$f(y) = \cases{{1\over 4} e^{y/2} & if $y < 0$\cr
                {1\over 18} y e^{-y/3} & if $y > 0$\cr}$$
\medskip
\item{B)} (10)  Show that $f(y)$ is a legal pdf for a random variable $Y$.
\medskip
\item{} {\it Solution:}  
As in part A, $f(y)$ is clearly nonnegative for
all $y \in {\bf R}$.  So we need to compute
$$\int_{-\infty}^\infty f(y)\ dy = \int_{-\infty}^0 f(y)\ dy + \int_0^\infty f(y)\ dy.$$
By the calculation in part A, we can also see
$$
\int_{-\infty}^0 f(y)\ dy = {1\over 2}\int_{-\infty}^0 {1\over 2}e^{y/2}\ dy = {1\over 2}.$$
Then 
$$\int_0^\infty f(y)\ dy = {1\over 2} \int_0^\infty {1\over 9} y e^{-y/3}\ dy.$$
After factoring out the ${1\over 2}$, what is left is the standard formula
for a $\Gamma(2,3)$-density, so this integral also evaluates to ${1\over 2}$.
Then the integral over all real $x$ is ${1\over 2} + {1\over 2} = 1$.
This shows $f(y)$ is a valid pdf.   
\medskip
\item{C)} (10)  Show that $E(Y) = 2$.  (Don't work harder than necessary!)
\medskip
\item{} {\it Solution:}  From what we did in part B, we can see that 
$Y$ is a sort of combination of a reflected exponential random variable for $y < 0$
with a $\Gamma(2,3)$-distributed random variable for $y > 0$.  To compute 
the expected value we would compute:
$$E(Y) = \int_{-\infty}^\infty y f(y)\ dy = {1\over 2}\int_{-\infty}^0 y\cdot {1\over 2}e^{y/2}\ dy +
{1\over 2}\int_0^\infty y \cdot {1\over 9} y e^{-y/3}\ dy.$$
This gives ${1\over 2}$ times the expected value for the reflected exponential, 
plus ${1\over 2}$ times the expected value for a $\Gamma(2,3)$-distributed random
variable, or
$${1\over 2}\cdot (-2) + {1\over 2}{(2)(3)} = -1 + 3 = 2.$$
\item{D)} (10)  Determine the moment-generating function of $Y$.  On
which interval of $t$ values is your formula valid?
\medskip
\item{} {\it Solution:}  Following the derivation of the moment-generating functions
for exponential- and gamma-distributed random variables, what we have here is 
a sort of average of the moment-generating functions of the reflected exponential
and the gamma:
$$\eqalign{m_Y(t) &= \int_{-\infty}^\infty e^{ty} f(y)\ dy\cr
&= {1\over 2}\int_{-\infty}^0 e^{ty}\cdot {1\over 2} e^{y/2}\ dy + 
{1\over 2}\int_0^{\infty} e^{ty}\cdot {1\over 9} y e^{-y/3}\ dy\cr
&= {1\over 2}\cdot {1\over 1 + 2t} + {1\over 2}\cdot {1\over (1 - 3t)^2}.\cr}$$
The first integral is only finite if $t > {-1\over 2}$, while the second
is only finite if $t < {1\over 3}$.  So the moment-generating function
is defined on the interval $\left({-1\over 2},{1\over 3}\right)$.  
\bigskip
\noindent
IV.  Let $Y_1,Y_2$ be jointly continuous random variables with joint density
$$f(y_1,y_2) = \cases{c y_2 & if $0 \le y_1 \le 1$ and $y_1^2 \le y_2 \le 1$\cr
                   0 & otherwise\cr}$$
\item{A)}  (10)  What is the value of $c$?
\medskip
\item{} {\it Solution:}  We find $c$ from the condition that the total 
integral of $f(y_1,y_2)$ is $1$.  The region of integration
is bounded below by the parabola $y_2 = y_1^2$ and above by the line $y_2 = 1$:
$$\eqalign{
1 &= c\int_0^1 \int_{y_1^2}^1 y_2 \ dy_2\ dy_1\cr
&= c\int_0^1 \left. {y_2^2\over 2}\right|_{y_1^2}^1\ dy_1\cr
&= c\int_0^1 {1\over 2} - {y_1^4\over 2} \ dy_2\cr
&= c\left({1\over 2} - {1\over 10}\right)\cr
&= {2c\over 5}.\cr}$$
Hence $c = {5\over 2}$.   
\item{B)}  (10)  What is $P( Y_1 \le Y_2 )$? 
This probability is computed by the double
$$\int_0^1 \int_{y_1}^1 {5y_2\over 2} \ dy_2\ dy_1 = {5\over 6}.$$
\bigskip
\noindent
{\it Extra Credit.} (10)  Given two real numbers $a, b$ with $a < 0 < b$,
it is possible to find a random variable $U$ whose moment-generating function is
$$m_U(t) = {1\over (1 - at) (1 - bt)}$$
for some interval of $t$ in ${\bf R}$?
If so, give a formula for the pdf for such a random variable.  If not, say
why not.  (Hint:  Think about what happened in problem III above.)
\bigskip
\noindent
{\it Solution:}  
Since $a < 0$ and $b > 0$ then we can concoct a pdf that works by splicing
together a reflected exponential for $y < 0$ with an ordinary exponential and
$y > 0$ and taking a weighted average to ensure that the constants work out
correctly when we add the two separate moment-generating functions. By partial
fractions,
$${1\over (1-at)(1-bt)} = {(-a)\over b-a}\cdot {1 \over 1 - at} + 
{b\over b - a}\cdot{1 \over 1 - bt}$$
Note that since $a < 0$ and $b > 0 > a$, the coefficients here are both positive.
Our pdf will look like 
$$
f(y) = \cases{ {1 \over b - a}\cdot e^{y/(-a)} & if $y < 0$\cr
               {1 \over b - a} \cdot e^{-y/b} & if $y > 0$\cr}$$
\bye
