# What does $\sum\limits_{i\neq j}$ mean?

I have seen similar questions (perhaps too similar, I´m sorry if so) but none of them do too much of a good job on defining what an expression such as $$\sum_{i\neq j}^n(x_iy_j)$$ means exactly. What set of numbers am I adding up? What does it mean to have two variables on the running variables under the sum? Is there another notation that might clear things up for me?

• It's a bit of notation abuse, but assuming that $n$ is a counting number, the idea is that the summation is as follows: $$\sum\limits_{i\neq j}^n(x_i,y_j)=\sum\limits_{i=1}^n\sum\limits_{j=1}^n|\operatorname{sgn}(i-j)|(x_i,y_j)$$ Commented Jan 21, 2020 at 23:02
• It only denotes the sum of all possible $(x_,y_j)$ with the condition that $i\ne j$. Commented Jan 21, 2020 at 23:07

In words, sum $$x_iy_j$$ for all allowed values of $$i$$ and $$j$$ except for $$i = j$$. As an example, assuming that $$i$$ and $$j$$ take values 1, 2 and 3, the full unrestricted sum would have nine terms:

\begin{align} \sum_{i,j} x_iy_j =\\ & x_1 y_1 + x_1 y_2 + x_1 y_3\\ +& x_2 y_1 + x_2 y_2 + x_2 y_3 \\ +& x_3 y_1 + x_3 y_2 + x_3 y_3 \end{align} whereas the restricted sum in your question would have only six terms: the diagonal terms where the two subscripts have the same value would not be present: \begin{align} \sum_{i \ne j} x_iy_j =\\ & &x_1 y_2 &+x_1 y_3\\ +& x_2 y_1 & &+ x_2 y_3 \\ +& x_3 y_1 &+ x_3 y_2 & \end{align}

Presumably, it means that you take the set of pairs of elements $$i,j\in \{1,\ldots,n\}$$ and add up the value of $$x_iy_j$$ for each of those pairs. For instance, if $$n=2$$, it would mean $$x_1y_2+x_2y_1$$ and if $$n=3$$ it would mean $$x_1y_2+x_1y_3+x_2y_1+x_2y_3+x_3y_1+x_3y_2$$ where the six possible ordered pairs of distinct numbers in $$\{1,\ldots,3\}$$ appear as subscripts. However, you have to infer from context exactly what was meant - figure out what makes sense. You could also write this as $$\sum_{i=1}^{n}\left(\sum_{j=1}^{i-1}x_iy_j+\sum_{j=i+1}^nx_iy_j\right)$$ or as $$\sum_{i=1}^n\sum_{j\in \{1,\ldots,n\}\setminus \{i\}}x_iy_j$$

where the $$x_iy_i$$ term is explicitly left out by avoiding it in the sum - but this is verbose and makes it more difficult to understand the intent, hence the use of shorthand notation.

Generally, this use of the symbol $$\sum$$ means that the sums runs over the variables listed beneath the symbol, but only over the assignments of those variables that satisfy the conditions (which are typically beneath those variables) and, optionally, up to some upper bound listed above. It's not entirely formal, but usually (hopefully!) the reader can work out what is meant. Here, the variables are presumably $$i$$ and $$j$$, being the only things listed beneath, and the condition is that $$i\neq j$$ and there is an upper bound of $$n$$ - so we'll create a term of the sum for every possible pair $$(i,j)$$ of distinct values up to $$n$$.

In general, a summation of the form $$\sum_{P(i)}x_i$$ where $$i$$ is some form of index and $$P$$ is a proposition means the sum of $$x_i$$ over all possible $$i$$ for which $$P(i)$$ is true. (This is of course not the only use of the summation notation, but it is a very common one.) For instance, $$\sum_{i\in \{1,2,\dots,n\}}x_i$$ means $$x_1+x_2+\dots+x_n$$. Similarly, $$\sum_{i\neq j}x_iy_j$$ means the sum over all $$i,j\in\mathbb Z_{>0}$$ satisfying $$i\neq j$$. Here, since there is an upper bound of $$n$$, presumably the meaning of $$\sum_{i\neq j}^nx_iy_j$$is the sum of $$x_iy_j$$ over all $$i,j$$ in the set $$\{1,2,\dots,n\}$$ satisfying $$i\neq j$$. The specific meaning could differ slightly depending on context: for instance it could be possible that $$0$$ is a permitted value for $$i$$ and $$j$$. This is however the general idea, and to confirm that this is the meaning in this particular case, you can often derive that from the context in which you encounter this symbol.

• Thank you very much. Now I see that this is exactly what the context implied. Commented Jan 21, 2020 at 23:31
• I think it's worth noting that this use is common but it is shorthand that is used when the other details are clear - if there's likely any doubt about which variables are summed or what set they come from, the author shouldn't rely on this notation. $\sum_{i\neq j}x_iy_jz_k$ might be ambiguous (are we summing triples $(i,j,k)$ satisying the condition or pairs $(i,j)$?) and, as in this example $\sum_{i\neq j}^n$ cannot be relied on to communicate where the sum starts, so wouldn't be used if this is not clear from context. Conversely, sometimes $\sum x_iy_j$ tells the reader enough. Commented Jan 21, 2020 at 23:43
• @MiloBrandt Indeed, context determines everything especially in cases of potentially ambiguous notation like this. Commented Jan 21, 2020 at 23:48