Simple Double Summation
I've seen how nesting works with a simple $(i+j)$ but this problem below is tripping me up. It's either because of the multipliers or because they each start at zero but I get 60, and the answer I believe is 78. Not sure where I'm missing the last 18.
$$\sum_{i=0}^2\sum_{j=0}^3(2i+3j)$$
For the inner sum, I come up with $18$ $((0+0) + (0+3) + (0+6) + (0+9))$
I plug that into the outer sum $((0+18) + (2+18) + (4+18))$
What am I doing wrong? This discrete math book is horribly short in it's explanation (it only speaks of double sums in product form) and it throws curve balls right off the bat. It doesn't do much to build confidence in the material.
Thanks for the help and the place to vent!
Solution 1:
What you are doing wrong is that you need to do the inner sum three times, once for each value of $i$. And when $i$ changes, the value of the inner sum changes by more than just $2i$: you add $2i$ four times (once for each of $j=0$, $1$, $2$, and $3$), so you end up adding $8i$, not just $2i$.
When $i=0$, the inner sum is $18$, as you compute. Then, when $i=1$, the inner sum is $(2+0) + (2+3) + (2+6) + (2+9) = 8+18 = 26$, not $2+18=20$, as you compute.
Then when $i=2$, the inner sum is $(4+0)+(4+3) +(4+6) + (4+9) = 16+18 =34$ (not, as you compute, $22$).
So the total value is the sum of these three quantities, $18+26+34 = 78$.
To do it correctly symbolically, you can proceed as follows: the inner sum is: $$\begin{align*} \sum_{j=0}^3(2i+3j) &= \sum_{j=0}^32i + \sum_{j=0}^33j\\ &= 2i\sum_{j=0}^31 + 3\sum_{j=0}^3 j\\ &= 2i(4) + 3\left(0+1+2+3\right)\\ &= 8i + 18. \end{align*}$$ So then the outer sum is: $$\begin{align*} \sum_{i=0}^2\left(\sum_{j=0}^3(2i+3j)\right) &= \sum_{i=0}^2(8i+18)\\ &= \sum_{i=0}^28i + \sum_{i=0}^218\\ &= 8\sum_{i=0}^2i + 18\sum_{i=0}^21\\ &= 8(0+1+2) + 18(3)\\ &= 24 + 54\\ &= 78. \end{align*}$$
Solution 2:
Just grind away:
$((0+0)+(0+3)+(0+6)+(0+9))+((2+0)+(2+3)+(2+6)+(2+9))+((4+0)+(4+3)+(4+6)+(4+9)) = 78$
Solution 3:
$$\sum_{i=0}^2\sum_{j=0}^3(2i+3j)=2\sum_{i=0}^2\sum_{j=0}^3 i+3\sum_{i=0}^2\sum_{j=0}^3 j\\~~~~~~~~~~~~~~=8\sum_{i=0}^2i+9\sum_{j=0}^3 j\\~~~~~~~~~~~~=8\times 3+9\times 6\\\!\!\!\!\!=78.$$