\renewcommand{\coddate}{\small \today}
\renewcommand{\sheweek}{MT2006/2007 Solution 1}
\begin{center}
\Huge \textbf{Solutions for Exercise 1}
\end{center}
\vspace{1cm}

\begin{enumerate}

\item Suppose that the balls are labelled $S_1,S_2,S_3,G_1,G_2$ with an
obvious convention for their colours. A suitable sample space is the
set of all possible pairs of the 5 balls, with order taken into account. There are 25 such possible pairs. This gives
\[
\Omega=\{ (S_1,S_1), (S_1,S_2),\dots ,(G_2,G_2)\}
\]
They can be put into a table as follows:

\begin{tabular}{lrrrrr}
&\multicolumn{5}{c}{First Ball}\\
&$S_1$&$S_2$&$S_3$&$G_1$&$G_2$\\
Second Ball\\
$S_1$&$\circ$&$\circ$&$\circ$&$\circ$&$\circ$\\
$S_2$&$\circ$&$\circ$&$\circ$&$\circ$&$\circ$\\
$S_3$&$\circ$&$\circ$&$\circ$&$\circ$&$\circ$\\
$G_1$&$\circ$&$\circ$&$\circ$&$\circ$&$\circ$\\
$G_2$&$\circ$&$\circ$&$\circ$&$\circ$&$\circ$\\
\end{tabular}

Each dot represents an outcome in $\Omega$.  We can mark the
outcomes in events $E_1$ with $\Box$ and $E_2$ with
$\bigtriangleup$.

\begin{tabular}{lrrrrr}
&\multicolumn{5}{c}{First Ball}\\
&$S_1$&$S_2$&$S_3$&$G_1$&$G_2$\\
Second Ball\\
$S_1$&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&$\bigtriangleup$&$\bigtriangleup$\\
$S_2$&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&$\bigtriangleup$&$\bigtriangleup$\\
$S_3$&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&$\bigtriangleup$&$\bigtriangleup$\\
$G_1$&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&$\circ$&$\circ$\\
$G_2$&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&$\circ$&$\circ$\\
\end{tabular}

To find $P(E_1)$, $P(E_2)$ and $P(E_1\cap E_2)$, since the outcomes in the sample space are equally likely, it is enough to count them.
\[
P(E_1)=15/25=3/5.
\]
\[
P(E_2)=15/25=3/5.
\]
\[
P(E_1\cap E_2) = 9/25.
\]
Notice that $P(E_1\cap E_2)=P(E_1)P(E_2)$ so that $E_1$ and $E_2$ are \emph{independent} events.

If we sample without replacement, then the outcomes on the diagonal of
the table are no longer needed. All the others remain equally likely.

\begin{tabular}{lrrrrr}
&\multicolumn{5}{c}{First Ball}\\
&$S_1$&$S_2$&$S_3$&$G_1$&$G_2$\\
Second Ball\\
$S_1$&&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&$\bigtriangleup$&$\bigtriangleup$\\
$S_2$&$\Box$$\bigtriangleup$&&$\Box$$\bigtriangleup$&$\bigtriangleup$&$\bigtriangleup$\\
$S_3$&$\Box$$\bigtriangleup$&$\Box$$\bigtriangleup$&&$\bigtriangleup$&$\bigtriangleup$\\
$G_1$&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&&$\circ$\\
$G_2$&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&$\Box$\hspace*{0.72em}&$\circ$&\\
\end{tabular}

Recounting the outcomes
\[
P(E_1)=12/20=3/5.
\]
\[
P(E_2)=12/20=3/5.
\]
\[
P(E_1\cap E_2) = 6/20=3/10.
\]
This time the events are not independent, but we can clearly see that
$P(E_1)=P(E_2)$, which is not otherwise completely transparent for
sampling without replacement.

\item The probabilities of not inspecting the two faulty motors are easily seen to be
\begin{enumerate}
\item $\binom{10}{2}/\binom{12}{2}=(10\times 9)/(12\times 11) =15/22$.
\item $(\binom{5}{1}/\binom{6}{1})^2 = 25/36$.
\item $(\binom{4}{1}/\binom{6}{1})\times 1=2/3$.
\end{enumerate}
The second one is the largest.

