
Double Summations
How would you expand the double summation:
$\displaystyle \sum\limits_{i}^2{\sum\limits_{j}^2{y_{i}y_{j}a_{i j}}}$
I understand that:
$\displaystyle \sum\limits_{i}^2{\sum\limits_{j}^2{y_{i}y_{j}}}$
Gets you something like:
$\displaystyle
y_{1}^{2}+y_{12}+ y_{21}+y_{2}^{2}
$
and
$\displaystyle \sum\limits_{i}^2{\sum\limits_{j}^2{a_{ij}}}$
is
$\displaystyle
a_{11}+a_{12}+a_{21}+a_{22}
$
But how can you combine these two? Is it as simple as foiling the entire thing?

If you're familiar with programming, double summations work like nested for loops. Ever time we iterate the outer summation, we run the entire inner summation. So every time i increases by 1, we go through all the possible values of j. In this case, every time i increases, we sum j from 1 to 2.
So $\displaystyle \sum_i^2 \sum_j^2 y_iy_ja_{ij} = \sum_j^2 y_1y_ja_{1j} + \sum_j^2 y_2y_ja_{2j} = (y_1)^2a_{11} + y_1y_2a_{12} + y_2y_1a_{21} + (y_2)^2a_{22}$
