%% ================================================================
\newpage
\section{Probability and measure theory}

\begin{center}
\emph{
Probability theory is measure theory with a soul.
} \\
--- Mark Kac.
\end{center}

Modern probability is a special case of measure theory, but this course avoids
the latter.  Here we draw the connections for the reader with a
measure-theoretic background.  (Full information may be found in \cite{bib:fg},
but I like to have a brief, handy reference.  See also \cite{bib:folland},
\cite{bib:rudin}, or \cite{bib:royden}.)

%% ----------------------------------------------------------------
\subsection{Dictionary}

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

The \bfidx{sample space} $\Omega$ is simply a set.

&

Same.

\\
\end{tabular}
%% ----------------------------------------------------------------

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

A \bfidx{$\sigma$-field} $\mcF$ on $\Omega$ is a subset of $2^\Omega$
satisfying the axioms of definition \ref{defn:sigma_field}; $\mcF$ must contain
at least $\emptyset$ and $\Omega$, and it must be closed under complements,
countable unions, and countable intersections.

&

Same.

\\
\end{tabular}
%% ----------------------------------------------------------------

Note that even if $\Omega$ is uncountable (for example, $\Omega=\R$),
$2^\Omega$ still satisfies the axioms for a $\sigma$-field.  If $\Omega$ is a
topological space (e.g. $\R^d$), the standard $\sigma$-field is the
\bfidx{Borel $\sigma$-field} which is the one generated by all the open sets of
$\Omega$.

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

The pair $(\Omega, \mcF)$ is called a \bfidx{measurable space}.  This is an
unfortunate misnomer since it may not be possible to put a measure on it --- in
which case we would certainly think of it as ``unmeasurable''!

&

Same.

\\
\end{tabular}
%% ----------------------------------------------------------------

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

Elements of $\mcF$ are called \bfidx{measurable
sets}.  This is also a misnomer because we haven't defined measures yet!

&

An \bfidx{event} is nothing more than a measurable set.

\\
\end{tabular}
%% ----------------------------------------------------------------

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

A \bfidx{measure} is a function $\mu:\mcF \to
[0,+\infty]$ with the following properties:
\begin{itemize}
\item $\mu(\emptyset)=0$.
\item For all $A \in \mcF$, $\mu(A)\ge 0$.
\item If $A_1, A_2, \ldots,$ is a finite or countable subset of $\mcF$,
	with the $A_i$'s all (pairwise) disjoint, then
	$P(\cup_{i} A_i) = \sum_i P(A_i)$.
	This is the \bfidx{countable additivity} property of the probability
	measure $\mu$.
\end{itemize}

&

A \bfidx{probability measure} is a measure with the additional requirement that
$\mu(\Omega)=1$.  Thus, we have $\mu:\mcF \to [0,1]$.

\\
\end{tabular}
%% ----------------------------------------------------------------

Note that if $\Omega$ is finite or countably infinite, it is possible to define
a measure on the biggest $\sigma$-field on $\Omega$, namely, $\mcF=2^\Omega$.
If $\Omega=\R$, then it is not possible to define a measure on $\mcF=2^\Omega$.
See \cite{bib:folland} for a proof.

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

A \bfidx{measure space} is a triple $(\Omega, \mcF, \mu)$ where $\mu$ is a
measure on $\mcF$.

&

A \bfidx{probability space} is a triple $(\Omega, \mcF, P)$ where $P$ is a
probability measure on $\mcF$.

\\
\end{tabular}
%% ----------------------------------------------------------------

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

A \bfidx{measurable function} is a function $f$ from one measurable space
$(\Omega,\mcF)$ to another measurable space $(\Psi,\mcG)$ such that the
preimage under $f$ of each measurable set in $\Psi$ is a measurable set in
$\Omega$.  That is, for all $B \in \mcG$, $f^{-1}(B) \in \mcF$.

&

A \bfidx{random variable} is a measurable function $X$ from a probability space
$(\Omega,\mcF,P)$ to a measurable space $(\Psi,\mcG)$.  For this course, that
measurable space has been $\Psi=\R$, with $\mcG$ being the Borel sets in $\R$.

\\
\end{tabular}
%% ----------------------------------------------------------------


%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

Expectation: $\int_\Omega X(\omega)\,dP(\omega)$.

&

Expectation: $E[X]$.

\\
\end{tabular}
%% ----------------------------------------------------------------

