\documentclass[10pt]{report}
\usepackage{amsmath,amsfonts,amssymb}

\setlength{\textwidth}{17cm} \setlength{\textheight}{24cm}
\setlength{\topmargin}{-1cm} \setlength{\oddsidemargin}{-1cm}
\setlength{\evensidemargin}{0.5cm}
\newcommand{\bq}{\begin{eqnarray*}}
\newcommand{\eq}{\end{eqnarray*}}
\begin{document}
\pagestyle{empty}
\large
{\bf STAT 311 Old midterm problems and answers}\\
\normalsize

\begin{enumerate}
\item If $A$ and $B$ are independent events, with $P(A)= \frac{1}{3}$ and $P(B)=\frac{1}{4}$, find the following:\\
(a) $P(A^c \cap B^c)$\\
{\em Solution 1.} Since $A$ and $B$ are independent, $A^c$ and $B^c$ are independent. So $P(A^c \cap B^c)= P(A^c)P(B^c)=\big(1-P(A)\big)\big(1-P(B)\big) =(1-\frac{1}{3})(1-\frac{1}{4})= \frac{1}{2}$.\\
{\em Solution 2.}
$P(A \cap B) = P(A)P(B) = \frac{1}{12}$. $P(A^c \cap B^c) = 1-P(A \cup B) = 1 - \big( P(A) + P(B) - P(A \cap B)\big) = 1 - (\frac{1}{3} + \frac{1}{4} - \frac{1}{12})= \frac{1}{2}$.

(b) $P(A^c|B)$.\\
{\em Solution.} Since $A$ and $B$ are independent, $A^c$ and $B$ are also independent. So $P(A^c|B) = P(A^c) = 1-P(A) = \frac{2}{3}$.

\item In a bolt factory, machines 1,2 and 3 respectively produce 20 $\%$, 30$\%$ and $50\%$ of the total output. Of their output, $5\%$, $3\%$ and $2\%$ are defective. A bolt is selected random.(a) List the sample space for this experiment and assign a probability to each sample point.(b) What is the probability that it is defective? (c) Given that it is defective, what is the probability that it was made by machine 1?\\
{\em Solution.} Let $D$ be the event that the bolt is defective and $M_1,M_2,M_3$ be the events that the selected bolt comes from machines 1,2 and 3 respectively. Then the sample space is given by $S= M_1 \cup M_2 \cup M_3$ with $P(M_1) = 0.2, P(M_2)=0.3,P(M_3)=0.5$. From the law of total probability,
$$P(D) = P(D|M_1)P(M_1) + P(D|M_2)P(M_2) + P(D|M_3)P(M_3),$$
where $P(D|M_1)= 0.05, P(D|M_2)=0.03,P(D|M_3)=0.02$. Hence, $P(D)= 0.029$. $P(M_1|D) = \frac{P(D \cap M_1)}{P(D)} = \frac{P(D|M_1)P(M_1)}{P(D)} = 0.52$

\item A box contains 100 white and 200 black balls. Balls are randomly selected, one at a time, until a black one is obtained. Assume that each selected ball is replaced before the next one is drawn. (a) What is the probability that exactly $n$ draws are needed? (b) What is the probability that at least 10 draws are needed? (c) What is the expected number of draws until a black ball is obtained?\\
{\em Solution.}
Let $X$ be the number of draws. Then $P(X=n)
= (\frac{5}{15})^{n-1}\frac{10}{15} =
(\frac{1}{3})^{n-1}\frac{2}{3}$. This is a geometric distribution with parameter $p=\frac{2}{3}$.
\bq P(X \geq 10) = \sum_{n=10}^\infty P(X=n) &=& \sum_{n=20}^\infty  (\frac{1}{3})^{n-1}\frac{2}{3} = \frac{2}{3}\big(\frac{1}{3}\big)^{9}\sum_{n=0}^\infty \big(\frac{1}{3}\big)^{n}\\
&=& \frac{2}{3}\big(\frac{1}{3}\big)^{9} \frac{1}{1-1/3} =
\big(\frac{1}{3}\big)^{9}.\eq

\item The number of cars driving past a parking area in a 1-minute has
Possion distribution with parameter $\lambda$. The probability that
any driver wish to park his car is $p$. Let $D$ be the number of
drives who wish to park during a 1-minute interval. Find its
probability mass function.\\
{\em Solution.} Let $X$  be the number of cars driving past a
parking area. $X \sim \mbox{Poisson}(\lambda)$. Then
\bq P(D=k) &=& \sum_{i=k}^\infty P(D=k \; \mbox{and} \; X=i)\\
&=&\sum_{i=k}^\infty P(D=k|X=i)P(X=i)\\
&=&\sum_{i=k}^\infty \Big({i \choose k}p^k(1-p)^{i-k}\Big)\Big(e^{-\lambda}\frac{\lambda^i}{i!}\Big)\\
&=& \frac{(\lambda p)^k e^{-\lambda}}{k!}\sum_{i=k}^\infty
\frac{[(1-p)\lambda]^{i-k}}{(i-k)!} = \frac{(\lambda p)^k
e^{-\lambda}}{k!}e^{(1-p)\lambda} =\frac{(\lambda p)^k e^{-\lambda
p}}{k!} \eq So $D \sim \mbox{Poisson}(\lambda p)$. If there is only
one parking space, the probability you will be able to park is
$P(D=0)=e^{-\lambda p}$ since you can only park if no driver wish to
park.

\end{enumerate}
\end{document}
