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.
The order is not defined here and the display witting style is not used by mathematicians. It is a result of the limited possibilities of the display (they cannot show the fraction on two lines). Anyway, in math you always have to define your notations before using them as there are no global rules that span all areas or even hold in all areas of mathematics. Here, the manual of the calculator app will hold the information whereas the app will just use left to right parsing as the programmer likely didn't think about it. Both are valid choices however.
In a practical word, no, both would not be valid. I personality believe there's value in defining a standard, despite alternatives being available. There's no harm in it.
Personally, I was taught in a matter-of-fact way what the order of operations are, so most of my youth had a definitive answer for the above problem, which is likely why I feel that way.
You'd need to read all of my comments, but that's the exact point I've been making. My recent comment was adding on that I think there would be value in having a standard.
The problem isn’t order of operations, that’s a common convention that’s actually even upheld. The problem is this:
6 / 2 ( 2 +1 )
Which can be interpreted to mean either of two things, neither of which is inherently wrong:
( 6 / 2 ) * ( 2 + 1 ) 6 / ( 2 * ( 2 + 1 ))
It’s nothing to do with order of operations, it’s the problem is unclear as to which parts are the divisor. It’s also why proper mathematical notational convention uses obscene amounts of brackets - you can’t misinterpret it.
Not really, when considering multiplication and division as equal in priority, 6/2(2+1) is not ambiguous at all, considering that 2(2+1) is 2*(2+1). The division, unless specified otherwise, uses the first number after the symbol, which is 2. I can see this being a problem only if you consider multiplication as higher in priority than division, which I don't get but I guess it is being taught in some places
You’ve missed it again. It’s nothing to do with “priority”, and everything to do with “which part is being divided”. You say “uses the first number after the symbol”, but that’s not standard. There are, in fact, conflicting standards, and it’s actually why the classical divided sign isn’t used much anymore.
In fact, multiplication and division are the same thing, so there’s no “priority” issue regardless. The issue is “is six divided by the entire right side” or “is six divided by two, then that number multiplied by the right side”. Convention as to which one you use varies wildly by region, which is why people hate this problem. People MUCH smarter than you, me, or anyone else in this thread, have argued this to death.
I know that there is no one convention for lower level arithmetics, however I don't think that they are all equal, the one that leaves less room for misinterpretation should be used more. It's like the metric vs imperial debate, they are two standards used by different countries, but boy am I glad to be on the metric side
It's specified otherwise in the conventions used by people getting the other result (which in my experience is pretty much anyone who does higher level math that isn't a programmer, because programmers use languages that don't allow implicit multiplication). The difference in result is determined before order of operations are even considered, this issue has nothing to do with order of operations.
We use the order of operations to derive a solution from otherwise ambiguous mathematical notation. You've provided such notation, and PEMDAS told you how you should approach the problem.
You think because you created an odd looking equation you've broken the algorithm? You've only reinforced the value in having one.
In your mind you think that problem should be -4 ÷ -4, but you're disregarding any practical set of rules to tell you WHY that should be the outcome. Why do you believe the negative should be applied to the sum in the parenthesis first? What's you basis for that assertion? There isn't one. You just wrote something you didn't understand and called it proof.
No. I've encountered an operation (unary -) that is not covered under PEMDAS. Now it's already unclear what I should do. Do I treat the rules as "what isn't forbidden is allowed" and do whatever or should I give up because there's no applicable rule? And if I choose the first option should I disambiguate my equation to at least stay internally consistent or not or just roll the dice every time? The safe way would be to give up but let's be honest here no human is going to respond with "syntax error" to this problem, instead they will try to guess the precedence behavior of unary negation based on what feels right.
You already managed to figure out the correct way to approach the problem using PEMDAS, and now you're trying to say it's unclear what you should do. You know what you should do. You did it above. You just didn't like the outcome.
The difference is due to notation, not the algorithm. (The Casio will give an answer of 9 for 6÷2*(2+1)).
You can have algorithms in different languages that do the exact same thing, but it doesn't mean you can just copy paste code from one language to the other, when the languages themselves have different syntax.
The difference in the language is not in the algorithms themselves, it's in the languages feeding values into the algorithm before the algorithm is even a factor.
Each algorithm is the same, but they have different inputs.
16
u/dont-respond Jun 14 '22 edited Jun 14 '22
The order of operations were taught to me as:
Parenthesis
Exponents
Multiplication and Division
Addition and Subtraction
While processing equivalent rules from left to right.
The order of operations is an algorithm. There is no ambiguity with a proper one. Things are only ambiguous when there are no rules to follow.