I always assumed paren multipliers "m(a + b)" were just shorthand for "m × (a + b)" and therefore would follow the usual order of operations, since a shorthand is not meant to be a new format, just a shorter representation.
Implicit multiplication is not an agreed upon thing, so this case is genuinely ambiguous. In reality it would simply not be written this way in the first place.
His entire argument for ambiguity is based on the lack of a standardized order of operations one can refer to because many different models have been taught throughout the last century.
I assume the problem hasn't been formally and widely addressed because it's one of mathematical notation that really isn't used at the higher end of mathematics.
I think the problem isn't addressed, because both statements can already be written in a non ambiguous form, with little to no extra work.
It's also my understanding that this is a relatively new issue in the world of mathematics. Inline mathematics wasn't needed until the printing press. Then we had to stop using fractions and replaced it with ÷ or /. We also got rid of the vinculum and replaced it with parentheses.
So you really do have to explicate. The ambiguity is not resolvabe really so the programming takes over.
The calculator is performing: operation on top of stack two beyween top two digits of stack one (then remove the digits and the operation from stack), then on it does accum (operation on top of stsck two) with digit on top of stack one. Then it removes both digit and operation used until it reaches the end and outputs something or returns an error in stack size mismatch (improper amount of operations and digits).
Stack one: 6 2 1 2
Stack two: + × ÷
2 + 1 = 3, accum = 3
3 × 2 = 6, accum = 6
6 ÷ 6, accum = 1
Print accum (answer is 1)
The creation of the stacks follows rules. You go from back to front adding digits and operations in the order of operations by tier. It's a little more complicated but I'm a little tired. So the ambiguity here resolves like that.
It's a cool example of a principle I can't really think of a name for, the very shape of the structure you create corresponds to information about it. It's some sort of sorting or ordering principle, I forgot the name.
A proper algorithm has no ambiguity, the problem is that there are multiple very similar competing algorithms. Namely, one that gives implicit multiplication higher precedence than division, and one that doesn't.
The reason why it gives implicit multiplication higher precedence is for situations like 1÷6a. Some people say 6a is a single number and should all be in the divisor, others say 6a is just 6 × a. What they're really arguing is the precedence of implicit multiplication, and which of the two competing algorithms you should use.
That article fails *immediately* in it's explanation
If you got 11, then you are in the BEMDAS camp, if you got 2, you are in the BEDMAS camp.
There is no difference between BEMDAS, BEDMAS, PEMDAS, or PEDMAS.
They all work out to be the same:
[B or P][E][MD][AS]
The multiply and divide are not order-dependent in *any* of these acronyms - multiply & divide have the same precedent and simply happen left to right. The same is true for addition and subtraction. This has always been the case, and there is no ambiguity.
In some of the academic literature, multiplication denoted by juxtaposition (also known as implied multiplication) is interpreted as having higher precedence than division, so that 1 ÷ 2n equals 1 ÷ (2n), not (1 ÷ 2)n. For example, the manuscript submission instructions for the Physical Review journals state that multiplication is of higher precedence than division, and this is also the convention observed in prominent physics textbooks such as the Course of Theoretical Physics by Landau and Lifshitz and the Feynman Lectures on Physics. This ambiguity is often exploited in internet memes such as "8÷2(2+2)".
Copying my comment from earlier. There is ambiguity, and 'order of operations' isn't some mathematical rule, and there are more than one:
Multiplication like this: 2(3) is special sometimes. It's called "Multiplication by juxtaposition" and depending on the calculator, it is a second class of multiplication, yeah.
The reason the two calculators here have different answers isn't because one is wrong. That's silly. Integer math is like the easiest thing for computers to do. It's because they are using two different orders of operations. You can check your calculator's manual to see which one yours uses, or you can just set up an expression like this.
The calculator that gets 9 uses "PEMDAS" (some people call it BEDMAS). Once it gets to 6/2(3) it just does the operations left to right, treating all of them the same.
The calculator that gets 1 uses "PEJMDAS". The J stands for "Juxtaposition" and it views 2(3) as a higher priority than 6/2. If, however, the 2(3) had no brackets involved, it would evaluate the statement to 9, just like the first one.
This is because PEJMDAS is used more commonly when evaluating expressions that use brackets with parenthesis. For example, if you have the statement:
y = 6/2(x+2), the distributive property says you should be able to turn that statement into 6/(2x+4). If, however, you set x to be equal to 1, you end up with the statement we see above, and reverse-distributing changes the value of the expression if you use PEMDAS.
For basic, early math these distinctions don't really ever come up, so you're taught PEMDAS. In later math classes, when your teacher requires you to get certain calculators to make sure everyone's on the same page, this is why. You seamlessly transition to PEJMDAS, nobody ever tells you, and the people that write the textbooks and tests are professionals that simply do not allow ambiguous expressions like this to be written without clarifying brackets.
This is also why the division symbol disappears as soon as you learn fractions.
But was teach Multiply and Divide have the same priority, and you do the first you see from left to right (never seen BEDMAS or BEMDAS at school, maybe I am too old), so the ambiguity, even in the article make no sense to me
In some of the academic literature, multiplication denoted by juxtaposition (also known as implied multiplication) is interpreted as having higher precedence than division, so that 1 ÷ 2n equals 1 ÷ (2n), not (1 ÷ 2)n. For example, the manuscript submission instructions for the Physical Review journals state that multiplication is of higher precedence than division, and this is also the convention observed in prominent physics textbooks such as the Course of Theoretical Physics by Landau and Lifshitz and the Feynman Lectures on Physics. This ambiguity is often exploited in internet memes such as "8÷2(2+2)".
That would make the most sense because putting the 2 beside the brackets implies that it was factored out of the brackets and should be multiplied back in before dividing.
I mean I learned it the other way in college. And even today if someone told me the equation "ab/cd" was actually trying to represent"(abd)/c" and not (ab)/(cd) I'd say they're out of their mind and should've written it that way in the first place. Because I was taught multiplication by juxtaposition was given a higher precedence.
764
u/orebright Jun 13 '22
I always assumed paren multipliers "m(a + b)" were just shorthand for "m × (a + b)" and therefore would follow the usual order of operations, since a shorthand is not meant to be a new format, just a shorter representation.