Let us have variables v[k], k=1,…,n.
Variables v[k] can have only two values: +1 or -1.
I want to find a sequence of values of the following double sums:
\sum^n_{i=1} \sum^n_{j=1} v(i) v(j) w(i,j)
where w is a weight function, for all possible +/-1 values.
So, the 1st term in the sequence would be the value of the sums for v[1]=1, v[2]=1, … , v[n]=1,
the 2nd term in the sequence would be the value of the sums for v[1]=1, v[2]=1, … , v[n-1]=1, v[n]=-1,
…
The last term in the sequence would be the value of the sums for v[1]=-1, v[2]=-1, … , v[n]=-1.
{{1, 1, 1, 1, 1}, {1, 1, 1, 1, -1},…,{-1, -1, -1, -1, -1} is the premise we start from. The problem is how to call these series from sums. In particular for the first sum we should obtain v[1]=1,v[2]=1,…,v[5]=1 from {1, 1, 1, 1, 1} and obtain some value for the sums. Then the algorithm should call the second set {1, 1, 1, 1, -1} form the next v[1]=1,v[2]=1,…,v[5]=-1, and so on. What would be the Mathematica program for that?
The latter. Thanks. I learned a lot. I’m afraid I wouldn’t be able to find “/@ Range[n]” or “& /@ x /. {v[a_], b_} → (v[a] → b)” in the Documentation soon enough.