\begin{rem}
In an undergraduate context, we use the terms \emphidx{probability density
function}\index{PDF} and \emph{cumulative distribution function}.
In a graduate context, we use the following:
\begin{itemize}

\item We have a real-valued random variable $X$.  That is, we have
$X:\Omega\to\R$ where $(\Omega,\mcF,P)$ is a probability space and the
measurable space is $(\R,\mcB)$, namely, the reals with the Borel
$\sigma$-algebra.

\item This gives us a \plainidx{probability measure} $\mu_X$ on $\R$ by
$\mu_X(B) = P(X^{-1}(B))$.  This is called simply the \bfidx{distribution}
of $X$.

\item We can then measure the particular Borel sets $(-\infty, x]$.  This
defines a function $F_X(x)=\mu_X((-\infty,x])$.  This (the CDF) is called
the \bfidx{distribution function} of $X$.

\item If $d\mu_X$ is absolutely continuous with respect to Lebesgue measure,
i.e. $d\mu_X=f_X(x)\,dx$ (where $f_X(x)$ is the familiar PDF), we say $f_X(x)$
is the \bfidx{density} of $X$.

\end{itemize}
\end{rem}

%% ----------------------------------------------------------------
\begin{tabular}{p{3.0in}|p{3.0in}}
\textbf{Measure theory / analysis} & \textbf{Probability} \\
\hline

The\index{Laplace transform}\index{Fourier transform}
Laplace and Fourier transforms, respectively, of $f:\R\to\R$
are
$$
	(\mcL f)(t) = \int_\R e^{tx}\,f(x)\,dt
$$
and
$$
	(\mcF f)(t) = \int_\R e^{itx}\,f(x)\,dt.
$$

&

The\index{moment-generating function}\index{characteristic function}
moment-generating and characteristic functions, respectively, of a
real-valued random variable $X$ are
$$
	M_X(t) = E[e^{tX}]
\qand
	\beta_X(t) = E[e^{itX}]
.
$$
Let $\mu$ be the distribution of $X$.  We say that the moment-generating
and characteristic functions are the \bfidx{Laplace transform} and
\bfidx{Fourier transform}, respectively, of the measure $\mu$:
$$
	\mcL\mu = \int_\R e^{tx}\,d\mu
\qand
	\mcF\mu = \int_\R e^{itx}\,d\mu.
$$
If the distribution of $X$ has a density function $f(x)$, i.e. $d\mu = f(x) dx$
where $d\mu$ is absolutely continuous with respect to Lebesgue measure $dx$,
then these are
$$
	M_X(t) = E[e^{tX}] = \int_\R e^{tx}\,f(x)\,dx = (\mcL f)(t)
$$
and
$$
	\beta_X(t) = E[e^{itX}] = \int_\R e^{itx}\,f(x)\,dx = (\mcF f)(t).
$$

\\
\end{tabular}
%% ----------------------------------------------------------------

%% ----------------------------------------------------------------

xxx 8-29 cty of finite measures.

xxx three kinds of measures: discrete, cts, singular.

xxx 9-5 and 9-24: MCTx2, DCTx2, Fub, Fatou

xxx cvgce: a.s./w.p.1; i.p.; i.m.s.; in dist (10-29 \& 10-31) flavors.

xxx 9-14 Borel-Cantelli.

xxx 9-26 $\sigma$-field indep.

xxx 9-28 prod meas

xxx 10-19 Kolm 0-1 and tail field?

%% ----------------------------------------------------------------
\subsection{Measurability}

xxx include the not-less-refined-than pictures.

%% ----------------------------------------------------------------
\subsection{Independence and measurability}

xxx type up handwritten notes.  xxx emph summarizing content from the main body
of the paper, connecting it with the (more abstract and more puzzling)
measure-theoretic notions.  xxx mention calculus of expectations, in the
independent and measurable cases.  xxx perhaps mention SDEs \ldots.

xxx caveat I'm writing everything in terms of discrete random variables.

xxx recall the following:
$$
	P(X=x) = P(X^{-1}(x))
$$
and
$$
	P(A,B) = P(A \cap B).
$$
The right-hand sides are set-theoretic; the left-hand sides are in more common
use.

\textbf{Events:}
\begin{itemize}

\item Events $A$ and $B$ are \plainidx{independent} if $P(A\cap B) = P(A) P(B)$.

\item Definition of \plainidx{conditional probability}:
	$$
	P(A\mid B) = \frac{P(A \cap B)}{P(B)}.
	$$

