How to calculate mean for standard deviation

127 Views Asked by At

I've been doing some standard deviation revision but I'm getting confused as different questions have the mean calculated differently.

In some questions, the mean squared is calculated as the actual $mean^2$

so if the mean was $5$ then the mean squared is $25$.

but some others have it calculated where the actual mean is ignored and instead the top half of the fraction for calculating the mean is squared

for example $126^2/12$ rather than $(126/12)^2$

So when is each one used? Is this different for when calculating for frequency tables and lists of data? $$\frac{\sqrt{\sum x^2-n\bar{x}^2}}{n-1}$$