# Are the linear combinations of iid random variables independent?

Suppose $X_1, X_2, ... , X_n$ are independently and identically distributed random variables.

Let $\bar{X} = \frac{1}{n} \sum_{i=1} ^{n} X_i$. Are $\bar{X}$ and $X_1 - \bar{X}$ independent?

I realize that this is true if $X_1, X_2, ... , X_n$ are i.i.d. normal. However, does it work for the general case?

I have tried to prove (or disprove) this using moment generating functions. But I always end up with a very messy mgf.

Before I conclude that since the joint mgf of $\bar{X}$ and $X_1 - \bar{X}$ cannot be expressed as the product of both mgf, therefore they are both independent, I am worried that I may be missing something.

Can someone please help me out?

• Your notation is confusing. You have an $X$ and you have some $X_i$. The sum $\sum_{i=1}^nX=nX$, no? What did you mean? – lulu Oct 4 '17 at 12:49
• @lulu sorry, I have updated the question. Thanks for pointing that out – dzl Oct 4 '17 at 12:50
• They aren't independent even for normal distribution (unless you meant $\bar{X} = \frac1n\sum_{i=1} ^{n} X_i$, as the usual definition of a sample mean would suggest). – Professor Vector Oct 4 '17 at 12:58
• @HenningMakholm Right, thanks. Will edit. – lulu Oct 4 '17 at 12:58
• @HenningMakholm Actually, just deleting my comment as your posted solution actually did the calculation correctly. – lulu Oct 4 '17 at 13:00

## 1 Answer

Suppose $n=2$ and each $X_i$ is a random bit, uniformly distributed on $\{0,1\}$.

Then $\bar X = \frac12(X_1+X_2)$ and $X_1-\bar X=\frac12(X_1-X_2)$ are certainly not independent -- for example because if we know that $\bar X=0$, then necessarily $X_1-\bar X$ will be $0$ too.