# Cov(W,Z) where W=X and Z = aX+Y

1. Oct 10, 2014

### Dustinsfl

1. The problem statement, all variables and given/known data
If $X$ and $Y$ have a covariance of $cov(X, Y)$, we can transform them to a new pair of random variables whose covariance is zero. To do so, we let
\begin{align*}
W &= X\\
Z &= aX + Y
\end{align*}
where $a = -cov(X, Y)/var(X)$. Show that $cov(W, Z) = 0$.

2. Relevant equations
$var(X) = E[X^2] - E^2[X]$
$cov(X, Y) = E[XY] - E[X]E[Y]$

3. The attempt at a solution
SOLVED

\begin{align*}
cov(W, Z) &= E[(W - E[W])(Z - E[Z])]\\
&= E\big[WZ - ZE[W] - WE[Z] + E[W]E[Z]\big]\\
&= E[aX^2 + XY] - E[X]E[aX + Y]\\
&= aE[X^2] + E[XY] - aE^2[X] - E[X]E[Y]\\
&= \frac{-cov(X, Y)}{var(X)}E[X^2] +
\frac{cov(X, Y)}{var(x)}E^2[X] + E[XY] - E[X]E[Y]\\
&= cov(X, Y)\bigg[\frac{E[X^2] + E^2[X]}{E[X^2] - E^2[X]}
+ 1\bigg]
\end{align*}

$$avar(X) + cov(X, Y) = aE[X^2] + E[XY] - aE^2[X] - E[X]E[Y]$$
So I found the error

Last edited: Oct 10, 2014
2. Oct 10, 2014

### Ray Vickson

It is often easier and faster to use the well-known result
$$\text{Cov}(S,T) = E(ST) - (ES)(ET)$$
for any random variables $S,T$ having finite first and second moments.