# Calculating the Standard Deviation

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.

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?

• The variance is $\sum_{i=1}^n (x_i-\mu)^2\cdot p(x_i)$. I have $Var(x)=14.88$ – callculus Oct 3 '15 at 21:00

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}}$$

• You should exchange $\mu$ by $\sigma$ for your formulas. – callculus Oct 3 '15 at 21:01
• @calculus Thank you for the catch .... +1 – Mark Viola Oct 3 '15 at 21:02
• I was reading the formula incorrectly and subtracting $p_i$ from 4.552 instead of $i$ - thanks for that! – secondubly Oct 3 '15 at 21:05
• Could you check what I have probably made wrong, because my result is twice of your result ? Here my calculations (You have to mark all the lines and copy them): wolframalpha.com/input/?i=%281-4.552%29%5E2*0.205+%2B%282-4.552%29%5E2*+0.131%2B%283-4.552%29%5E2*++0.113+%2B%284--4.552%29%5E2*+0.095+%2B%285-4.552%29%5E2*+0.067+%2B%286-4.552%29%5E2*+0.029+%2B%287-4.552%29%5E2*+0.023+%2B%288-4.552%29%5E2*+0.337 – callculus Oct 3 '15 at 21:06
• @calculus It appears that most of this is correct. Are you sure that you added all of the results correctly? I cannot really locate an error. – Mark Viola Oct 3 '15 at 21:16