\item
\begin{enumerate}
\item There are 8 equally likely ordered arrangements of heads and tails
when 3 coins are tossed. All except for HHH and TTT have an ``odd
one out".  So the probability of having a loser on a given turn is
$6/8=3/4$.
\item
The probability of an even number of turns is
\[
\sum_{i=1}^\infty P(2i\text{ turns needed})
\]
which is
\[
\sum_{i=1}^\infty
\left(\frac{1}{4}\right)^{2i-1}\frac{3}{4}=\frac{3}{16}
\sum_{i=0}^\infty
\left(\frac{1}{16}\right)^{i}=(3/16)/(1-1/16)=1/5.
\]
Notice that we need to add here the probabilities for a whole sequence of disjoint events to get the answer.
\end{enumerate}

\item There are a lot of ways of doing this. $A$ throws $n+1$ times and
$B$ throws $n$ times. Consider $A$'s first $n$ throws together with
$B$'s throws; a total of $2n$ throws, each having 2 possible outcomes,
so there is a total of $2^{2n}$ equally likely outcomes. Now let $H_A$
be the number of heads in $A$'s first $n$ throws and $H_B$ be the
number of heads in $B$'s throws. We can partition the sample space into
three events;
\newline
\begin{tabular}{lll}
$E_1$ event that $H_A > H_B$ & $E_2$ event that $H_A = H_B$ &
$E_3$ event that $H_A < H_B$
\end{tabular} \newline
By mutual exclusive and exhaustive properties, the sum of the
number of outcomes in each event must be the total number of
outcomes in the sample space; $|E_1| + |E_2| + |E_3| = 2^{2n}$. By
symmetry we see that $|E_1| = |E_3|$ and so $2|E_1| + |E_2| =
2^{2n}$.

Now consider $A$'s final throw. This brings the total number of
throws to $2n+1$ and hence the size of the sample space to
$2^{2n+1}$. If event $E_1$ has occurred then $A$ has won with
either a head or a tail on the final throw; this gives $2|E_1|$
outcomes. If $E_2$ has occurs then $A$ needs to throw a head to
win; giving $|E_2|$ outcomes. Thus the total number of ways that
$A$ can win is $2|E_1| + |E_2|$. We established above that $2|E_1|
+ |E_2| = 2^{2n}$. Thus $P(A {\rm wins}) = 2^{2n} / 2^{2n+1} =
1/2$.

Another way is to use a few probability generating functions. Suppose
we have $m$ coin tosses for A and $n$ for B. It is obvious by
inspection that for $r= -n, -n+1,\dots ,m$ the coefficient of $t^r$ in
 \[
 (1+t)^m(1+1/t)^n/2^{m+n}=(1+t)^{m+n}/[2^{m+n}t^n]
 \]
 is the probability that there are exactly $r$ more heads for A than for
 B. Expanding the binomial on the right we evaluate the probability as
  \[
  \binom{m+n}{n+r}/2^{m+n}.
  \]
  This is the probability of $n+r$ heads in $m+n$ tosses.
So the probability that A has more heads than B is the same as the
probability of more than $n$ heads in $m+n$ tosses of the coin. This is
obviously 0.5 if $m=n+1$.

It is easy to obtain directly  the probability given above of exactly
$r$ more heads for A than for B. The probability of $r$ more heads for
A than for B is the sum for $s=\max (0, -r),1,\dots, \min (n,m-r)$ of
the probabilities that we have $s+r$ heads in $m$ tosses and also $s$
heads from $n$ tosses. The probabilities summed are the same as the
probabilities that there are  $s+r$ heads in $m$ tosses and also $n-s$
heads from $n$ tosses. The sum of those probabilities is the same as
the probability of $n+r$ heads in $m+n$ tosses.

 \item  It is easiest to use a sample space
