Using alternate order of operations

414 Views Asked by At

Let's pretend, for a second, that we used PEASMD instead of PEMDAS. That is, addition/subtraction and multiplication/division are switched. Is it possible to write: $$(a\times b)+c$$ without parentheses?

EDIT: For example, the expression $(a\times b)+a+b+1$ can be written as $a+1\times b+1$, which doesn't use parentheses.

2

There are 2 best solutions below

12
On

$(a*b)+c=a*b+\frac{c}{a}$ as long as you allow horizontal fractions to have implied parentheses.

That is one of the weirdest equalities I have ever written...

To see this, observe that according to PEASMD, $a*b+\frac{c}{a}=a*(b+(c/a))$ (note the use of the implied parentheses for horizontal fractions.) then by distribution we get$ (a*b)+(a*(c/a)) $or $(a*b)+c$

7
On

Note: This is not a full answer, but I think it offers some useful ideas towards understanding the nature of the question and also provides a sketch towards a solution.

This is a question of syntax. Is there a string of symbols that, using no brackets, and the given operator precedence, evaluates to the same term as $(a \times b) + c$, for all values of $a, b, c$. We must then ask, what are the symbols allowed and what does evaluation mean? Here is a simple start to answer this question. It is by no means "the" correct approach, but it highlights the subtlety of the underlying assumptions needed, and highlights that this is really a formal-syntax question.

To begin, we have a language of expressions. These are written as alternating sequences of symbols and operators, odd in length always. A symbol is either a "variable", or a known constant. A variable is any string of letters, say. This includes the strings "a", "b" and "c". An operator is one of the $5$ standard operators $+, -, \times$ \ and ^. A constant is $e$, $2$ etc. For the moment, we'll disallow any other symbols e.g. known functions such as sine, cosine.

The meaning of such a list is a function in all its variables. This function is unambiguously defined by bracketing according to the precedence rules. We assume an infix notation for operators. For example, $[x, \times, 2, \times, 3]$ "means" the function $\lambda x \rightarrow 6x$, using lambda calculus notation.


Edit: To prove a special case of this ignoring exponentiation we reduce everything to a normal form. We first notice that everything can be written as a product of sums, with terms in sums being either the variables $a$, $b$ or $c$, or constants.

  • We can ignore occurrences of other variables because, they will have to cancel out to leave us with a term in only $a$, $b$ and $c$, so we can just replace them with any constant we like and the term reduces to one in only those $3$ variables.
  • The reason we can ignore division is as follows. Suppose a sum term $(x + y + z + \dots)$ appeared in the denominator. Then either it is constant, in which case it can be replaced with multiplication by $\frac{1}{x + y + z + \dots}$, which itself is just a constant. Otherwise, the term contains at least one variable $a$, $b$ or $c$. In this case, we can make the term go to zero by the appropriate choice of $a$, $b$ and $c$, and the entire term becomes undefined. This can't happen, so such a case cannot be allowed.

Now, we can further reduce to a product of sums in which each sum has at least one variable, at most one constant, and the whole thing is multiplied by a constant. That is:

$$(x_{1, 1} + x_{1, 2} + \dots + d_1)(x_{2, 1} + x_{2, 2} + \dots +d_2)\dots(x_{n, 1} + x_{n, 2} + \dots + d_n)d$$

For some constants $d_i, d$, variables $x_{i, j} \in \{a, b, c\}$.

We then show that $n \leq 2$. Otherwise, for the case of $a = b = c$, we have a cubic polynomial which is equal to a quadratic, which cannot be true for all $a$. Now we can also show $n \geq 2$ and so $n = 2$. This is true because otherwise, we get a linear term compared to a quadratic one, which cannot be true in all cases. So our term is always:

$$(x_{1, 1} + x_{1, 2} + \dots + d_1)(x_{2, 1} + x_{2, 2} + \dots +d_2)d$$

Now, $d$ can't be zero because then this term would always be zero. Also, setting $a$ and $c$ to $0$, this term must equal to $0$ for all $b$. So $b$ cannot appear in both sums, and the constant in the sum opposite that of $b$ must be zero. WLOG, then our expression is:

$$(b + xa + yc + d_1)(wa + uc)d$$

Where $x, y, w, u \in \{0, 1\}$. But setting $c = 0, b = 1$ the above must equal $a$, for all $a$:

$$(1 + xa + d_1)(wa)d = a$$

But this is impossible, because the LHS term is quadratic with respect to $a$, whereas the RHS term is linear. This is a contradiction, and so, without exponentiation, an equivalent bracketless statement is impossible.

Note: I have a hunch that the exponentiation case may follow from similar arguments of function complexity (growth rate).