Let $X$ and $Y$ have joint distribution defined by $f(0,0) = 1 − 3a$ and $f(0, 1) = f (1,0) = f (1,1) = a$ where $a \leq 1/3$. Find:
(a) The p.m.f.s of $X$ and $Y$
(b) $\textbf{Cov}(X,Y)$
(c) $\textbf{E}(X|Y)$ and $\textbf{E}(Y|X)$
(d) Whether $X$ and $Y$ can be independent, and if so, when.
MY ATTEMPT
(a) According to the definition of marginal probability mass function, we have \begin{cases} f_{X}(0) = \displaystyle\sum_{y=0}^{1}f(0,y) = f(0,0) + f(0,1) = 1 - 3a + a = 1 - 2a\\ f_{X}(1) = \displaystyle\sum_{y=0}^{1}f(1,y) = f(1,0) + f(1,1) = a + a = 2a \end{cases}
Analogously, we have
\begin{cases} f_{Y}(0) = \displaystyle\sum_{x=0}^{1}f(x,0) = f(0,0) + f(1,0) = 1 - 3a + a = 1 - 2a\\ f_{Y}(1) = \displaystyle\sum_{x=0}^{1}f(x,1) = f(0,1) + f(1,1) = a + a = 2a \end{cases}
(b) Since $\textbf{E}(X) = 0\cdot(1-2a) + 1\cdot 2a = 2a$, $\textbf{E}(Y) = 0\cdot(1-2a) + 1\cdot 2a = 2a$ and $\textbf{E}(XY) = 1\cdot a = a$, we conclude that $\textbf{Cov}(X,Y) = a - 4a^{2} = a(1-4a)$
(c) According to the definition of conditional expectation \begin{align*} \textbf{E}(X|Y = 0) = \sum_{x=0}^{1}\frac{x\cdot f_{X,Y}(x,0)}{f_{Y}(0)} = \frac{f_{X,Y}(1,0)}{f_{Y}(0)} = \frac{a}{1-2a} \end{align*}
In a similar fashion, we have
\begin{align*} \textbf{E}(X|Y = 1) = \sum_{x=0}^{1}\frac{x\cdot f_{X,Y}(x,1)}{f_{Y}(1)} = \frac{f_{X,Y}(1,1)}{f_{Y}(1)} = \frac{1}{2} \end{align*}
The same idea applies to $\textbf{E}(Y|X)$:
\begin{align*} \textbf{E}(X|Y = 0) = \sum_{x=0}^{1}\frac{x\cdot f_{X,Y}(x,0)}{f_{Y}(0)} = \frac{f_{X,Y}(1,0)}{f_{Y}(0)} = \frac{a}{1-2a} \end{align*}
Analogously, we proceed as it follows
\begin{align*} \textbf{E}(Y|X = 1) = \sum_{y=0}^{1}\frac{y\cdot f_{X,Y}(1,y)}{f_{X}(1)} = \frac{f_{X,Y}(1,1)}{f_{X}(1)} = \frac{1}{2} \end{align*}
(d) $X$ and $Y$ are not independet, since $f(0,0) = 1 - 3a \neq (1-2a)^{2} = f_{X}(0)f_{Y}(0)$. However they are independent when $\textbf{Cov}(X,Y) = 0$, that is to say $a = 0$ or $a = 1/4$. Once $a \leq 1/3$, both solutions are valid.
Here, I just ask for a double check of my results. If there is any conceptual mistake, I would be glad to know. Thanks in advance!
EDIT
Due to Falrach's comment, I realized the misapplication of the ''Covariance test''. In fact, $X$ and $Y$ are independent when $f_{X,Y} = f_{X}f_{Y}$. This happens if and only if
\begin{cases} (1-2a)^{2} = 1 - 3a\\\\ 2a(1-2a) = a\\\\ 4a^{2} = a\\ \end{cases}
That is to say: $X$ and $Y$ are independent when $a = 0$.