Hi Yahia,
if you are inclined to implement the formula as it stands, then you might type
Remove[args, cond, X, prod, iter, Y, alghoraniLHS, alghoraniRHS]
args[l_Integer] :=
ToExpression[StringJoin["o", ToString[#]] & /@ Range[l]]
prod[l_Integer] := Times @@ Thread[x[args[l]]]
cond[l_Integer] :=
If[And @@ (X @@@ Union[Sort /@ Permutations[args[l], {2}]]), 1, 0]
iter [m_Integer, l_Integer] := {#, 1, m} & /@ args[l] /; m >= l
alghoraniLHS[K_Integer?Positive] := Product[(1 - x[o]), {o, 1, K}]
alghoraniRHS[K_Integer?Positive] :=
1 + Sum[(-1)^l/l! Y[cond[l] prod[l], Sequence @@ iter[K, l]], {l, 1,
K}] /. {Y :> Sum, X :> Unequal}
into your keyboard. The args function ensures that all functions have the same variables in use. See an example
In[94]:= alghoraniRHS[4]
Out[94]= 1 - x[1] - x[2] - x[3] - x[4] + x[1] x[2] x[3] x[4] +
1/2 (2 x[1] x[2] + 2 x[1] x[3] + 2 x[2] x[3] + 2 x[1] x[4] +
2 x[2] x[4] + 2 x[3] x[4]) +
1/6 (-6 x[1] x[2] x[3] - 6 x[1] x[2] x[4] - 6 x[1] x[3] x[4] -
6 x[2] x[3] x[4])
Check a case - it runs considerably longer than the SymmetricPolynomial[], of course - all the permutations have to be sorted out
In[100]:= Expand[alghoraniLHS[7]] - alghoraniRHS[7] // Simplify
Out[100]= 0
The multiple sums to find terms one knows in advance are computing time wasters
In[109]:= Expand[alghoraniLHS[9]] - alghoraniRHS[9] // Simplify
Out[109]= 0
Please note that even alghoraniRHS[] doesn't go the whole nine yards of implementing the formula because it has the l = 0 term, the 1, in front of it. Can you find a solution without that?
Pleaso note also, that Union[Sort /@ Permutations[...]] is bad style, because it filters out ... permutations.
Regards
Udo.