which has equally likely outcomes, and then to count outcomes to find
the required probabilities. Let's number the positions in the row from
1 to 6. $A$ and $B$ are equally likely to occupy any 2 positions that
are distinct. We can use a diagram to show the outcome space - each
circle shows a possible position for $A$ and $B$, and all 30 outcomes
are equally likely.


\begin{tabular}{lrrrrrr}
&\multicolumn{6}{c}{Position of $A$}\\
&$1$&$2$&$3$&$4$&$5$&$6$\\
Position of $B$\\
$1$&&$\circ$&$\circ$&$\circ$&$\circ$&$\circ$\\
$2$&$\circ$&&$\circ$&$\circ$&$\circ$&$\circ$\\
$3$&$\circ$&$\circ$&&$\circ$&$\circ$&$\circ$\\
$4$&$\circ$&$\circ$&$\circ$&&$\circ$&$\circ$\\
$5$&$\circ$&$\circ$&$\circ$&$\circ$&&$\circ$\\
$6$&$\circ$&$\circ$&$\circ$&$\circ$&$\circ$
\end{tabular}

Now we can mark each outcome with the number of people between $A$
and $B$.  This gives

\begin{tabular}{lrrrrrr}
&\multicolumn{6}{c}{Position of $A$}\\
&$1$&$2$&$3$&$4$&$5$&$6$\\
Position of $B$\\
$1$&&0&1&2&3&4\\
$2$&0&&0&1&2&3\\
$3$&1&0&&0&1&2\\
$4$&2&1&0&&0&1\\
$5$&3&2&1&0&&0\\
$6$&4&3&2&1&0
\end{tabular}


Then counting the number of outcomes for each case gives
\begin{align*}
P(0)&=10/30 = 1/3\\
P(1)&=8/30 = 4/15\\
P(2)&=6/30 = 1/5\\
P(3)&=4/30 = 2/15\\
P(4)&=2/30 = 1/15.
\end{align*}
Now it is easy to generalise to the case of $n$ positions. There are
$n^2-n=n(n-1)$ equally likely positions for $A$ and $B$, and $2(n-r-1)$
of these have $r$ people between $A$ and $B$. So
\[
P(r\text{ people between } A\text{ and }B)
=\frac{2(n-r-1)}{n(n-1)}
\]
for $r=0,1,2,\dots ,n-2$.

If the positions for $A$ and $B$ are in a ring, and we look
clockwise for the number of people between them, the same diagram
will work, but we need to put in different labels for the numbers
between.


\begin{tabular}{lrrrrrr}
&\multicolumn{6}{c}{Position of $A$}\\
&$1$&$2$&$3$&$4$&$5$&$6$\\
Position of $B$\\
$1$&&4&3&2&1&0\\
$2$&0&&4&3&2&1\\
$3$&1&0&&4&3&2\\
$4$&2&1&0&&4&3\\
$5$&3&2&1&0&&4\\
$6$&4&3&2&1&0
\end{tabular}

In this case it is obvious that all numbers of people between $0$
and $n-2$ have the same probability.  This is also true in the
general case of $n$ positions.  It is often true that arrangements
on a circle have simpler properties than arrangements on a line.

\item The urn contains 8 distinct disks.

\begin{tabular}{lrrrr}
      & A & B & C & D \\
red   & $\circ$ & $\circ$ &  &  \\
green & $\circ$ & $\circ$ &  & \\
blue  & $\circ$ & $\circ$ & $\circ$ & $\circ$\\
\end{tabular}

By inspection we can see;
\begin{enumerate}
\item $P(A) = 3/8$, $P({\rm red}) = 1/4$ and $P(A \cap {\rm red}) = 1/8$
hence not independent,
\item $P(A \cup D) = 1/2$, $P({\rm red}) = 1/4$ and
$P((A \cup D) \cap {\rm red}) = 1/8$ hence independent,
\item $P(A \cup {\rm blue}) = 3/4$, $P({\rm red}) = 1/4$ and
$P((A \cup {\rm blue}) \cap {\rm red}) = 1/8$ hence  not
independent,
\end{enumerate}


\item The probabilities can be read off from the diagram:
\begin{center}
\includegraphics[width=2in,clip]{example1.eps}
\end{center}


