Let A be a random variable defined as:
- With probability $p[i]$, the random variable $B[i]$ is drawn
- $B[i] ~ N[mu[i],sigma[i]]$
- probabilities $p[i]$ sum up to one
I know how to compute the mean, which is given by:
$$E[A] = p[1]*mu[1] + .. + p[N]*mu[N]$$
I would like to know how to compute the variance
