Calculating sample variance. This question is part of another question and the solution skips over how the value of the variance is found and I can't figure out how the variance was obtained for the rest of the question.
We are given a sample of 15 heights of people $X_1, X_2, ... , X_{15}$ in metres.
Also given $\sum \limits_{i=1}^{15}x_i = 26.7$, and $\sum \limits_{i=1}^{15}x_i^2 = 173.526$
The solution says that $\overline{x}=1.78$, and $S^2 = 9$.
I think that $S^2 = \dfrac{1}{14}\sum \limits_{i=1}^{15}(x_i-1.78)^2$ but I can't figure out what $x_i$ is supposed to be to get $9$.
Thanks.
 A: The sample variance is
$$\hat\sigma^{2}=\frac1n\sum \limits_{i=1}^{n}x_i^2-\left(\frac1n\sum \limits_{i=1}^{n}x_i\right)^2=\frac1{15}\cdot 173.526-\left(\frac1{15}\cdot26.7\right)^2$$
This formula is related to $$Var(X)=E(X^2)-[E(X)]^2$$
But the  $\texttt{unbiased}$ estimator for the variance of the population is
$$s^2=\frac{n}{n-1}\cdot \hat \sigma^2=\frac{15}{14}\cdot\hat \sigma^2$$
A: By definition $S^2=\dfrac{1}{n-1}\sum_{i=1}^{n}(x_{i}-\bar{x})^2$. The expression $\sum_{i=1}^{n}(x_{i}-\bar{x})^2$ can be simplified to $\sum_{i=1}^{n}x_{i}^{2}-n\bar{x}^2$ or $\sum_{i=1}^{n}x_{i}^{2}-\dfrac{(\sum_{i=1}^{n}x_{i})^2}{n}$ . 
So, the definition of $S^{2}$ simplifies to 
\begin{equation*}
S^2 = \dfrac{1}{n-1}\sum_{i=1}^{n}x_{i}^{2}-\dfrac{(\sum_{i=1}^{n}x_{i})^2}{n(n-1)}
\end{equation*}
Substituting the given values, we get the required value.
A: Yes, you are right, but $n=15$. So it should be, $S^2 = \dfrac{1}{15}\sum \limits_{i=1}^{15}(x_i-1.78)^2$.
The formula for variance without frequency,
\begin{align*}
S^2&=\dfrac{1}{n}\sum_{i=1}^n\left(x_i-\bar x\right)^2\\
&=\dfrac{1}{n}\sum_{i=1}^n\left(x_i^2-2\cdot x_i\cdot\bar x+{\bar x}^2\right)\\
&=\dfrac{1}{n}\sum_{i=1}^nx_i^2-2\bar x\cdot\dfrac{1}{n}\sum_{i=1}^nx_i+{\bar x}^2\cdot\dfrac{1}{n}\sum_{i=1}^n1\hspace{20pt}\left[\text{ as, mean}=\bar x=\dfrac{1}{n}\sum_{i=1}^nx_i\right]\\
&=\dfrac{1}{n}\sum_{i=1}^nx_i^2-2\bar x\cdot\bar x+{\bar x}^2\cdot\dfrac{1}{n}\cdot n\\
&=\dfrac{1}{n}\sum_{i=1}^nx_i^2-2{\bar x}^2+{\bar x}^2\\
\implies S^2&=\dfrac{1}{n}\sum_{i=1}^nx_i^2-{\bar x}^2
\end{align*}
or you can write, $$S^2=\dfrac{1}{n}\sum_{i=1}^nx_i^2-{\left(\dfrac{1}{n}\sum_{i=1}^nx_i\right)}^2\\
\implies S^2=\dfrac{1}{15}\times173.526-\left(\dfrac{1}{15}\times26.7\right)^2=8.4$$
