I was studying for a test when I found the following formula for sample variance in my textbook:
$s^2\text{ can also be expressed in this way:}$ $$s^2 = \frac{1}{n-1}(\sum_{i=1}^n x_i^2 - n\overline{x})$$
I tried searching for this formula on the Internet, but I couldn't seem to find anything. I'm don't understand how that formula was derived from $s^2 = \frac{1}{n-1}\sum_{i=1}^n(x_i - \overline{x})^2$ either. Is the above formula correct at all?