[1⩽j⩽n][j⩽k⩽n]=[1⩽j⩽k⩽n]=[1⩽k⩽n][1⩽j⩽k]
j=1∑nk=j∑naj,k=1⩽j⩽k⩽n∑aj,k=k=1∑nj=1∑kaj,k
example 1
⎣⎢⎢⎢⎢⎢⎡a1a1a2a1a3a1⋮ana1a1a2a2a2a3a2⋮ana2a1a3a2a3a3a3⋮ana3............a1ana2ana3an⋮anan⎦⎥⎥⎥⎥⎥⎤
How about the sum of right upper triangle
S⊲=1⩽j⩽k⩽n∑ajak
The question here is how to simplify the formula S⊲ S⊳+S⊲=1⩽j,k⩽n∑ajak+1⩽j=k⩽n∑ajak=(1⩽j⩽n∑aj)2+i⩽k⩽n∑ak2
from
∑j=1n∑k=jnaj,k=∑1⩽j⩽k⩽naj,k=∑k=1n∑j=1kaj,k,
we can get S⊳=S⊲
at last
S⊲=21[(1⩽j⩽n∑aj)2+i⩽k⩽n∑ak2]
example 2
S=1⩽j<k⩽n∑(ak−aj)(bk−bj)
The question here is how to simplify the formula of S. Let us look
at the fact below,
[1⩽j<k⩽n]+[1⩽k<j⩽k]=[1⩽j,k⩽n]−[1⩽j=k⩽n]
S=1⩽j<k⩽n∑(ak−aj)(bk−bj)=1⩽k<j⩽n∑(aj−ak)(bj−bk)
2S=1⩽j,k⩽n∑(ak−aj)(bk−bj)−1⩽j=k⩽n∑(ak−aj)(bk−bj)
We should aware that the second part of the left equation is zero.
2S=1⩽j,k⩽n∑(ak−aj)(bk−bj)
Let’s expand (ak−aj)(bk−bj) to akbk+ajbj−akbj−ajbk.
It’s obvious that
1⩽j,k⩽n∑akbk=1⩽j,k⩽n∑ajbj,1⩽j,k⩽n∑akaj=1⩽j,k⩽n∑ajak
We should get the formula below
2S=21⩽j,k⩽n∑akbk−21⩽j,k⩽n∑ajbk
Let’s simplify the right part of the upper equation
-
1⩽j,k⩽n∑akbk=ni⩽k⩽n∑akbk
-
1⩽j,k⩽n∑ajbk=(1⩽k⩽n∑ak)(1⩽k⩽n∑bk)
Finally,
2S=2ni⩽k⩽n∑akbk−2(1⩽k⩽n∑ak)(1⩽k⩽n∑bk)
Rewrite the upper equation
(1⩽k⩽n∑ak)(1⩽k⩽n∑bk)=nk=1∑nakbk−1⩽j<k⩽n∑(ak−aj)(bk−bj)