[Math] Double Summation: Need help to handle $ i \neq j $ : $ \sum_{i=0 \to 7,\ j=1 \to 8,\ i\neq j} (8i + j) $

sequences-and-seriesstatisticssummation

[Q1]. Can I ? ( write the same summation as ) :
$$ \sum_{i=0, i \neq j}^7 \sum_{j=1}^8 (8i + j) \tag{1}$$

I tried to solve the following Summation as follows:

Let i = m-1 then, $ \sum_{i=0,\ i \neq j}^7 $ becomes
$\sum_{m=1,\ j\neq m-1}^8 $

Now applying change of base equation (1) i.e.
$ \sum_{i=0, i \neq j}^7 \sum_{j=1}^8 (8i + j) $ becomes
$$ \sum_{m=1,\ j\neq m-1}^8 \sum_{j=1}^8 \Big(8(m-1) + j \Big) $$

[Q2]. Can we do the next step? By what rule?

$$\text{Above}= \sum_{m=1,\ j=1, \ j\neq m-1}^8 (8m – 8 +j)
\\
= (\sum_{m=1,\ j=1, \ j\neq m-1}^8 8m )- (\sum_{m=1,\ j=1, \ j\neq m-1}^8 8) + (\sum_{m=1,\ j=1, \ j\neq m-1}^8 j)
\\
= 8\ \Big(\sum_{m=1}^8 m \Big)- 8 \ \Big(\sum_1^8 1 \Big) + \Big(\sum_{j=1}^8 j\Big)
\\
= 8 \Big( 8. \frac{8+1}{2} \Big) – 8(8)+ \Big( 8. \frac{8+1}{2} \Big)
\\
=260 $$

[Q3]. Don't we need to handle $ i \neq j $ ? If so, then in which situation does $ i \neq j $ matter and how ? Please explain what iff. $ i ==j $ then ?

Please clear my concept by answering all my 3 questions above(Q1,Q2 and Q3).

Best Answer

For your first question, the answer is yes, you can change indeed rewrite your outer sum by substituting $m-1$ for $j$ and changing the limits of that sum.


You can't, however, make the step indicated in your second question. Consider, for example, your middle summation. That sum is over all pairs $(m, j)$ satisfying by the predicate $$ P(m, j) = (1\le m\le 8) \land (1\le j\le 8) \land (j\ne m-1) $$ There will $64-8 = 56$ terms in this sum. The first step in your argument was correct: $$ \sum_{P(m, j)} 8 = 8\left(\sum_{P(m, j)} 1\right) $$ but your next step wasn't, since $$ \sum_{P(m,j)} 1 \ne \sum_1^8 1 $$ To see this, just observe that the sum on the left has 56 terms and the sum on the right has only 8.


Finally, a useful technique for problems like this is to ignore for the moment the excluded diagonal terms, sum all the terms, and then subtract the excluded ones. Using your chessboard idea, you noticed that the squares in the chessboard contain the numbers $1, \dots , 64$ so the sum of all the entries is $$ \frac{64\cdot65}{2} = 2080 $$ Now all we have to do is subtract the sum of the 7 diagonal elements in positions $$ (k-1, k) = (2, 1), (3, 2), (4, 3), (5, 4), (6, 5), (7, 6), (8, 7) $$ where the values are $9, 18, 27, 36, 45, 54, 63$. The sum of these is 252, so the answer to the problem is $2080-252=1828$.

Related Question