
\problemdata
{random variable}
{independence}
{Eric Ho, S02}
\begin{problem}

Let $X$ and $Y$ be the outcomes of successive rolls of a six-sided die.
Assume that the die is fair and the two rolls are independent.  Now
define the following random variables:
\begin{itemize}
\item $A$ is the indicator random variable for the event that $X$ is even,

\item $B$ is the indicator random variable for the event that $Y$ is even,

\item $C \eqdef f(X)$, and

\item $D \eqdef f(Y)$,
\end{itemize}
where $f$ is a function on the outcome of a die:
\[
f(X) \eqdef \left\{ \begin{array}{cl}
        1 & \mbox{if $X=1$ or 2},\\
        2 & \mbox{if $X=3$ or 4}, \\
        3 & \mbox{if $X=5$ or 6}.
\end{array} \right.
\]
Equivalently,
\[
f(X) \eqdef \ceil{\frac{X}{2}}.
\] 

\begin{problemparts}

\problempart 

Prove that $A,B,C,D$ are pairwise independent. 

\solution{Since $X$ and $Y$ are independent, we immediately know that $A$
is independent of $B$, $C$ is independent of $D$, $A$ is independent of
$D$, and $B$ is independent of $C$.

To show $A$ and $C$ are independent, note that the $\pr{C=i}$ is 1/3 for
$1 \le i \le 3$.  Also, $\prcond{C=i}{A=1}$ is 1/3 because, given that
$A=1$, $X$ equals one of 2, 4, or 6 with equal probability, so $C=f(X)$ is
equally likely to be 1, 2 or 3.  So
\[
\prcond{C=i}{A=1} = \pr{C=i}.
\]
A similar argument shows that
\[
\prcond{C=i}{A=0} = \pr{C=i}.
\]
Therefore $A$ and $C$ are independent.  The same logic applies to $B$ and
$D$.}

\problempart
Prove that $A+B$ and $C+D$ are independent. (Hint: You only need to cover a few
general cases.  Do not iterate through every single case).

\solution{

Consider the case $(A+B=0, C+D=2)$.

\begin{eqnarray*}
\pr{A+B=0} & = & \pr{A=0 \land B=0}  =  \frac{1}{2} \cdot \frac{1}{2} =  \frac{1}{4},  \\
\pr{C+D=2} & = & \pr{C=1 \land D=1}  = \frac{1}{3} \cdot \frac{1}{3} = \frac{1}{9}, \\
\pr{A+B=0 \land C+D=2} & = & \pr{X=1 \land Y=1} \\
			     & = & \pr{X=1} \cdot \pr{Y=1} \\
			     & = & \frac{1}{6}\cdot\frac{1}{6}\\
		           & = & \frac{1}{36}  = (\frac{1}{4})(\frac{1}{9}). \\
\end{eqnarray*}

Therefore
\[
\pr{A+B=0 \land C+D=2} = \pr{A+B=0}\cdot\pr{C+D=2}.
\]

By similiar arguments, independence holds for other cases of $A+B$ and $C+D$.  
For example, consider the case $(A+B=1, C+D=4)$.

\begin{eqnarray*}
\pr{A+B=1} & = & \pr{A=0 \land B=1}+\pr{A=1 \land B=0} =  \frac{1}{4}+\frac{1}{4} =  \frac{1}{2},  \\
\pr{C+D=4} & = & \pr{C=1 \land D=3}+\pr{C=3 \land D=1}+\pr{C=2 \land D=2} = 3\cdot\frac{1}{9} = \frac{1}{3}, \\
\pr{A+B=1 \land C+D=4} & = & \pr{X=1 \land Y=6}+ \pr{X=5 \land Y=2}+\pr{X=3 \land Y=4} + \\
		           & = & \pr{X=2 \land Y=5}+ \pr{X=6 \land Y=1}+\pr{X=4 \land Y=3}\\
	                 & = & 6\cdot\frac{1}{36} = \frac{1}{6} = (\frac{1}{2})(\frac{1}{3}).\\
\end{eqnarray*}

Therefore
\[
\pr{A+B=1 \land C+D=4} = \pr{A+B=1}\cdot\pr{C+D=4}.
\]

In conclusion, $A+B$ is independent of $C+D$.}

\problempart 
Let $A$, $B$ be independent fair bits, let $C \eqdef A \oplus B$, and let $D
\eqdef 0$.  Verify that $A,B,C,D$ are pairwise independent but $A+B$ is not
independent of $C+D$. 

\solution{

We are given that $A$ and $B$ are independent.  $D$ is independent of $A$,$B$,$C$
because it is a constant. $A$ is independent of $C$ since $\prcond{A}{C} = \pr{A}\cdot\pr{C}
=\frac{1}{2}$.  The same logic applies to show that $B$ is independent of $C$.  
Therefore $A,B,C,D$ are pairwise independent. 

$\prcond{A+B=1}{C+D=1} = 1$ since it implies $C=1$ and $A \oplus B = 1$. 
However $\pr{A+B=1} = \frac{1}{2} \neq \prcond{A+B=1}{C+D=1}$.  Therefore 
$A+B$ is not independent of $C+D$. 
}

\end{problemparts}
\end{problem}


