# Calculating sample variance

Suppose the following data are obtained by recording $$X$$, the number of customers that arrive at an automatic banking machine during $$15$$ successive one-minute time intervals.

2 1 3 2 0 1 4 2
0 2 3 1 0 0 4


The formula for sample variance is given by

$$s^2 = \frac{1}{n-1}\sum_{i=1}^{n} (x_i - \bar{x})$$

where $$\bar{x} = 25/15$$

I got $$\frac{1}{14}\left[(2-25/15)^2 + (1-25/15)^2 + (3-25/15)^2 \\ {}+ (2-25/15)^2 + (1-25/15)^2 + (4-25/15)^2 \\ {}+ (2-25/15)^2 + (2-25/15)^2 + (3-25/15)^2 \\ {}+ (1-25/15)^2 + (4-25/15)^2\right] \approx 1.15$$

whereas the answer is $$1.94$$ . What am I doing wrong here?

You left out the points with value $$0$$, they do contribute to the variance because the mean is not zero.
When you do it right, you get $$\frac1{14}\frac{246}{9} \approx 1.952$$
You are missing all the $$(0 - \bar{x})^2$$ components in the sum.