associativity

Associativity is the mathematical property of interchangeable order of operations.

Formally,
a binary operation on a set S is associative if it satisfies the associative property:

(xy)z=x(yz)x,y,zS

If a binary operation is associative, repeated application of the operation produces the same result regardless of how valid pairs of parentheses are inserted in the expression. This is called the generalized associative law.

The number of possible "bracketings" is the Catalan number Cn for n operations on n+1 values. Using juxtaposition in place of an operator, a product of 3 operations on 4 elements can be written in C3=5 possible ways:

((ab)c)d(ab)(cd)(a(bc))da((bc)d)a(b(cd))

If the operation is associative, then the result can be written unambiguously as abcd.


Powered by Forestry.md