If $E[Y|X]=a$ for some constant $a\neq 0$, then does $cov(X,Y)=0$? I'm currently working on the following problem:
Q:   If $E[Y|X]=a$ for some constant $a\neq 0$, then does $cov(X,Y)=0$?
Now I am quite lost as to how to do this problem as the question does not specify the distribution of $X$ or $Y$. 
Also, I'm just curious, if $a=0$, does that imply that $corr(X,Y)=0$ as well?
Many thanks!
 A: First, note that $E(Y)=E(E(Y|X))=E(a)=a$. Then by definition of Covariance, we have
\begin{eqnarray}
Cov(X,Y)&=&E(XY)-E(X)E(Y)\\
&=&E[E(XY|X)]-E(X)E[E(Y|X)]\\
&=&E[XE(Y|X)]-E(X)E(a)\\
&=&E[Xa]-E(X)a\\
&=&aE(X)-E(X)a\\
&=&0
\end{eqnarray}
A: First, let us take a look at the general case, and then we can specialize
to address your questions.
The random variable $E[Y\mid X]$ is a function of $X$, call it $g(X)$, 
that
enjoys the property that it is the minimum mean-square-error estimator
(MMSE estimator) of $Y$ given $X$. In general, $g(x)$ is not of the form
$a+bx$ which is commonly referred to as a linear
function (though affine function of $x$ might be a better description
of $a+bx$).  Now,
the linear minimum mean-square estimator (LMMSE estimator)
of $Y$ given $X$ is of 
the form $a+bX$ where 
$$b = \rho\frac{\sigma_Y}{\sigma_X}, \quad a 
= \mu_Y - \rho\frac{\sigma_Y}{\sigma_X}\mu_Y\tag{1}$$
where $\rho$ is the (Pearson) correlation coefficient of $X$ and $Y$.
As a general rule, the residual mean square error of $E[Y\mid X]$ is
smaller than the residual mean square error of $a+bX$, that is,
$$E\left[\left(Y-E[Y\mid X]\right)^2\right]
\leq E\left[\left(Y-(a+bX)\right)^2\right].$$
Turning to your question, you are told that $E[Y\mid X] = a$, that
is, $g(X)$ is a degenerate random variable (often called a
constant by statistically illiterate people) that takes on
value $a$ with probability $1$. Thus, $g(x)=a$ is
a linear function of $x$ (in fact, a constant function of $x$)
and in this case, the MMSE estimator and the LMMSE estimator
coincide.  From $(1)$ we conclude that $b = 0$ which in most
interesting cases means that $\rho$ equals $0$ (we ignore
the possibility that $\sigma_Y = 0$ and $Y$ being a degenerate
random variable). Thus, the
covariance of $X$ and $Y$: $\operatorname{cov}(X,Y)$ equals $0$.  It is not necessary
to insist that $a \neq 0$ in order for all this to hold; indeed
from $(1)$ we see that when $\rho = 0$, $a$ equals $\mu_Y$, the
mean of $Y$.
