However, I am unable to reproduce the same result below.
There seems to be something badly wrong with the code given. But no wonder - even the plain text of this script if full of typos!
For that define a function Sym[expr_,n_]
which will symmetrize expr
by all permunations of x...
Is this:
1/5 f[x[1]] + 1/5 f[x[2]] + 1/5 f[x[3]] + 1/5 f[x[4]] + 1/5 f[x[5]]
then really the wanted result? Or should the code rather reads like so:
sym[expr_, n_] := Block[{prm},
prm = Permutations[Table[x[i], {i, 1, n}]];
Total[expr @@@ prm]/Length[prm] // Expand
]
Then:
In[]:= sym[f, 3]
Out[]=
1/6 f[x[1], x[2], x[3]] + 1/6 f[x[1], x[3], x[2]] +
1/6 f[x[2], x[1], x[3]] + 1/6 f[x[2], x[3], x[1]] +
1/6 f[x[3], x[1], x[2]] + 1/6 f[x[3], x[2], x[1]]
Well - no idea! Maybe you should ask a more specific question.