\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 2005 fall semester midterm problems and answers}\\
\normalsize

\begin{enumerate}

\item $10\%$ of the glass bottles coming off a production line
have serious flaws in the glass. If two bottles are randomly
selected, find the mean and variance of the number of bottles that
have serious flaws by directly computing them using the probability
mass function.
\item A lie detector will show a positive reading (indicates a lie)
$10\%$ of the time when a person is telling the truth and $90\%$ of
the time when the person is lying. Suppose two people are suspects
in a crime and only one is guilty. The guilty one will be lying
while the innocent one will be telling the truth.\\ (a) What is the
probability that the detector shows
positive readings for both suspects?\\
The answer should be correct up to 3 decimal places.\\
{\em Solution.} Let $X$ be the number of flawed bottles. The
probability mass function of $X$ is $p(0)=0.1^2, p(1)=2\cdot0.9
\cdot0.1, p(2)=0.1^3$. $\mathbb{E} X = p(1)+2p(2)= 2\cdot0.9
\cdot0.1 + 2\cdot0.1^3=0.182$. $\mathbb{E} X^2 = p(1)+2^2p(2)=
2\cdot0.9 \cdot0.1 + 2^2\cdot0.1^3=0.184$. $\mathbb{V} X= \mathbb{E}
X^2 - (\mathbb{E} X)^2 = 0.151$.

{\em Solution.} \bq P(positive) &=& P(positive \cap lying) +
P(positive \cap truth)\\
&=& P(positive|lying)P(lying) + P(positive|truth)P(truth)\\
&=& 0.1 \times 0.5 + 0.9 \times 0.5 =0.5\eq

(b) What is the probability that a person is lying when the detector shows a negative reading?\\
{\em Solution.} \bq P(lying | negative) &=&
\frac{P(negative|lying)P(lying)}{P(negative)}\\
& =& \frac{P(negative|lying)P(lying)}{P(negative|lying)P(lying) +
P(negative|truth)P(truth)}.\eq $P(negative|lying)=
1-P(positive|lying) = 1 - 0.9=0.1$.\\ $P(negative|truth)=
1-P(positive|truth) = 1 - 0.1=0.9$. Hence $$P(lying |
negative)=\frac{0.1 \cdot 0.5}{0.1 \cdot 0.5 + 0.9 \cdot 0.5}=0.1.$$

\item (a) Prove $P(A \cup B \cup C) \leq P(A) + P(B) + P(C)$.\\
(b) Prove $P(A \cap B \cap C) \geq P(A) + P(B) + P(C) -2$.\\
{\it Solution.} (a) $P(A \cup D) = P(A) + P(D) - P(A \cap D) \leq
P(A) + P(D)$. Now let $D=B \cup C$. Then similarly $P(D) \leq P(B) +
P(C)$. So $P(A \cup B \cup C) \leq P(A) + P(D) \leq P(A) + P(B) +
P(C)$.\\ (b) Note $P(A \cup D) = P(A)+P(D)-P(A \cap D) \leq 1.$ So
$P(A \cap D) \geq P(A) + P(D) -1$. This inequality is called the
{\it Bonferroni's inequality}. Now let $D=B \cap C$ and reapply
the Bonferrnoi's inequality and we prove the statement.\\

\item (a) Consider equation $X_1 + X_2 + X_3 + X_4  = 0$.
If each $X_i$ can only take value either $1$ or $-1$, determine the
number of unique solutions to this equation. Note $(X_1,X_2,X_3,X_4)
=(1,-1,1,-1)$ is a solution while $(X_1,X_2,X_3,X_4) =(1,-1,-1,-1)$
is not.

Assume further that $X_i$ is a random variable such that $P(X_i
=1)=p$ and $P(X_i=-1)=1-p$. Determine the probability that random
variables $(X_1,X_2,X_3,X_4)$ satisfy the above equation.

(b) Consider equation $X_1 + X_2 + X_3 + \cdots +X_8 = 0$. Each
$X_i$ can only take one of three values $1, 0$ or $-1$. The
probability of $X_i$ taking one of the three values is
$\frac{1}{3}$. Determine the probability that random variables
$(X_1,X_2,\cdots,X_8)$ satisfy the above equation.

{\em Solution.} (a) If 2 of variables are 1 and the remaining 2 are
-1, we have solution. Hence there are ${4 \choose 2}$ possible
solutions. The size of the sample space is $2^4$ so the probability
is $\frac{{4 \choose 2}}{2^n}$. (b) Let $Y$ be the number of
variables that take value 1 and $Z$ be the number of variables that
take value -1. Then $n-Z-Y$ is the number of variables that take
value 0. In order to have a solution, we need $Y=Z$. $P(Y=Z) =
\sum_{x=0}^4 P(Y=Z=x) = \sum_{x=0}^4 {8 \choose x}{8-x \choose
x}(\frac{1}{3})^8$.
\end{enumerate}
\end{document}
