# Let $X_1, \ldots , X_n$ be independent random variables having a common density with mean $\mu$ and variance $\sigma^2$, where

Let $$X_1, \ldots , X_n$$ be independent random variables having a common density with mean $$\mu$$ and variance $$\sigma^2$$, where $$\bar{X}=\frac1n\sum^n_{k=1}X_k$$. Calculate $$\operatorname{Cov}(\bar{X}, X_k-\bar{X})$$

Attempt

$$\operatorname{Cov}(\bar{X}, X_k-\bar{X})=\operatorname{Cov}(\bar{X}, X_k)-\operatorname{Cov}(\bar{X},\bar{X})=\operatorname{Cov}(\bar{X}, X_k)-\operatorname{Var}(\bar{X})$$

However,

$$\operatorname{Cov}(\bar{X}, X_k)=E(\bar{X}X_k)-E(\bar{X})E(X_k)$$

According to me, you have

$$E(X_k)=\mu, E(\bar{X})=\mu, \operatorname{Var}(\bar{X})=\frac{\sigma^2}{n}$$

So, how do I calculate $$E(\bar{X}X_k)$$?, should I use the fact that they are independent variables?

Edit

$$E[\bar{X}X_k] = E\left[\frac{1}{n} \sum_{i=1}^n X_i X_k\right] = \frac{1}{n} \sum_{i=1}^n E[X_i X_k] =\frac{\sigma^2}{n}+\mu^2?$$

$$\bar{X}$$ and $$X_k$$ are not independent since they both involve $$X_k$$. Expand $$\bar{X}$$ and proceed.
$$E[\bar{X}X_k] = E\left[\frac{1}{n} \sum_{i=1}^n X_i X_k\right] = \frac{1}{n} \sum_{i=1}^n E[X_i X_k] = \cdots$$
• Is it $\mu^2/n$?
• or is it $(\sigma^2/n)+\mu^2$?