Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have:
A1: {3, 5, 6} and A2: {3, 4, 6, 8}

Avg A1: 4.(6)
Std.Deviation A1: 1.247

Avg A2: 5.25
Std. Deviation A2: 1.92

Merging A1 and A2, we get
A12: {3, 3, 4, 5, 6, 6, 8}

Avg A12: 5
Std. Deviation A12: 1.69

I want to be able to obtain those values (avg and std. deviation for A12), having only the following information about A1 and A2:

No. Elements: 3
Avg A1: 4.(6)
Std.Deviation A1: 1.247

No. Elements: 4
Avg A2: 5.25
Std.Deviation A2: 1.92

Average is easy, (4.(6)*3 + 5.25*4)/7 = 5

But I seem to be unable to calculate the correct std. deviation value. I can only use the above information. Any ideas?

share|cite|improve this question
How do you get standard deviations of 1.11, 1.75 and 1.4286? They look rather low. – Henry Feb 17 '11 at 12:36
oops, you are right, it is not. Awful mistake. will edit it now – baderous Feb 17 '11 at 14:23
up vote 2 down vote accepted

If $\sigma$ is the (population) standard deviation then

$$\sigma^2 = \frac{\sum (x_i - \mu)^2}{n} = \frac{\sum x_i^2}{n} - \mu^2$$

so using the subscripts $1$, $2$ and $C$ for the first part, second part and combination

$$\sigma_C^2 = \frac{n_1 (\sigma_1^2 + \mu_1^2) + n_2 (\sigma_2^2 + \mu_2^2)}{n_1+n_2} - \mu_C^2$$

where $\mu_C = \frac{n_1 \mu_1 + n_2 \mu_2}{n_1+n_2}$ as you have. Then take the square root.

I think this is easier to understand than Wikipedia's version though theirs is better if rounding errors are an issue (e.g. with large means close to each other and small standard deviations).

share|cite|improve this answer
it definitely is! thank you. :) – baderous Feb 17 '11 at 15:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.