I'm just going through my notes, and noticed I couldn't follow how to do this step, in deriving a formula for the variance.
$$ V(Y) = E\left[\sum_i^n a_i (Y_i - \mu_i)\right]^2$$ $$ =E\left[\sum_i^n a_i^2(Y_i -\mu_i)^2 +\sum_i^n\sum_i^na_ia_j(Y_i-\mu_i)(Y_j-\mu_j)\right],\space i\neq j$$
What's the technique for expanding this kind of sum? Why do the double summations get involved. Would be happy with an answer showing a link to the technique itself, if not solving the question specifically.
I can see where the first component comes from, but am lost on how/where the double summation comes from. Especially confused on why the indexing changes when we start off with just one index.
Thank you so much!