Alternative formula for covariance

248 Views Asked by At

I have a basic question on the covariance formula. Consider two random variables $X,Z$ with well defined first moment. Hence,

$$ (\star) \hspace{1cm}cov(X,Z)\equiv E\Big[(X-E(X) (Z-E(Z))\Big]=E(XZ)-E(X)E(Z) $$

Is it true that this is equivalent to $$(\diamond) \hspace{1cm}E\Big[X (Z-E(Z))\Big]$$

It seems to me yes, but I'm asking since I've always found $(\star)$ and never found $(\diamond)$.


Indeed, $$ E\Big[(X-E(X) (Z-E(Z))\Big]=E\Big[X(Z-E(Z)) \Big]-\underbrace{E\Big[E(X)(Z-E(Z)) \Big]}_{= E(X)E(Z-E(Z))=E(X)(E(Z)-E(Z))=0}=E\Big[X (Z-E(Z))\Big] $$

Correct?