\item
\begin{enumerate}
\item We can use a sample space of eight equally likely outcomes if we
take into account birth order. Using $M$ and $F$ for boys and
girls, we can write
\[
\Omega= \{MMM,MMF,MFM,FMM,MFF,FMF,MFF,FFF\}
\]
Then $A=\{MMF,MFM,FMM,MFF,FMF,MFF\}$,\\ $B=\{MMM,MMF,MFM,FMM\}$
and $A\cap B =\{MMF,MFM,FMM\}$. Counting the outcomes in the
events gives
\begin{align*}
P(A)&=6/8=3/4\\
P(B)&=4/8=1/2\\
P(A\cap B)&=3/8
\end{align*}
Obviously $P(A\cap B) = P(A)P(B)$, so $A\perp B$. It is hard to
see this independence intuitively. One needs to verify it to be
sure.
\item For four children families there are 16 equally likely family
outcomes. Just 2 of these have all the children of the same
gender, so $P(A)=14/16=7/8$, and there is $\binom{4}{0}=1$ family
with all boys and $\binom{4}{1}=4$ families with 1 girl.  All the
other families have more than 1 girl, so $P(B)=5/16$. There are 4
families with children of both genders and no more than 1 girl, so
$P(AB)=4/16=1/4$.  In this case there is not independence between
$A$ and $B$ because
\[
P(A\cap B)=\frac{1}{4}\not =
\frac{7}{8}\times\frac{5}{16}=P(A)P(B).
\]
 \end{enumerate}

 \item
\begin{enumerate}
\item
Since $A\cap B$ and $A\cap B^c$ are disjoint,
\[
A = (A\cap B)\cup (A\cap B^c)
\]
implies
\[
P(A) = P(A\cap B)+P(A\cap B^c)
\]
or
\[
P(A\cap B^c)=P(A) - P(A\cap B)
\]
Since $A\perp B$, $P(A\cap B)=P(A)P(B)$, and so the last equation
implies
\begin{align*}
P(A\cap B^c)&=P(A) - P(A)P(B)\\
&=P(A)[1-P(B)]\\
&=P(A)P(B^c).
\end{align*}
So $A\perp B^c$.
\item If
\[
P(A|B)<P(A)
\]
then since $P(A|B)=P(A\cap B)/P(B)$, it follows that
\[
\frac{P(A\cap B)}{P(B)}<P(A)
\]
and so that
\[
P(A\cap B) < P(A)P(B).
\]
Since $P(A)>0$ we can divide both sides by $P(A)$ to get
\[
\frac{P(A\cap B)}{P(A)} < P(B)
\]
which is
\[
P(B|A)<P(B).
\]
Notice that there is an intuitive interpretation of this result.
It says that if $A$ makes $B$ less probable, then $B$ makes $A$
less probable.  \item This is a false statement. It says that $A$
and $B$ are conditionally independent given event $C$.  To show
that this does not imply in general that $A$ and $B$ are
independent, you must find an explicit counter-example.  One such
is found by choosing $A=B=C$ and $P(A)<1$. Then
$P(A|C)=P(B|C)=P(A\cap B)|C)=1$, and so the conditional
independence trivially holds true. However, $P(A\cap B)=P(A)$ and
$P(A)P(B)=P(A)^2$, so there is not independence between $A$ and
$B$, for that implies $P(A)=P(A)^2$, which is false as $P(A)\not =
0 \text{ or } 1$.
\item
The statement in the question says that $B$ has the same
probability if $A$ occurs as if $A$ does not occur. One would
expect that this should imply $A$ and $B$ independent, and it
does!
\[
P(B|A)=P(B|A^c)
\]
implies
\[
\frac{P(A\cap B)}{P(A)}=\frac{P(A^c\cap B)}{P(A^c)}
\]
Adding the numerators and denominators, this implies
\[
\frac{P(A\cap B)}{P(A)}=\frac{P(A\cap B)+P(A^c\cap
B)}{P(A)+P(A^c)}
\]
which is
\[
\frac{P(A\cap B)}{P(A)}=\frac{P(B)}{1}
\]
Cross-multiplying gives
\[
P(A\cap B) = P(A)P(B)
\]
which shows that $A\perp B$.
\end{enumerate}

