Counterexample for a statement about independence of random variables Assume X, Y : Ω → $\Bbb R$ are random variables, defined on a common probability
space (Ω, $\mathscr{F}$, $ \Bbb P$). If we want to prove X and Y are independent, can we just check that the generators {{X ∈ A} : A ∈ $\mathscr{A}$} and {{Y ∈ B} : B ∈$ \mathscr{E}$}
are independent as systems, where $σ(\mathscr{A}) = σ(\mathscr{E}) = \mathscr{B} $ and $\mathscr{B}$ is the Borel σ-algebra? I guess the answer is no, because in general cases, the generators need to be closed under intersection. But I cannot find a counterexample. Please help, thanks.
 A: This seems to be a counterexample (inspired by Bernstein's example). Consider a probability space $\Omega=\{0,1,2,3\}$ (all sets are measurable and all elementary outcomes are equiprobable).
Random variables are $X(\omega)=\omega$ and $Y(\omega)=\begin{cases}1, \ \omega \mbox{ is even} \\ 0, \ \omega \mbox{ is odd} \end{cases}.$ 
As a first generating system for $\mathcal{B}$ (corresponding to $X$) we choose 
$$
\mathcal{A}=\{A\in \mathcal{B}:(\{0,1\}\in A \mbox{ and } \{2,3\}\in A^c) \mbox{ or } (\{1,2\}\in A \mbox{ and } \{0,3\}\in A^c) \}.
$$
As a second generating system for $\mathcal{B}$ (corresponding to $Y$) we choose the Borel $\sigma-$field $\mathcal{B}$ itself. 
Let us check that $\mathcal{A}$ generates $\mathcal{B}.$ Note that 
$$
\{0,1\}\in \mathcal{A}, \{1,2\}\in\mathcal{A}.
$$
Then 
$$
\{1\}=\{0,1\}\cap\{1,2\}\in \sigma(\mathcal{A}).
$$
It follows that one point sets $\{0\},\{1\},\{2\}$ belong to $\sigma(\mathcal{A}).$ Now, if $B$ is a Borel set and $3\not\in B,$ then
$$
\tilde{B}=(B\setminus \{0,1,2\})\cap \{0,1\}\in\mathcal{A}
$$
Starting from the set $\tilde{B}$ we can add or remove singletons $\{0\},\{1\},\{2\}$ and stay in $\sigma(\mathcal{A}).$ Clearly, performing these operations we will get $B,$ so $B\in\sigma(\mathcal{A}).$ If $3\in B,$ then $3\not\in B^c$ and $B^c\in\sigma(\mathcal{A}).$ It follows that $\mathcal{A}$ generates $\mathcal{B}.$ 
Now, let $A\in\mathcal{A}$ be such that $\{0,1\}\in A.$ Then
$$
P(X\in A, Y=1)=P(\{\omega\in\{0,1\}:\omega \mbox{ is even}\})=P(\{0\})=\frac{1}{4}
$$
Let $A\in\mathcal{A}$ be such that $\{1,2\}\in A.$ Then
$$
P(X\in A, Y=1)=P(\{\omega\in\{1,2\}:\omega \mbox{ is even}\})=P(\{2\})=\frac{1}{4}
$$
Independence condition holds for all sets from generating families. However, $X$ and $Y$ are dependent, as 
$$
P(X=1,Y=1)=0\ne P(X=1)P(Y=1)
$$
