I've been doing some work that results in the creation of hundreds or thousands of equations with the same answer. To prevent them from collapsing to their simple answers, each has been passed through HoldForm[]. Some of these solutions are, from my point of view, redundant, and I'm trying to figure out how to tell Mathematica to elminate these.

For my purposes, two solutions are identical if they differ only by the order of the operands. Thus,

(1 - 9)*(1 - 4) == (1 - 4)*(1 - 9)


2^(2+3+1) == 2^(3+2+1)


(1 - 9)*(1 - 4) != (3 + 3)*(2 + 2)


2^(2+3+1) != 2^(4+1+1)

I have a list of equations and want Mathematica to strip out "redundant" solutions by this standard, how might I identify them to SameTest-> ?

  • $\begingroup$ You must be extremely clear in what you mean by "redundant," and your examples are insufficient. Is ((1+1)+2)==4 "redundant" to (2+2)==4, for example? $\endgroup$ – David G. Stork Sep 30 '15 at 15:27
  • $\begingroup$ Also, what is the format of the left and right hand sides? They obviously can't be expressions because the equations as you have them would evaluate to True. $\endgroup$ – march Sep 30 '15 at 15:37
  • $\begingroup$ @march expressions passed through HoldForm[] $\endgroup$ – Michael Stern Sep 30 '15 at 16:06
  • $\begingroup$ @David G. Stork I have tried to clarify. All the solutions being compared are composed of the same four integers arranged differently with different mathematical operators. Any change in operator = not identical. Any change in "grouping" = not identical. However if the operator is constant and operands are identical but their order differs, that = redundant. I can provide more examples if needed. $\endgroup$ – Michael Stern Sep 30 '15 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.