
Question about variance.
Its a well known fact that
Var(X) = E(X^2)  (E(X))^2
but then can you conclude:
Var(X) = E(X^2)  (E(X))^2 = E(X^2)  E( E(X) X ) (because E(X) is a scalar)
= E[X^2  E(X) X ] = E[ X ( X  E(X) ) ]
by linearity of expectation.
but also Var(X) = E[ (X E(X))^2 ]
a contradiction no?
Clearly I must be doing something wrong?

It is true that $\displaystyle E[ X ( X  \mu) ]=E(X^2X\mu)=E(X^2)\mu^2=V(X)$
It's just like $\displaystyle \sum_{i=1}^n(x_i\bar x)(y_i\bar y) =\sum_{i=1}^nx_i(y_i\bar y)=\sum_{i=1}^n(x_i\bar x)y_i$