The task seems simple, yet I still get absurd results. And I can't find my mistake.
For given $n$ and $x_i$, $1\leq i \leq n$ let $X_i=\begin{cases}x_i&\text{with probality}\ \frac12\\-x_i&\text{with probality}\ \frac12\end{cases}$
Let $X=\left(X_1+X_2+\cdot+X_n\right)^2=\left(\sum_{i=1}^nX_i\right)^2$
Compute $\mathrm{E}X$ and $\mathrm{SD}X$
Howerver hard I try to find my error I consistently get $\mathrm{Var}X=\mathrm{SD}X=0$ which seems absurd to me.
Here is how I'm doing it.
Clearly:
$\mathrm{E}X_i=0$
$\mathrm{E}\left(X_i\right)^2=x_i^2$
$\mathrm{E}\left(X_i\right)^3=0$
$\mathrm{E}\left(X_i\right)^3=x_i^4$
Now $\mathrm{E}X = \mathrm{E}\left(\sum_{i=1}^n X_i\right)^2 = \mathrm{E}\left(\sum_{i,j=1}^nX_iX_j\right)=\sum^n_{i,j=1}\mathrm{E}\left(X_iX_j\right)$
In the above sum when $i\neq j$ we have $\mathrm{E}\left(X_iX_j\right)=\left(\mathrm{E}X_i\right)\left(\mathrm{E}X_j\right)=0$ since $X_i$ and $X_j$ are independent. On the other hand, when $i=j$, we have $ \mathrm{E}\left(X_iX_j\right)=\mathrm{E}\left(X_i^2\right)=x_i^2$
Therefore $ \mathrm{E}X=\sum_{i=1}^nx_i^2$.
Now $ \mathrm{Var}X=\mathrm{E}\left(X^2\right)-\left(\mathrm{E}X\right)^2$
$ \left(\mathrm{E}X\right)^2$ is easy: $ \left(\mathrm{E}X\right)^2=\left(\sum_{i=1}^nx_i^2\right)^2=\sum_{i,j=1}^nx_i^2x_j^2$
$ \mathrm{E}\left(X^2\right)$ is not too hard either:
$ \mathrm{E}\left(X^2\right)=\mathrm{E}\left(\left(\sum_{i=1}^n X_i\right)^2\right)^2=\mathrm{E}\left(\sum_{i=1}^n X_i\right)^4=\mathrm{E}\left(\sum_{i,j,k,l=1}^nX_iX_jX_kX_l\right)=\sum_{i,j,k,l=1}^n\mathrm{E}\left(X_iX_jX_kX_l\right)$
As above the only non-zero terms are of this kind: $\mathrm{E}X_i^4$ or of this kind: $\mathrm{E}\left(X_i^2X_j^2\right)$ Therefore $ \mathrm{E}\left(X^2\right)=\sum_{i,j,k,l=1}^n\mathrm{E}\left(X_iX_jX_kX_l\right)=\sum_{i,j=1}^nx_i^2x_j^2$
So in the end $\mathrm{SD}X=\sqrt{\mathrm{Var}X}=\sqrt{\sum_{i,j=1}^nx_i^2x_j^2-\sum_{i,j=1}^nx_i^2x_j^2}=\sqrt0=0$!!!
Which seems nonsesne to me since $X$ is clearly FAR from constant.
How can $\mathrm{SD}X=\mathrm{Var}X=0$?? Or where is my mistake? Been thinking on this weird problem for a day already.
For a fixed pair $\langle r, s\rangle\in\{1,\dots,n\}^2$ with $r\neq s$ among the elements of $\{1,\dots,n\}^4$ there are exactly $\binom42=6$ tuples that contain both $r$ and $s$ twice.