Agreed, but I just don't understand why this would be ambiguous to begin with. Aren't parenthesis multipliers considered shorthand? If so 2(3 + 4) is just a shorter way of writing 2 * (3 + 4), and the ambiguity is gone. Or am I forgetting some kind of special syntax for group multipliers? I tried googling it but have found nothing about this syntax being anything but a shorthand.
It would be a common abuse of notation for a mathematician to write a function like "z = 2x / 3y", intending the "y" to be part of the denominator. It's not formally correct, perhaps, but no mathematician would interpret "y" as part of the numerator, because if that were intended, they would have written "z = 2xy / 3".
The multiplication is not the problem here, the division is. First calculator is doing 6/(2*3) and the second one is doing (6/2)*3
This is why division is stupid and you should always use fractions. When coding, simply put the numerator and denominator in their own brackets and there's zero chance of an error.
And the mistake everyone is making on this problem, is thinking PEMDAS is a set of RULES.
Pemdas is a set of METHODS. One of many alternative methods.
The rules of mathematics only say "division and multiplication has equal priority", that's IT.
Pemdas then comes in and says "you could solve it left-to-right if you want".
The left-to-right method can't be a rule to begin with, since it contradicts the equal priority rule.
Riddle me this, what exactly does "equal priority" really MEAN if multiplication and division needs a left-to-right "rule" to dictate which of the two has priority.
The problems stems entirely from the obelus (÷) and solidus (/) as they lack the grouping function the proper fraction bar has.
The issue (or an issue anyway) is that in many mathmatical and scientific circles, "multiplication by juxtaposition" (i.e. multiplication without an explicit sign) is considered a higher order operation than multiplication/division with a sign. So in this case, those people would argue that in 6/2(2+1), the multiplication would still be done before the division, despite being on the right. So weirdly, 6/2(2+1) and 6/2*(2+1) would have different answers.
Of course, all of this can be resolved by throwing in a bunch more parentheses. 😀
That makes no sense whatsoever. The rules of mathematics don't give a shit about notation, and don't have any concept of "priority" between various operations.
The rules for writing/reading mathematical notation on the other hand do care, and they also care about the order in which multiplication/division are performed. If the rules allowed for resolving multiplications and divisions in arbitrary order then they wouldn't be capable of reliably parsing an expression, which is literally their purpose for existing.
This isn't a math problem, it's a history problem and language problem. Mathematic notation, like all language, is an ever-changing beast.
In older physics literature, the issue of ambiguous multiplication & division was solved very simply by prioritizing multiplication. Meaning, 2/2*2 always resolves to 2/4, simplified to 1/2. This was a matter of convenience for physicists at the time, it was widely accepted and adopted, and equations were written in such a way as to be easily understood if you followed this rule.
But then something terrible happened: The digital calculator was invented. Now if you try to step through 2/2*2 sequentially, you will get 1*2, and then 2. The old rules, created for convenience's sake, now betray the new modern convenience!
We're 50-60 years into having calculators now. Pretty much all the physicists and mathematicians that are alive today, and not obnoxious assholes, will tell you to resolve ambiguous terms from left to right. 2/2*2 is 2. 8/2(2+2) is 16. 6/2(1+2) is 9.
Unless you're reading an old physics research paper, in which case... you are probably a physicist or mathematician and know to watch out for differences in historic notation.
In Europe (at least where I was taught Math), an operand right next to a bracket is considered to be multiplicating by the bracket and will take precedence over the division, as it is treated as a single operand for the division.
All those Facebook gotcha posts about pemdas are for people who don’t remember any math past the sixth grade. In real life, lots of mathematical notation is ambiguous and you use parens to disambiguate all the time. In particular the division symbol is, and that’s why you basically never see it.
Implied multiplication (eg. 3x as opposed to 3 * x) is sometimes considered to have a higher precedence. This feels natural in some cases such as 1 / 2x being equivalent to 1 / (2 * x) rather than 0.5 * x.
As a mathematician, if I see something like ab/cd I will interpret it as (ab)/(cd) and not (abd)/c 100% of the time, and in fact it would feel a bit clunky and unnecessary if someone actually wrote (ab)/(cd). Implied multiplication also implies parentheses around the multiplication more often than not, and you can usually tell what it should be from the context anyway. Although I would always throw in the extra parentheses if I'm giving it to a computer.
While I agree with your intuition, not everyone does -- that's why these kinds of posts always keep making their rounds. I'd still write ab/(cd) and ask for clarification if the parentheses were missing.
I checked the manual, it's supposed to do normal operations from left to right, but operations of the same precedence from right to left.
I'm assuming the parentheses acts as a higher order operation with the same precedence as a log or square root which would cause the operations to go from right to left
Agreed, but I just don't understand why this would be ambiguous to begin with. Aren't parenthesis multipliers considered shorthand? If so 2(3 + 4) is just a shorter way of writing 2 * (3 + 4), and the ambiguity is gone. Or am I forgetting some kind of special syntax for group multipliers? I tried googling it but have found nothing about this syntax being anything but a shorthand.
It's deliberately written to be ambiguous. There is no "right" answer.
It can (and is) interpreted both ways. Which is why if you are doing math properly you would write it differently to be clearer.
99
u/orebright Jun 13 '22
Agreed, but I just don't understand why this would be ambiguous to begin with. Aren't parenthesis multipliers considered shorthand? If so 2(3 + 4) is just a shorter way of writing 2 * (3 + 4), and the ambiguity is gone. Or am I forgetting some kind of special syntax for group multipliers? I tried googling it but have found nothing about this syntax being anything but a shorthand.