\magnification=\magstep1
\def\Sol{\bigskip\noindent {\it Solution:}\ }
\centerline{Mathematics 375 -- Probability and Statistics I}
\centerline{Midterm Exam 1 -- Solutions}
\bigskip
\noindent
I.  To test the effectiveness of a seal designed to keep an electrical
plug airtight, a needle was inserted into the plug and air pressure
was increased until leakage was observed.  The pressures (in lb per square
inch) where leakage first occurred on 10 trials were:
$$3.1, 3.5, 3.3, 4.5, 4.2, 2.8, 3.9, 3.5, 3.3, 4.0$$
\item{A)} (10) Construct a relative frequency histogram for this
data on the interval $[3,5]$, subdividing into 5 equal ``bins''.

\Sol
With $5$ equal ``bins'' $\Delta x = (5-3)/5 = .4$.
If a measurement falls on a bin boundary, we can consistently 
place it in the lower
bin.  Then there are 3 measurements in $[3,3.4]$, 2 in $(3.4,3.8]$,
3 in $(3.8,4.2]$, 1 in $(4.2,4.6]$ and none greater than $4.6$.
The relative frequency histogram has one box of height
$3/10$ over the first interval, one of height $2/10$ over the second,
one of height $3/10$ over the third, one of height $1/10$ over the 
fourth, and one of height 0 over the last.  There is one datapoint
out of this range.  
\bigskip
\item{B)} (5)  What is the sample mean?
\Sol
$$\overline{x} = {1\over 10}(3.1+ 3.5 + 3.3 + 4.5 + 4.2 + 2.8 + 3.9 + 3.5 + 3.3 +  4.0) = 3.61$$
\bigskip
\item{C)} (10)  How many of the data points are within 2 standard
deviations of the mean?
\Sol
First we need to compute 
$$s = \sqrt{{1\over 9}\sum_{i=1}^{10} (x_i - \overline{x})^2} = \sqrt{.279} = .528$$
``Within 2 standard deviations of the mean'' means in the interval
$[\overline{x}-2s, \overline{x} + 2s] = [2.554,4.666]$.  All 10 of the 
measurements are in this interval.  
\bigskip
\noindent
II.  Students on a boat send signals back to shore by arranging
(exactly) 9 colored flags on a vertical flagpole.
\item{A)} (5) How many different signals can they send if
they have flags of 9 different colors?
\Sol
This is the number of permutations of 9 things taken 9 at a time:
$P_9^9 = 9!$.
\bigskip
\item{B)} (10) How many different signals can they send if
they have 4 green, 3 red, and 2 blue flags?  (There are no
differences between the flags of the same color.)
\Sol
The 4 green flags can go in any 4 of the 9 locations, so there
are ${9\choose 4}$ ways to place them.  Then once the greens
have been placed, there are 5 slots left for the 3 red flags,
so there are ${5\choose 3}$ ways to place them.  There are
${2\choose 2}$ ways to place the blues after the greens and reds
have been placed.  This gives
$${9 \choose 4}{5\choose 3}{2\choose 2} = {9!\over 4!3!2!} = 1260$$
different ways.
\bigskip
\item{C)} (10) In the situation of part B, if a random 
arrangement of flags is constructed, what is the probability that
all the green flags appear {\it consecutively}?
\Sol
The string of consecutive green flags can start in locations
1,2,3,4,5, or 6 along the pole.  For each of these, there are
then ${5\choose 3}{2\choose 2}$ ways left to place the reds and the blues.
(Those {\it do not} need to be consecutive, of course!).  If a 
random arrangement is chosen, any arrangement is equally likely, 
and the probability that the green
flags are consecutive is 
$${6\cdot {5\choose 3}{2\choose 2}\over {9 \choose 4}{5\choose 3}{2\choose 2}} 
= {6\over {9\choose 4} }\doteq .048.$$
\bigskip
\noindent
III.  Let $A_1,A_2,A_3$ be events in a sample space $S$.
Assume that $S = A_1\cup A_2 \cup A_3$, where $A_i \cap A_j = \emptyset$
if $i\ne j$.  Let $P(A_1) = .3$, $P(A_2) = .2$, $P(A_3) = .5$.
Finally, let $B$ be another event with $P(B|A_1) = .1$,
$P(B|A_2) = .2$ and $P(B|A_3) = .05$.  
\item{A)} (10) What is $P(B)$?
\Sol
We use the Law of Total Probability:
$$P(B) = \sum_{i=1}^3 P(B|A_i)P(A_i)  = (.1)(.3)+(.2)(.2)+(.05)(.5) = .095.$$
\bigskip
\item{B)} (5) Are $B$ and $A_2$ independent events?  Why or why not?
\Sol
$B$ and $A_2$ are {\it not} independent events because $P(B) = .095$, but
$P(B|A_2) = .2$, so $P(B|A_2) \ne P(B)$.  
\bigskip
\item{C)} (10) Find $P(A_1 \cup A_2 | B)$.
\Sol
Since $A_1\cap A_2 = \emptyset$, 
$$P((A_1 \cup A_2)\cap B) = P((A_1 \cap B) \cup (A_2\cap B)) = 
P(A_1\cap B) + P(A_2 \cap B).$$
Hence 
$$P(A_1 \cup A_2 | B) = {P((A_1 \cup A_2)\cap B)\over P(B)} = P(A_1 | B) + P(A_2 | B)$$
By Bayes' Rule, then
$$P(A_1 | B) + P(A_2 | B) = {P(B | A_1)P(A_1)\over .095} + {P(B | A_2) P(A_2)\over .095}
 = {(.1)(.3) + (.2)(.2)\over .095} = .737.$$
