I have this simple question, given the following sum: Sum[A[i][j][k],{j,0,10},{k,0,10},{i,0,5}]
I would like to apply the condition
$ A[i][j][k]=A[i][k][j] $
How can i do that ?
Thanks
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityUsing a conditional pattern:
Sum[A[i][j][k], {j, 0, 10}, {k, 0, 10}, {i, 0, 5}] /.
A[i_][j_][k_] /; j > k -> A[i][k][j]
(* A[0][0][0] + 2 A[0][0][1] + 2 A[0][0][2] + ...
... + A[5][9][9] + 2 A[5][9][10] + A[5][10][10] *)
Using explicit construction:
Sum[A[i][Min[j, k]][Max[j, k]], {j, 0, 10}, {k, 0, 10}, {i, 0, 5}]
(* same as above *)
Sum[If[j == k, A[i][j][k], 2 A[i][j][k]], {j, 0, 10}, {k, j, 10}, {i, 0, 5}]
. $\endgroup$