# Mean, Variance and Standard Deviation--Answer inside, don't know if it's right

Can anyone tell me if this is correct?

Given the following probability distribution, calculate the mean, variance, and standard deviation.

x P(x)

1 0.125

2 0.236

3 0.543

4 0.096

The requirements have been met for a probability distribution.

µ = Sum x * P (x)$µ = Sum [1 * 0.125 + 2* 0.236 + 3*0.543 + 4 * 0.096] = [0.125 + 0.472 + 1.629 + 0.384] µ = 2.6 (rounded) variance: s^2 = Sum [x^2 * P (x)] - µ^2 = Sum [(x- µ)^2 * P(x)] = (1- 2.61)^2 * 0.125 = (-1.61)^2 * 0.125 = 2.592 * 0.125 = 0.324 (2- 2.61)^2 * 0.236 = (-0.61)^2 * 0.236 = 0.372 * 0.236 = 0.087 (3-2.61)^2 * 0.0543 = (0.39)^2 *0.0543 = 0.152 * 0.0543 = 0.008 (4 - 2.61)^2 * 0.096 = (1.39)^2 * 0.096 = 1.932 * 0.096 = 0.185 Sum = 0.324 +0.087+0.008+0.185 = 0.604 = 0.6 (Rounded) Standard deviation: s = square root of variance Standard deviation = 0.777 = 0.8 (rounded) - ## 1 Answer Your mean of$2.61$is right. However, there is no reason to then round the correct$2.61$to$2.6$. The values the random variable takes on are integers, presumably exact, and the probabilities are given to$3$decimal places. My calculated value for the variance is$0.6799$, giving a standard deviation of about$0.82456$. This is quite far from yours. So at least one of us should do the calculations again. I have done mine twice: it's your turn. The computation of variance: The usual formal definition of the variance$\sigma_X^2$of a random variable$X$is $$\sigma_X^2=E(X-\mu_X)^2,$$ where$\mu_X$is the mean of$X$. This definition is helpful in understanding what variance really describes. By manipulation of this basic formula (expand the square) it is not hard to show that $$\sigma_X^2=E(X^2) -\mu_X^2.$$ The second formula is, for computational purposes, often more pleasant to use than the first. You mention both formulas, and then proceed to do your calculation with the computationally more unpleasant one. Maybe for practice you should also do it the easier way. Aha!: I have found one explicit source of error. It is the line "(3-2.61)2 * 0.0543 = (0.39)2 *0.0543 = 0.152 * 0.0543 = 0.008" The$0.0543$is supposed to be$0.543$, just a slip really, but it changes the entry that presumably should have been about$0.08$to$0.008\$. That just about accounts for the discrepancy between our numbers.

Comment: I hope that you keep all these calculations within the calculator, to full accuracy, by using the "memory" feature. Writing down intermediate results and rekeying them is a nuisance, and a frequent source of error. It can also lead to serious loss of accuracy, for various reasons. One reason that you may not know about is that the calculator keeps "guard digits" internally: it is doing calculations to greater accuracy than it displays. So even if you rekey what you see exactly, you are losing accuracy.

I cannot tell whether you kept intermediate results, without rounding, in the calculator, and just truncated in writing up the calculation (good), or whether you wrote down truncated intermediate results and rekeyed and added up at the end (not so good).

-
It cannot be repeated often enough: in manual calculation, round/truncate only at the end! Retain as many significant figures as could be mustered in the intermediate calculations. – J. M. Sep 29 '11 at 14:48
@J.M.: Agree. So I repeated it. – André Nicolas Sep 29 '11 at 15:00