# Thread: How to simplify this sample mean expression?

1. ## How to simplify this sample mean expression?

${1 \over n}\sum_{i=1}^{n} {X_i}^2 - ({1 \over n} \sum_{i=1}^{n} {X_i})^2$

2. There is not much "simplification" to be done, but you may want to write one of the following:

${1 \over n}\sum_{i=1}^{n} {X_i}^2 - ({1 \over n} \sum_{i=1}^{n} {X_i})^2
= {1\over n}\sum_{i=1}^n \left(X_i - \frac{1}{n}\sum_{j=1}^n X_j\right)^2
$

(which you get by expanding to square in the right-hand side into $X_i^2 - 2X_i{1\over n}\sum_{j=1}^n X_j + \left({1\over n}\sum_{j=1}^n X_j\right)^2$). It is the other expression for the empirical variance.

or:

${1 \over n}\sum_{i=1}^{n} {X_i}^2 - ({1 \over n} \sum_{i=1}^{n} {X_i})^2
= {1\over n}\sum_{i=1}^n X_i^2 - {1\over n^2}\sum_{1\leq i, j\leq n}X_iX_j$
$={1\over n}\sum_{i=1}^n X_i^2 - {1\over n^2}\sum_{i=1}^n X_i^2 - {1\over n^2}\sum_{1\leq i\neq j\leq n} X_iX_j = \left(\frac{1}{n}-\frac{1}{n^2}\right)\sum_{i=1}^n X_i^2 - \frac{2}{n^2} \sum_{1\leq i
(which is the expansion of the square of the sum. In the last expression, every product $X_iX_j$ appears exactly once)

I hope it answers you question.
Laurent.

3. Originally Posted by chopet
${1 \over n}\sum_{i=1}^{n} {X_i}^2 - ({1 \over n} \sum_{i=1}^{n} {X_i})^2$
This is sample mean square minus the square sample mean, which is the sample variance.

RonL