Consider the following code
G[x, y] /. a_[b__] -> Total[a @@@ Permutations[List[b]]]
I expect it to give
G[x, y]+G[y,x]
But it gives,
G[x, y]
Can anyone explain why this happens? Thank you.
Consider the following code
G[x, y] /. a_[b__] -> Total[a @@@ Permutations[List[b]]]
I expect it to give
G[x, y]+G[y,x]
But it gives,
G[x, y]
Can anyone explain why this happens? Thank you.
RuleDelayed, e.g.G[x, y] /. a_[b__] :> Total[a @@@ Permutations[List[b]]]it will work. Useyourcode//Traceto see what is happening. – gwr Dec 17 '14 at 21:30