\item Partition theorem\index{partition theorem}:
	$$
		P(A) = \sum_{i=1}^n P(A \mid B_i) \, P(B_i).
	$$
\end{itemize}

\textbf{Random variables:}
\begin{itemize}

\item Partition theorem\index{partition theorem}:
	$$
		E[X] = \sum_{i=1}^n E[X \mid B_i] \, P(B_i).
	$$

\item Independence\index{independence} of a random variable and an event:
	$$
		P((X=x) \cap B) = P(X = x) P(B) \textrm{ for all } x \in \R.
	$$

\item Independence\index{independence} of two random variables:
	$$
		P\big((X=x) \cap (Y=y)\big) = P(X = x) \, P(Y=y) \textrm{ for all } x,y \in \R.
	$$

\item Conditional expectation\index{conditional expectation}:
	$$
		E[X \mid B]
		\;=\;
		\sum_x x\, P((X=x) \mid B)
		\;=\;
		\sum_x x\, P(X^{-1}(x) \mid B)
		\;=\;
		\frac{\sum_x x\, P(X^{-1}(x) \cap B)}{P(B)}.
	$$
	Note:  \emph{given} means \emph{relative to}.

\item If $X$ is \plainidx{independent} of $B$, then $P(B)$ factors out of
the numerator:
	$$
		E[X \mid B]
		\;=\;
		\frac{\sum_x x\, P(X^{-1}(x) \cap B)}{P(B)}
		\;=\;
		\frac{\sum_x x\, P(X^{-1}(x)) P(B)}{P(B)}
		\;=\;
		\sum_x x\, P(X^{-1}(x))
		\;=\;
		E[X].
	$$

\item If $X$ is $B$-measurable then $X^{-1}(x) = \emptyset, B, B^c, \Omega$:
	\begin{align*}
		E[X \mid B]
			&= \frac{\sum_x x\, P(X^{-1}(x) \cap B)}{P(B)}
			= \frac{X(B) P(B \cap B) + X(B^c) P(B^c \cap B)}{P(B)}
			= \frac{X(B) P(B)}{P(B)}
			= X(B); \\
		E[X\mid B^c]
			&= X(B^c); \\
		E[X\mid \Omega]
			&= \frac{\sum_x x\, P(X^{-1}(x) \cap \Omega)}{P(\Omega)}
			= \sum_x x\, P(X^{-1}(x))
			= X(B) P(B) + X(B^c)P(B^c)
			= E[X]; \\
		E[X\mid \emptyset]
			&= 0.
	\end{align*}

	[Claim this is just $X$, when written on partitions.]

	[Claim:  a finite $\sigma$-algebra is generated by a partition.]

	[xxx include the not-less-refined-than pictures.]

\item Example:
	Let $\Omega=\{1,2,3,4\}$ with $P(k)=1/4$ for $k=1,2,3,4$.
	Let $X(1)=X(3)=2$ and $X(2)=X(4)=3$.
	Let $B=\{1,3\}$.
	Then $E[X]=2.5$ and $E[X \mid B] = 2$ which is what one would expect.

\item Conditional PMF\index{conditional PMF}\index{conditional density}:
	$$
		P(X=x \mid Y=y) = \frac{P(X=x,Y=y)}{\sum_x P(X=x,Y=y)}.
	$$

	xxx 4x4 dot figure here.

\end{itemize}