\item Let $A_i$ be the event that $i$th face does not appear.
We will use the formulae for unions
\begin{equation} \label{punion:eq}
P(\bigcup_{i=1}^6 A_i) = \sum_i P(A_i) - \sum_{i<j} P(A_i \cap
A_j) + \sum_{i<j<k} P(A_i \cap A_j \cap A_k) + \ldots - P(A_1 \cap
\ldots \cap A_6).
\end{equation}
If we throw the die $n$ times then

\begin{tabular}{lll}
$P(A_1) = (5/6)^n$ &  $P(A_1 \cap A_2) = (4/6)^n$ & $P(A_1 \cap A_2 \cap A_3) = (3/6)^n$ \\
$P(A_1 \cap \ldots \cap A_4) = (2/6)^n$ & $P(A_1 \cap \ldots \cap
A_5) = (1/6)^n$  & $P(A_1 \cap \ldots \cap A_6) = 0$
\end{tabular}

Let $E$ be event each face appears at least once. Using
\eqref{punion:eq} and exploiting symmetry yields;
\begin{eqnarray}
P(E) &=& 1 - P(A_1 \cup \ldots \cup A_6) \nonumber \\ &=& 1-
6(5/6)^n + 15(2/3)^n - 20(1/2)^n + 15 (1/3)^n - 6(1/6)^n.
\nonumber
\end{eqnarray}


\item For $X$ and $Y$ mutually exclusive $P(X \cup Y) = P(X) +
P(Y)$. For general events $A$ and $B$;
\begin{enumerate}
\item $A \cup A^c = \Omega \Rightarrow P(A \cup A^c) = 1$. \newline
$A$ and $A^c$ mutually exclusive $\Rightarrow P(A \cup A^c) = P(A)
+ P(A^c)$. \newline Thus $P(A) + P(A^c) = 1$ and so $P(A^c) = 1 -
P(A)$.
\item $B = (A \cap B) \cup (A^c \cap B)
\Rightarrow P(B) = P((A \cap B) \cup (A^c \cap B))$ \newline $A
\cap B$ and $A^c \cap B$ mutually exclusive $\Rightarrow P((A \cap
B) \cup (A^c \cap B)) = P(A \cap B) + P(A^c \cap B)$ \newline Thus
$P(A \cap B) + P(A^c \cap B) = P(B)$ and so $P(A^c \cap B) = P(B)
- P(A \cap B)$. \label{cmp:pt}
\item $A \cup B = A \cup (A^c \cap B) \Rightarrow P(A \cup B)
= P(A \cup (A^c \cap B))$. \newline $A$ and  $(A^c \cap B)$
mutually exclusive $\Rightarrow P(A \cup (A^c \cap B)) = P(A) +
P(A^c \cap B)$. \newline Thus $P(A \cup B) = P(A) + P(A^c \cap B)
= P(A) + P(B) - P(A \cap B)$ by part \ref{cmp:pt}.
\item $(A \cup B) \cap (A^c \cup B^c) = (A \cap B^c) \cup (A^c \cap
B) \Rightarrow P((A \cup B) \cap (A^c \cup B^c)) = P((A \cap B^c)
\cup (A^c \cap B))$. \newline $(A \cap B^c)$ and $(A^c \cap B)$
are mutually exclusive so $P((A \cap B^c) \cup (A^c \cap B)) = P(A
\cap B^c) + P(A^c \cap B)$. \newline Thus $P((A \cup B) \cap (A^c
\cup B^c)) = P(A \cap B^c) + P(A^c \cap B) = P(A) + P(B) - 2P(A
\cap B)$ by \ref{cmp:pt}.
\end{enumerate}
We could interpret the event $(A \cup B) \cap (A^c \cup B^c)$ as
the event that either $A$ or $B$ happens but not both.

