[Math] Calculating the Standard Deviation

standard deviationstatistics

So I'm doing some homework and I'm really struggling trying to figure out how to calculate the standard deviation. It's my understanding that to get it, you need the variance, but apparently I'm doing something wrong as I keep getting incorrect answers.

The problem reads as follows:

When parking a car in a downtown parking lot, drivers pay according to
the number of hours or fraction thereof. The probability distribution
of the number of hours cars are parked has been estimated as follows:

$\begin{array}{|c|c|c|c|c|c|c|c|c|}
\hline
x & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline
P(x) & 0.205 & 0.131 & 0.113 & 0.095 & 0.067 & 0.029 & 0.023 & 0.337\\ \hline
\end{array}$

Find:

A. Mean

B. Standard Deviation =

The cost of parking is 4.75 dollars per hour. Calculate the mean and standard deviation of the amount of revenue each car generates.

A. Mean =

B. Standard Deviation =

Now I've calculated the mean (4.552) for part 1, but I'm not sure how to get the standard deviation, it's my understanding that you use the mean to find the variance, and take the square root of that, but I seem to be getting the wrong answer (11.49) – could someone help me figure out what I'm doing wrong?

Best Answer

If $p_i$ is the discrete probability distribution and $x_1$ is the set of outcomes, then the mean $\mu$ and standard deviation $\sigma$ are given by

$$\mu =\sum_{i=1}^Nx_ip_i \tag 1$$

and

$$\sigma =\sqrt{\sum_{i=1}^N(x_i-\mu)^2p_i} \tag 2$$

Here, we find from $(1)$ that $\mu=4.552$. Then, with $x_i=i$, $p_i$ as given in the table of the OP, and $\mu=4.552$, we find using $(2)$ that

$$\bbox[5px,border:2px solid #C0A000]{\sigma =\sqrt{\sum_{i=1}^8 (i-4.552)^2p_i} =\sqrt{7.959296}}$$