%\begin{tabular}{|c|c|c||c|c|c|c||c|}
%\hline $X^{-1}(0)$&  $G$          & $X^{-1}(0)\cap{G}$ & $P(X^{-1}(0))$  & $P(G)$ & $P(X^{-1}(0))P(G)$ & $P(X^{-1}(0)\cap{G})$ & Indep.? \\
%\hline
%\hline $\{2,4\}$ &  $\{\}$        &  $\{\}$    &          $1/2$ &    $0$ &               $0$  &                $0$   &          \textbf{yes} \\
%\hline
%\hline $\{2,4\}$ &  $\{1\}$       &  $\{\}$    &          $1/2$ &  $1/4$ &              $1/8$ &                $0$   &          no \\
%\hline $\{2,4\}$ &  $\{2\}$       &  $\{2\}$   &          $1/2$ &  $1/4$ &              $1/8$ &                $1/4$ &          no \\
%\hline $\{2,4\}$ &  $\{3\}$       &  $\{\}$    &          $1/2$ &  $1/4$ &              $1/8$ &                $0$   &          no \\
%\hline $\{2,4\}$ &  $\{4\}$       &  $\{4\}$   &          $1/2$ &  $1/4$ &              $1/8$ &                $1/4$ &          no \\
%\hline
%\hline $\{2,4\}$ &  $\{1,3\}$     &  $\{\}$    &          $1/2$ &  $1/2$ &              $1/4$ &                $0$   &          no \\
%\hline $\{2,4\}$ &  $\{2,4\}$     &  $\{2,4\}$ &          $1/2$ &  $1/2$ &              $1/4$ &                $1/2$ &          no \\
%\hline $\{2,4\}$ &  $\{1,2\}$     &  $\{2\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline $\{2,4\}$ &  $\{1,4\}$     &  $\{4\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline $\{2,4\}$ &  $\{2,3\}$     &  $\{2\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline $\{2,4\}$ &  $\{3,4\}$     &  $\{4\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline
%\hline $\{2,4\}$ &  $\{1,2,3\}$   &  $\{2\}$   &          $1/2$ &  $3/4$ &              $3/8$ &                $1/4$ &          no \\
%\hline $\{2,4\}$ &  $\{1,2,4\}$   &  $\{2,4\}$ &          $1/2$ &  $3/4$ &              $3/8$ &                $1/2$ &          no \\
%\hline $\{2,4\}$ &  $\{1,3,4\}$   &  $\{4\}$   &          $1/2$ &  $3/4$ &              $3/8$ &                $1/4$ &          no \\
%\hline $\{2,4\}$ &  $\{2,3,4\}$   &  $\{2,4\}$ &          $1/2$ &  $3/4$ &              $3/8$ &                $1/2$ &          no \\
%\hline
%\hline $\{2,4\}$ &  $\{1,2,3,4\}$ &  $\{2,4\}$ &          $1/2$ &   $1$  &              $1/2$ &                $1/2$ &          \textbf{yes} \\
%\hline
%\hline
%\end{tabular}

%\begin{tabular}{|c|c|c||c|c|c|c||c|}
%\hline $X^{-1}(1)$&  $G$          & $X^{-1}(1)\cap{G}$ & $P(X^{-1}(1))$  & $P(G)$ & $P(X^{-1}(1))P(G)$ & $P(X^{-1}(1)\cap{G})$ & Indep.? \\
%\hline
%\hline $\{1,3\}$ &  $\{\}$        &  $\{\}$    &          $1/2$ &    $0$ &               $0$  &                $0$   &          \textbf{yes} \\
%\hline
%\hline $\{1,3\}$ &  $\{1\}$       &  $\{1\}$   &          $1/2$ &  $1/4$ &              $1/8$ &                $1/4$ &          no \\
%\hline $\{1,3\}$ &  $\{2\}$       &  $\{\}$    &          $1/2$ &  $1/4$ &              $1/8$ &                $0$   &          no \\
%\hline $\{1,3\}$ &  $\{3\}$       &  $\{3\}$   &          $1/2$ &  $1/4$ &              $1/8$ &                $1/4$ &          no \\
%\hline $\{1,3\}$ &  $\{4\}$       &  $\{\}$    &          $1/2$ &  $1/4$ &              $1/8$ &                $0$   &          no \\
%\hline
%\hline $\{1,3\}$ &  $\{1,3\}$     &  $\{1,3\}$ &          $1/2$ &  $1/2$ &              $1/4$ &                $1/2$ &          no \\
%\hline $\{1,3\}$ &  $\{2,4\}$     &  $\{\}$    &          $1/2$ &  $1/2$ &              $1/4$ &                $0$   &          no \\
%\hline $\{1,3\}$ &  $\{1,2\}$     &  $\{1\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline $\{1,3\}$ &  $\{1,4\}$     &  $\{1\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline $\{1,3\}$ &  $\{2,3\}$     &  $\{3\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline $\{1,3\}$ &  $\{3,4\}$     &  $\{3\}$   &          $1/2$ &  $1/2$ &              $1/4$ &                $1/4$ &          \textbf{yes} \\
%\hline
%\hline $\{1,3\}$ &  $\{1,2,3\}$   &  $\{1,3\}$ &          $1/2$ &  $3/4$ &              $3/8$ &                $1/2$ &          no \\
%\hline $\{1,3\}$ &  $\{1,2,4\}$   &  $\{1\}$   &          $1/2$ &  $3/4$ &              $3/8$ &                $1/4$ &          no \\
%\hline $\{1,3\}$ &  $\{1,3,4\}$   &  $\{1,3\}$ &          $1/2$ &  $3/4$ &              $3/8$ &                $1/2$ &          no \\
%\hline $\{1,3\}$ &  $\{2,3,4\}$   &  $\{3\}$   &          $1/2$ &  $3/4$ &              $3/8$ &                $1/4$ &          no \\
%\hline
%\hline $\{1,3\}$ &  $\{1,2,3,4\}$ &  $\{1,3\}$ &          $1/2$ &   $1$  &              $1/2$ &                $1/2$ &          \textbf{yes} \\
%\hline
%\hline
%\end{tabular}

\beginex

Let
$$
	\Omega=\{1,2,3,4\}, \qquad
	\mcF = 2^\Omega, \qqand
	P(k)=1/4 \textrm{ for } k=1,2,3,4.
$$
Let
\begin{align*}
	X(1) &= 1 \\
	X(2) &= 0 \\
	X(3) &= 1 \\
	X(4) &= 0.
\end{align*}
(That is, $X$ is the \plainidx{parity} random variable.)

Here is a $\sigma$-algebra $\mcG$ such that $X$ is not $\mcG$-measurable.
Let
$$
	\mcG = \sigma(\{1\}) = \Big\{\{\}, \{1\}, \{2,3,4\}, \{1,2,3,4\}\Big\}.
$$
Then
$$
	X^{-1}(1) = \{1,3\} \not\in \mcG.
$$
Thus $X$ is not $\mcG$-measurable.  However,
$$
	X^{-1}(1) = \{1,3\} \in\mcF
$$
so $X$ is $\mcF$-measurable.

Next, I want to enumerate the subsets $G$ of $\Omega$ such that $X$ is independent of $G$.
We have [xxx xref] $X$ is independent of $G$ if for all $x \in \R$,
$$
	P((X = k) \cap G) = P(X = k) P(G).
$$
For brevity (so that the table below will fit on the page), write
$$
	A_0 = X^{-1}(0)
	\qqand
	A_1 = X^{-1}(1).
$$

Ordered by sizes of $G$'s:

\begin{tabular}{|c|c|c||c||c|c||c|c|c|}
%\hline $G$           & $X^{-1}(0)\cap{G}$ & $X^{-1}(1)\cap{G}$ & $P(G)$ & $P(X^{-1}(0))P(G)$ & $P(X^{-1}(0)\cap{G})$ & $P(X^{-1}(1))P(G)$ & $P(X^{-1}(1)\cap{G})$ & Indep.?      \\
\hline $G$           & $A_0\cap{G}$       & $A_1\cap{G}$       & $P(G)$ & $P(A_0)P(G)$       & $P(A_0\cap{G})$       & $P(A_1)P(G)$       & $P(A_1\cap{G})$       & Indep.?      \\
\hline
\hline $\{\}$        & $\{\}$             & $\{\}$             & $0$    & $0$                & $0$                   & $0$                & $0$                   & \textbf{yes} \\
\hline
\hline $\{1\}$       & $\{\}$             & $\{1\}$            & $1/4$  & $1/8$              & $0$                   & $1/8$              & $1/4$                 & no           \\
\hline $\{2\}$       & $\{2\}$            & $\{\}$             & $1/4$  & $1/8$              & $1/4$                 & $1/8$              & $0$                   & no           \\
\hline $\{3\}$       & $\{\}$             & $\{3\}$            & $1/4$  & $1/8$              & $0$                   & $1/8$              & $1/4$                 & no           \\
\hline $\{4\}$       & $\{4\}$            & $\{\}$             & $1/4$  & $1/8$              & $1/4$                 & $1/8$              & $0$                   & no           \\
\hline
\hline $\{1,3\}$     & $\{\}$             & $\{1,3\}$          & $1/2$  & $1/4$              & $0$                   & $1/4$              & $1/2$                 & no           \\
\hline $\{2,4\}$     & $\{2,4\}$          & $\{\}$             & $1/2$  & $1/4$              & $1/2$                 & $1/4$              & $0$                   & no           \\
\hline $\{1,2\}$     & $\{2\}$            & $\{1\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline $\{1,4\}$     & $\{4\}$            & $\{1\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline $\{2,3\}$     & $\{2\}$            & $\{3\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline $\{3,4\}$     & $\{4\}$            & $\{3\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline
\hline $\{1,2,3\}$   & $\{2\}$            & $\{1,3\}$          & $3/4$  & $3/8$              & $1/4$                 & $3/8$              & $1/2$                 & no           \\
\hline $\{1,2,4\}$   & $\{2,4\}$          & $\{1\}$            & $3/4$  & $3/8$              & $1/2$                 & $3/8$              & $1/4$                 & no           \\
\hline $\{1,3,4\}$   & $\{4\}$            & $\{1,3\}$          & $3/4$  & $3/8$              & $1/4$                 & $3/8$              & $1/2$                 & no           \\
\hline $\{2,3,4\}$   & $\{2,4\}$          & $\{3\}$            & $3/4$  & $3/8$              & $1/2$                 & $3/8$              & $1/4$                 & no           \\
\hline
\hline $\{1,2,3,4\}$ & $\{2,4\}$          & $\{1,3\}$          & $1$    & $1/2$              & $1/2$                 & $1/2$              & $1/2$                 & \textbf{yes} \\
\hline
\end{tabular}

Ordered by independence and dependence:

\begin{tabular}{|c|c|c||c||c|c||c|c|c|}
%\hline $G$           & $X^{-1}(0)\cap{G}$ & $X^{-1}(1)\cap{G}$ & $P(G)$ & $P(X^{-1}(0))P(G)$ & $P(X^{-1}(0)\cap{G})$ & $P(X^{-1}(1))P(G)$ & $P(X^{-1}(1)\cap{G})$ & Indep.?      \\
\hline $G$           & $A_0\cap{G}$       & $A_1\cap{G}$       & $P(G)$ & $P(A_0)P(G)$       & $P(A_0\cap{G})$       & $P(A_1)P(G)$       & $P(A_1\cap{G})$       & Indep.?      \\
\hline
\hline $\{\}$        & $\{\}$             & $\{\}$             & $0$    & $0$                & $0$                   & $0$                & $0$                   & \textbf{yes} \\
\hline $\{1,2\}$     & $\{2\}$            & $\{1\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline $\{1,4\}$     & $\{4\}$            & $\{1\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline $\{2,3\}$     & $\{2\}$            & $\{3\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline $\{3,4\}$     & $\{4\}$            & $\{3\}$            & $1/2$  & $1/4$              & $1/4$                 & $1/4$              & $1/4$                 & \textbf{yes} \\
\hline $\{1,2,3,4\}$ & $\{2,4\}$          & $\{1,3\}$          & $1$    & $1/2$              & $1/2$                 & $1/2$              & $1/2$                 & \textbf{yes} \\
\hline
\hline $\{1\}$       & $\{\}$             & $\{1\}$            & $1/4$  & $1/8$              & $0$                   & $1/8$              & $1/4$                 & no           \\
\hline $\{2\}$       & $\{2\}$            & $\{\}$             & $1/4$  & $1/8$              & $1/4$                 & $1/8$              & $0$                   & no           \\
\hline $\{3\}$       & $\{\}$             & $\{3\}$            & $1/4$  & $1/8$              & $0$                   & $1/8$              & $1/4$                 & no           \\
\hline $\{4\}$       & $\{4\}$            & $\{\}$             & $1/4$  & $1/8$              & $1/4$                 & $1/8$              & $0$                   & no           \\
\hline $\{1,3\}$     & $\{\}$             & $\{1,3\}$          & $1/2$  & $1/4$              & $0$                   & $1/4$              & $1/2$                 & no           \\
\hline $\{2,4\}$     & $\{2,4\}$          & $\{\}$             & $1/2$  & $1/4$              & $1/2$                 & $1/4$              & $0$                   & no           \\
\hline $\{1,2,3\}$   & $\{2\}$            & $\{1,3\}$          & $3/4$  & $3/8$              & $1/4$                 & $3/8$              & $1/2$                 & no           \\
\hline $\{1,2,4\}$   & $\{2,4\}$          & $\{1\}$            & $3/4$  & $3/8$              & $1/2$                 & $3/8$              & $1/4$                 & no           \\
\hline $\{1,3,4\}$   & $\{4\}$            & $\{1,3\}$          & $3/4$  & $3/8$              & $1/4$                 & $3/8$              & $1/2$                 & no           \\
\hline $\{2,3,4\}$   & $\{2,4\}$          & $\{3\}$            & $3/4$  & $3/8$              & $1/2$                 & $3/8$              & $1/4$                 & no           \\
\hline
\end{tabular}

\mendex
