2

By repeatedly applying the basic associativity law $(x+y)+z = x+(y+z)$, one can get from any one expression with binary addition to any other with the variables in the same order.

Specifically, given two expressions only involving binary addition that are related by the general principle of associativity, one can brute force get both into fully-left-associated form: $$(\ldots((a+b)+c)+d)+\ldots)+z$$ by applying $$x+(y+z) \rightarrow (x+y)+z$$ everywhere possible in a brute force fashion.

Thus one can get from one expression to the other by first applying $$x+(y+z) \rightarrow (x+y)+z$$ to get to the fully-left-associated form and then applying $$(x+y)+z \rightarrow x+(y+z)$$ to get back to the other expression.

But this is clearly not the most optimal route in some cases. Is anything known about the optimal route? That is, given two expressions in a binary operation related by general associativity, what is the fewest number of applications of the associativity law to get from one to the other?

TomKern
  • 3,407
  • Do you have a particular motivation/application in mind, or just curiosity? – Alan Aug 11 '21 at 06:30
  • This is actually a more complicated problem than it seems at first. For example, $$((a+b)+c)+d=(a+(b+c))+d=a+((b+c)+d)=a+(b+(c+d))$$ uses 3 applications of associativity that shift a set of brackets to the right. It can however also be done in two right shift steps $$((a+b)+c)+d=(a+b)+(c+d)=a+(b+(c+d))$$, which uses the fact that there is ambiguity in $(a+b)+(c+d)$ as to which brackets are evaluated first. – Jaap Scherphuis Aug 11 '21 at 12:06
  • Alan: I'm working on an application that lets you expand algebraic computations all the way down to applications of axioms (FOILing, for instance, expands into multiple applications of distributivity). This is mainly out of curiosity though: I imagine I'll wind up using brute-force search. – TomKern Aug 11 '21 at 21:38
  • 1
    According to Rotations, triangulations, and hyperbolic geometry, the worst case number of times you need to apply the law is $2n-6$. – Mike Earnest Aug 11 '21 at 21:50

0 Answers0