We have n values of $x_i$ and error $\sigma_i$,

With a weighting $w_i$, the uncorrelated weighted mean and error is

$X= \sum x_i w_i / \sum w_i$

$S^2 = \sum w_i^2 \sigma_i^2 / (\sum w_i)^2$

when combining data, the weighting is

$w_i = 1/\sigma_i^2$

and the weighted error becomes

$S^2 = \sum{\frac{1}{\sigma_i^2}} / (\sum{\frac{1}{\sigma_i^2}})^2 = 1 / \sum \frac{1}{\sigma_i^2}$

Example.

we measured a quantity n times, we can assume the intrinsic error of the data is fixed. Thus,

$w_i = 1/n$

$X = \sum x_i / n$

$S^2 = \sum \sigma_0^2/n^2 = \sigma_0^2 /n$

Therefore, when we take more and more data, the error is proportional to $1/\sqrt{n}$.

In normal distribution, the sample of size n, the estimator of the sample mean and sample variance are

$X =\sum x_i/n$

$S^2 = \sum (x_i-X)^2 / (n-1)$

Don’t mix up the sample variance and intrinsic error, although they are very similar.

To explain the formula of the weighted variance, we have to go to the foundation of the algebra of distribution.

For a random variable follow a distribution with mean $\mu$ and variance $\sigma^2$,

$X \sim D(\mu, \sigma^2)$

Another random variable built on it,

$Z=aX+b \sim D(a \mu + b, a^2\sigma^2)$

$Z=aX + bY \sim D(a \mu_X + b \mu_Y, a^2\sigma_X^2 + b^2 \sigma_Y^2)$
But there is a catch, when the $\mu_X = \mu_Y$ and $\sigma_X = \sigma_Y$, The rule does not apply. But lets look back, if the mean and variance are the same, the two distribution does not really independent.