# Different solutions under distributive and commutative equivalence

Given 5 numbers: $x_1, x_2, x_3, x_4, x_5 \in \mathbb N$

all the 4 operations: $+ - \times /$

a specific brackets pattern:

$\left(\left(\left(x_1 + x_2 \right) - x_3\right) \times x_4 \right) / x_5 = result$

I can permutate at will the five numbers and the 4 operations, I'm interested in the perumutations that give the same result, so with a equivalence relation such as:

Two permutations that return the same result are said equivalent under the basic mathematic laws: Commutative, Associative and Distributive.

Could be said that two solutions are equivalent if and only if they share the same set of numbers?

For example, the following equations are equivalent:

(((142 + 350) - 372) x 125) / 15 = 1000.0
(((142 + 350) - 372) / 15) x 125 = 1000.0


What I mean is that the brackets are fixed but the numbers and the operator can be moved around at will.

Also, what happens if the condition changes to something like:

$|\left(\left(\left(x_1 + x_2 \right) - x_3\right) \times x_4 \right) / x_5 - result| < \epsilon$

Is the conjecture still Ture/False?

Would this somewhat related to a $\delta$, where $\delta$ might be:

$\delta = min(\delta_{ij}) \quad \forall i,j, \: i \ne j$

with $\delta_{ij} = |x_i - x_j|$

Or nothing could be said?

-
I have removed the [calculus-of-variation] and put in [algebra-precalculus] Changes may please be made if irrelevant. – user21436 Feb 12 '12 at 12:02
I removed [algebraic-topology] and added [algorithms]. – Martin Wanvik Feb 12 '12 at 12:09
Not that I know a fast algorithm, but I would suggest to break the problem into two parts: finding all the solutions which result in the desired result, and deciding whether two solutions are equivalent (in your sense) or not. – Tsuyoshi Ito Feb 12 '12 at 19:55
@TsuyoshiIto: The first part is already "solved" (the script I linked does exactly that), the second part is exactly the problem I'm facing: I'm trying to understand if two solutions are equivalent iff they share the same set of numbers, what do you think? – Rik Poggi Feb 12 '12 at 20:01
@RikPoggi: If that is the question, then you should have asked it. It is much simpler than the current question. The answer is no. Consider two formulas (3−2)×6=6 and (6−3)×2=6. If we forget the numbers and just consider them as (x−y)×z and (z−x)×y, they are not equivalent. They happen to be equal because of the particular choice of the numbers. – Tsuyoshi Ito Feb 12 '12 at 20:14

(This is essentially my comments on the question, slightly rephrased.)

Could be said that two solutions are equivalent if and only if they share the same set of numbers?

No, this is not true. For example, consider two formulas (3−2)×6=6 and (6−3)×2=6. They are not equivalent in your sense, because if we forget the numbers and just consider them as (xyz and (zxy, they are different in general. They happen to be equal because of the particular choice of the numbers.

If you want a counterexample with five numbers and four operators, you can append other numbers and operators: for example, consider (((3−2)×6)+12)/9 and (((6−3)×2)+12)/9.

-