\item
\begin{enumerate}
\item \label{worm1:pt}
\begin{tabular}[t]{ll}
Partition & $B_1$ vicious $P(B_1) = 0.1$ \\
& $B_2$ not vicious $P(B_2) = 0.9$ \end{tabular}

If $R$ is the event that a randomly chosen worm is red, we can see
from the questions that $P(R|B_1) = 4/5$ and $P(R|B_2) = 1/4$.

Law of total probability to get probability worm is red;
\begin{eqnarray}
P(R) & = & P(R|B_1) P(B_1) + P(R|B_2)P(B_2) \nonumber \\
    & = & 4/5 \times 0.1 + 1/4 \times 0.9 = 0.305. \nonumber
\end{eqnarray}

Bayes' theorem to get probability that a worm is vicious given
that it is red;
\begin{eqnarray}
P(B_1|R) & = & P(R|B_1) P(B)/P(R) \nonumber \\
& = & 4/50 \times 200/61 = 16/61 = 0.262. \nonumber
\end{eqnarray}

\item Define events $R_1$ - worm red; $R_2$ - parent red; $R_3$ -
grandparent red. From part \ref{worm1:pt} $P(R_1) = 0.305 = P(R_2)
= P(R_3)$. From question $P(R_1|R_2) = 3/4$, $P(R_1|R_3) = 2/3$
and $P(R_1|R_2 \cap R_3) = 4/5$.
\begin{enumerate}
\item Probability red and parent red is given by \newline
$P(R_1 \cap R_2) = P(R_1|R_2)P(R_2) = 3/4 \times 0.305 = 0.22875$.
\item  Probability red or parent red or grandparent red given by
\newline
$P(R_1 \cup R_2 \cup R_3) = P(R_1) + P(R_2) + P(R_3) - P(R_1 \cap
R_2) - P(R_2 \cap R_3) - P(R_1 \cap R_3) + P(R_1 \cap R_2 \cap
R_3)$.

Elements of this equation: \newline $P(R_1 \cap R_2) = 0.22875$
\newline $P(R_2 \cap R_3) = 0.22875$ (parent to grandparent $\sim$
child to parent)
\newline $P(R_1 \cap R_3) = P(R_1|R_3)P(R_3) = 0.305 \times 2/3 = 0.20333$
\newline $P(R_1 \cap R_2 \cap R_3) = P(R_1|R_2 \cap R_3) P(R_2
\cap R_3) = 4/5 \times 0.22875 = 0.183$ \newline $\Rightarrow
P(R_1 \cup R_2 \cup R_3) = 0.4371$.
\end{enumerate}
\end{enumerate}

\item This question just uses the law of total probability.
\begin{enumerate}
\item When we transfer just one disk;

\begin{tabular}[t]{ll}
Partition: & $R_1$ transfer red disk, $P(R_1) = 4/9$ \\
& $G_1$ transfer green disk, $P(G_1) = 5/9$
\end{tabular}

Let $R_2$ be the event that the disk we draw from the second urn
is red then
\begin{eqnarray}
 P(R_2) &=& P(R_2|R_1)P(R_1) + P(R_2|G_1)P(G_1) \nonumber \\
 &=& 6/10 \times 4/9 + 5/10 \times 5/9 = 49/90 = 0.544. \nonumber
 \end{eqnarray}

 \item Transferring two disks;

\begin{tabular}[t]{ll}
Partition: & $RR$ transfer 2 red disks, $P(RR) = 4/9 \times 3/8 = 1/6$ \\
& $RG$ transfer 1 red and 1 green disk, $P(RG) = 2 \times 4/9
\times 5/8$ = 5/9\\
& $GG$ transfer 2 green disks, $P(GG) = 5/9 \times 4/8 = 5/18$
\end{tabular}

\begin{eqnarray}
 P(R_2) &=& P(R_2|RR)P(RR) + P(R_2|RG)P(RG) + P(R_2|GG)P(GG) \nonumber \\
 &=& 7/11 \times 1/6 + 6/11 \times 5/9 + 5/11 \times 5/18 = 53/99 = 0.535 \nonumber
 \end{eqnarray}

\end{enumerate}
\end{enumerate}
