How to compute double summations where the two summands are not independent?

165 Views Asked by At

Edit:

From the vote counts I see that people want this question closed as it seems unclear what I was asking, so I have tried to word it a bit better to avoid closure. I hope this helps, please comment if it is still unclear. Thank you.


If $$\sum_{i,j}a_{i,j}=\sum_i^N\sum_j^N a_{i,j},$$ then $$\sum_{i,j\ne i} a_{i,j}=\sum_i^N\sum_{j:j\ne i}^N a_{i,j} = \color{red}{\sum_i^N\left(\sum_{j=1}^{i-1} a_{i,j} + \sum_{j=i+1}^{N} a_{i,j}\right)}=\sum_i^N\left(\sum_{j=1}^{i-1} a_{i,j} + \color{blue}{a_{i,i}}+ \sum_{j=i+1}^{N} a_{i,j}\right)$$

Could someone please explain why the $\color{blue}{\mathrm{blue}}$ term in the summand is present?