Simple Double Summation

$\begingroup$

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!

$\endgroup$ 2

4 Answers

$\begingroup$

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*}$$

$\endgroup$ 1 $\begingroup$

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$

$\endgroup$ $\begingroup$

$$\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.$$

$\endgroup$ $\begingroup$

I hope maybe a related presentation familiar to programmers helps readers "see" the double summation better. With double summation, I imagine a 2d matrix with i=rows 0,1,2 and j = columns 0,1,2,3:

\begin{matrix} & j=0 & j=1 & j=2 & j=3 \\ i=0 & 0 & 3 & 6 & 9 \\ i=1 & 2 & 5 & 8 & 11 \\ i=2 & 4 & 7 & 10 & 13 \end{matrix}

With each row, the value of i is fixed, and j varies. Then our problem is just, how do we reduce this to a single number? Well, we sum it... twice! One pass in each dimension. First we can sum across each row's columns to "smoosh" into one column (you could equally add down each column instead to produce [6,15,24,33]):

\begin{matrix} 0+3+6+9&=18\\ 2+5+8+11&=26\\ 4+7+10+13&=34 \end{matrix}

Finally we sum down that column to get to the shape we expect, a single number: 78

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like