Adding the averages and standard deviations of different sets correctly

I have $12$ balls with mean weight of $500$g, and S.D $25$g. I have $5$ balls with mean weight $200$g and S.D $10$g. If I combine all of them, is the mean just $8000\over17$ i.e. $$8000=500\cdot12+200\cdot10$$ and divided by $17$ since there are $17$ balls. What is the new S.D.? Is it just $$\sqrt{25\cdot12+10\cdot5}$$

• how do you define the SD? – leonbloy Mar 31 '16 at 10:46
• edited. I define them as weights, not percentages. – stackdsewew Mar 31 '16 at 10:49
• I got that. the thing is that the variance of a sample can be defined in two ways en.wikipedia.org/wiki/… – leonbloy Mar 31 '16 at 11:13

1. For the mean: Yes, this approach is correct, but actually it should be $$500\cdot12+200\cdot5=7000$$ since in the second sample you have $5$ balls and not $10$.
2. For the standard deviation. One approach is to use the pooled standard deviation $s_p$ which is the root of the pooled variance $s_p^2$ with $$s^2_p=\frac{(n_1-1)s^2_1+(n_2-2)s^2_2}{(n_1-1)+(n_2-1)}=\frac{(12-1)25^2+(5-1)10^2}{(12-1)+(5-1)}$$