In a book I was reading, it seemed to imply that $E(X-E(X))=0$. My intuition tells me this is true, because if $E(X)$ is the "centre", then the average displacement from this centre should be 0. However, can someone show me a formal proof (assuming it is true)?
-
3Yes, use aditivitty of the expected value and E(E(X)) = E(X) – PenasRaul Sep 05 '14 at 20:38
5 Answers
It is true by the linearity of expectation:
$$E(X - E(X)) = E(X) - E(E(X))$$
Since $E(X)$ is a constant $E(E(X))$ is just $E(X)$ and therefore $E(X) - E(E(X)) = 0$

- 1,332
-
Thank you. What confused me when I was trying to derive this is E(E(X)). In my mind I was thinking E(X) is a function of X, but of course it's a constant. – someguy Sep 05 '14 at 20:43
Expectations are additive: $$E(A+B) = E(A) + E(B)$$
So in particular, $$\begin{align}E(X-E(X)) &= E(X) - E(E(X))\\ & = E(X) - E(X)\\ &= 0.\end{align}$$ where the second line follows because $E(X)$ is a constant and $E(C) = C$ for constants.

- 65,394
- 39
- 298
- 580
$$ \mathbb{E}(X-\mathbb{E}(X)) = \mathbb{E}(X) - \mathbb{E}(\mathbb{E}(X)) = \mathbb{E}(X) - \mathbb{E}(X) = 0.$$
Or even $$ \mathbb{E}(X-\mathbb{E}(X))^2 = \mathbb{E}((X-\mathbb{E}(X)^2) - \mbox{Var}(X-\mathbb{E}(X)) = \mbox{Var}(X) - \mbox{Var}(X) = 0. $$

- 16,073
-
The second option requires the assumption that $E[X^2]< \infty$, while the statement that $E[X-E[X]] = 0$ only requires $E[X]$ exist (i.e. $E[|X|] < \infty$) [$E[X^2]<\infty$ obviously implies $E[X]$ exists]. So if I were grading the question, I'd probably dock points for the second answer. – Batman Sep 05 '14 at 21:10
Yes, it's true in general by linearity of expectations.
But as an illustration, consider the discrete, finite case with $n$ values: $X=\{x_1,x_2,\dots,x_n\}$ each occurring with equal probability.
Then
$$ E(X)=\dfrac{1}{n} \sum_{i=1}^{n} x_i $$
and
$$ E(X-E(X))=\dfrac{1}{n}\sum_{j=1}^{n}\left(x_j-\dfrac{1}{n}\sum_{i=1}^{n}x_i \right)=\dfrac{1}{n}\left(\sum_{j=1}^{n}x_j - \sum_{i=1}^n x_i\right)=0 $$
In the last step we have moved the sum over $i$ outside the sum over $j$, because the former does not depend on $j$. We need to multiply the $\sum_i$ term by $n$, however, as $\sum_j$ has $n$ terms. This $n$ cancels out with the $1/n$ associated with the $\sum_i$ term.

- 9,636
-
-
-
Right, the average of a a set of numbers is as you defined it, but the expected value is not necessarily an average that gives each value the same weight. E(X) is not quite how you defined it. You are correct that E(X) is how you defined it ONLY IF each value of x has an equal probability of being drawn, since then Pr(xi)=1/n like you defined it. In other words, the way you used E(X) is a special case of the more general definition of E(X) with a general density f(x). http://en.wikipedia.org/wiki/Expected_value – candido Sep 06 '14 at 03:25
-
@candido Yes yes, I know, and I agree with everything you said. I just wanted to give the OP an illustration for the simplest possible case, that's all :) – MGA Sep 06 '14 at 04:31
-
-
@candido No worries. I've taken your suggestion and added "each occurring with equal probability" in an edit to be more precise. – MGA Sep 06 '14 at 04:37
More Generally, note that for a random variable (r.v.) X can have a discrete distribution with probabilities that X can take a certain value x is P(X=x) (the probability mass function), a continuous distribution, where X has a continuous probability density function f(x) (or a mixture for a set of domains). If X is wholly discrete f(x) is zero for all x, likewise a fully continuous r.v. means P(X=x) = 0 for all x.
$$E(X) = \sum_{x=0}^\infty xP(X=x) + \int_0^\infty xf(x) \;\mathrm{dx}$$
Which means
$$E(X-E(X)) = \sum_{x=0}^\infty \left(x- \left[\sum_{x=0}^\infty xP(X=x) + \int_0^\infty xf(x) \;\mathrm{dx}\right]\right)P(X=x) + \int_0^\infty \left(x-\left[\sum_{x=0}^\infty xP(X=x) + \int_0^\infty xf(x) \;\mathrm{dx}\right]\right)f(x) \;\mathrm{dx}$$
This may seems like overkill BUT you can then just follow the algebra without quoting presumed theorems (linearity of Expectation etc) - which can easily be derived anyway...

- 11
-
Why do you exclude "$+$" and "$=$" from your MathJax code?? (I corrected it.) – Michael Hardy Sep 05 '14 at 22:55
-
-
The difference is huge if you do it with a minus sign: $\displaystyle\int f(x),dx-\int g(x),dx$ versus $\displaystyle\int f(x),dx$-$\int g(x),dx$ ${}\qquad{}$ – Michael Hardy Sep 06 '14 at 16:11