How do you prove Cov $\left( \bar{X} , X_i - \bar{X} \right) = 0$?

How do you prove Cov $\left( \bar{X} , X_i - \bar{X} \right) = 0$ given $ X_1 ,..., X_i$ are i.i.d. each with variance $\sigma^2$ and $\bar{X}$ is the sample mean?? In other words, how do you show that the sample mean and the differences of the observations from that mean are not linearly correlated???

Am I on the write track? I've written

$Var \left( \bar{X} + \left( X_i - \bar{X} \right) \right) = Var X_i = Var \bar{X} + Var \left( X_i - \bar{X} \right) + Cov \left( \bar{X} , X_i - \bar{X} \right)$ .

I know $Var X_i = \sigma^2 , Var \bar{X}= \frac{\sigma^2}{n}$, so all I need left to find the covariance is $Var \left( X_i - \bar{X} \right)$.

I don't know if this is right, but I wrote

$Var \left( X_i - \bar{X} \right) = E\left( \left( \left( X_i - \bar{X} \right) - \mu_{ X_i - \bar{X}} \right)^2 \right)=E \left( \left( X_i - \bar{X} \right)^2 \right)=s^2$, but I don't know if that's right or helpful at all.

Am I on the right track??


Hint: Use properties of the covariance function and independence of $X_1,...,X_n$.

Solution:

Note that $$ Cov(\bar{X},X_i-\bar{X}) = Cov(\bar{X},X_i)-Cov(\bar{X},\bar{X}) = Cov(\bar{X},X_i)-Var(\bar{X}) $$

You know that $Var(\bar{X})=\frac{\sigma^2}{n}$. So you need to find $Cov(\bar{X},X_i)$. But,

$$ Cov(\bar{X},X_i)= Cov(\frac{1}{n}\sum_{j=1}^{n}X_j,X_i) = \frac{1}{n} \sum_{j=1}^{n} Cov(X_j,X_i) $$ Since $X_j$'s are independent it follows that $$Cov(X_j,X_i)=0 \text{ for all j } \neq i $$

So we conclude that $$ Cov(\bar{X},X_i) = \frac{1}{n} Cov(X_i,X_i) = \frac{\sigma^2}{n} $$

It follows that $$Cov(\bar{X},X_i-\bar{X}) = 0$$