How to find $\sum (t-\bar{t})^2$ Given that $n=150$, $\sum t=645$ and $\sum t^2=8287.5$.
How to find $\sum (t-\bar{t})^2$ where $\bar{t}$ denotes the mean of $t$.
 A: Hint : For a random variable $X$, the variance $Var(X)$ can be calculated as
       follows:
$$Var(X)=E(X^2)-E(X)^2$$
A: $$
\sum(t-\bar{t})^2 =\sum t^2 - n\bar{t}^2=\sum t^2 - \frac{(\sum t)^2}{n} = 8287.5-\frac{645^2}{150}=5514
$$
*$\sum(t-\bar{t})^2 = \sum(t^2-2t\bar{t}+\bar{t}^2)=\sum t^2 - 2\bar{t}\sum t+\sum \bar{t}^2=\sum t^2 - 2n\bar{t}^2+n\bar{t}^2=\sum t^2-n\bar{t}^2$
A: Use the fact that $\bar{t} = \frac1n \sum t$ is constant.
\begin{align}
\sum(t-\bar{t})^2 & = \sum (t^2 - 2t \bar{t} +\bar{t}^2)\\
& = (\sum t^2) - (2\bar{t} \sum t) + (\bar{t}^2 \sum 1)\\
& = \sum t^2 - 2\frac1n (\sum t) (\sum t) +  (\frac1n\sum t)^2n \\
& = \sum t^2 - \frac2n (\sum t)^2 +  \frac1n(\sum t)^2\\
& = \sum t^2 - \frac1n (\sum t)^2 
\end{align}
Now plug in the values.
A: If you wanted to calculate the mean square error:
\begin{align}
\sum{\left(t - \overline{t}\right)^2} &= \sum t^2 - {{1}\over{n}}\left({\sum t}\right)^2 \\
&= 8287.5 - {{1}\over{150}}(645)^2 \\
&= 5514
\end{align}
Derivation:
\begin{align}
\sum_{i=1}^n \left(t_i - \overline{t}\right)^2 
&= \sum_{i=1}^n \left(t_i^2 - 2\,t_i\,\overline{t} + \overline{t}^2\right)\\
&= \sum_{i=1}^n t_i^2 - 2\,\overline{t} \sum_{i=1}^n t_i + n\,\overline{t}^2\\
&= \sum_{i=1}^n t_i^2 - 2\,n\,\overline{t}^2 + n\,\overline{t}^2\\
&= \sum_{i=1}^n t_i^2 - n\,{\overline{t}}^2\\
&= \sum_{i=1}^n t_i^2 - n\,\left({{1}\over{n}}{\sum_{i=1}^n t_i}\right)^2 \\
&= \sum_{i=1}^n t_i^2 - {{1}\over{n}}\left({\sum_{i=1}^n t_i}\right)^2 \\
\end{align}