\bigskip
\noindent
IV.  
\item{A)}  (15)  A jar contains 7 red and 11 white balls.  Draw {\it two
balls} at random, {\it without replacing the first ball after it is drawn}.  
Let $X$ be the number of balls drawn that are red.  Thinking of $X$ as a 
discrete random variable, find its probability mass function, and compute 
its expected value and variance.
\Sol
This was the one slightly tricky question on this exam.  $X$ does not
have a binomial distribution because when you remove a ball from the jar
the probabilities of drawing each color on the second draw {\it change}.
We have
$$\matrix{x & P(X = x) \cr
\cr
          0 & {11\over 18}{10\over 17} = {110\over 306} = .359\cr\cr
          1 & 2{11\over 18}{7\over 17} = {154\over 306} = .503\cr\cr
          2 & {7\over 18}{6\over 17} = {42\over 306} = .137\cr}$$
(Note: these don't sum to exactly 1 because of rounding.)
\bigskip
Then
$$E(X) = 0(.359) + 1(.503) + 2(.137) = .778$$
and 
$$E(X^2) = 0(.359) + 1(.503) + 4(.137) = 1.052$$
so  $V(X) = E(X^2) - (E(X))^2 = 1.052 - (.778)^2 = .447$.
\bigskip
\item{B)}  (10)  Assume you have a 40\% of connecting each
time you dial a very busy customer service telephone line.
If 25 calls are made at random and independently, what is the  
probability that between 15 and 20 of them (inclusive) will get through?
\Sol
This one {\it is} binomial, with $n = 25$ and $p = .40$.  From the 
binomial table, 
$$P(15 \le Y \le 20) = P(Y \le 20) - P(Y \le 14) = 1.000 - .966 = .034$$

\noindent
{\it Extra Credit}  (10)
Let $Y$ have a geometric distribution with success probability $p$.
Show that the expected value of $g(Y) = e^Y$ is $E(e^Y) = {pe\over 1-qe}$.  
\Sol
By the geometric series sum formula,
$$E(e^Y) = \sum_{y=1}^\infty e^y q^{y-1} p = {p\over q}\sum_{y=1}^\infty (qe)^y
= {pqe\over q(1 - qe)} = {pe\over 1-qe}.$$
\bye