Equation: Order of operations

I actually have a couple/few HP calculators. It’s been years since I’ve done reverse Polish notation though, and I’d have to study to use them.

The iPhone calc does that, too.
But, I would never in a million years expect it to do the correct order of operations without adding parentheses.

Actually, you don’t. You just input the numbers and do the operations in imperative order. No parentheses or questions of operator precedence; you just operate upon the one or two numbers on the top of the stack without any ambiguity.

Stranger

But I’d have to get used to it again. I rarely use calculators anymore.

It is literally just the order of operations that you indent without interpretation. In the case of the equation of the o.p., the RPN sequence would be:

6 2 1 2 + * ÷

Stranger

See, that’s what I’d have to re-learn.

How does that look in PEMDAS? I think it’s 6 + 2 x (1 + 2) = 1.

You don’t have to worry about how to interpret it in PEMDAS; the “order of operations” in RPN is explicit because it is imperative. There is no ambiguity over what operation is done in which sequence.

Stranger

My view is that this equation is the mathematical equivalent of “I shot a bear in my pajamas”. It could be interpreted both ways and whoever wrote it should have used additional notation to make it clear which was they way they intended it to be parsed.

As I learned many decades ago, in the dark ages when a calculator was HB not HP, PEMDAS was explicitly MD are the same, so done in the order encountered from left to right. Ditto for AS. If it is 6/2x3 then the first operator encountered to the left is “/” and division is done first, we get 3. Then the “x” is encountered, 3x3 = 9.

By the time I got to university and actual math, the general rule of thumb was to not use “÷” except in very simplistic and unambiguous equations. If there would be any ambiguity about order, use parentheses.

So this should have been written

6x3


2
Or if it were meant the way it is being interpreted by the OP:

6


(2x3)

PEMDAS has a precise meaning, but people may misinterpret it. I see a math puzzler on Instagram who loves to throw a series of multiplies and divided-by’s like this, and better yet, divided by fractions, to confuse viewers. “(1/7)÷7÷(1/7)÷7”

Flat and linear text is confusing. Ambiguous equations are a no-no because the person reading them does not know if they are interpreting them wrong or if you wrote the original wrongly. When they are meaningful rather than an arithmentic exercise, that is important.

Indeed, there are ISO or whatever standards for technical documents, which explicitly say never to write an ambiguous expression like the OP.

Pretty weird notation, but the obelus drawing attention to itself like that makes me parse it as

\frac{6}{2(1+2)}

Knowing the original context might help. Why was it not written (for instance)
6\big/2(1+2) ???

Sure

And yet in books written by no less than Donald Knuth, 1/xy = 1/(xy) (indeed, why would you ever read it any other way?) The real rule is, if some notation is confusing, don’t use it.

Not a math puzzler so much as line noise

Good point. There’s that ambiguity in meaning again.

I always interpreted two terms together without an operation as the equivalent of brackets around a multiplication. xy is the same as (xy) so 1/xy = 1/(xy)

I’m not aware of any instances where that was not the interpretation, although I’ve never seen an explicit statement of that. It was just something taken for granted in science.

Just, you can’t do that with more than one digit…

1/2y = 1/(2y). whereas 1/2×y is (1/2)y or 1/10y=1/(10y) and 1/62 is 1/(62) not 1/6×2

Hence, when an equation is more than just a mathematical exercise, it is important to avoid ambiguity.

That’s also how I would characterize the puzzle in the OP. It’s just someone being clever asking the OP to solve something that looks very different from how it would normally be written. Those who spent far too many years in academia playing with equations are a lot more familiar with the nuances - but I still get caught by that stuff when I’m not paying close attention. And like a lot of puzzles, once you see the triick, it’s harder to get confusd the next time.

When I saw (1/7)÷(4/3) my first inattentive instinct was to multiply, not divide.

Right, this stuff shows up on social media often, usually with a nonsense caption like “only 1% of people can get this right.” It’s a made-up equation deliberately designed to be ambiguous, so the whole exercise is rather pointless.

In a career teaching Computer Science it was always MD before AS. In each group it was from left to right. So the division is done before the multiplication in the OP example.

I never, ever saw anyone anywhere in CS who had an alternate interpretation for everyday math equations.

But that doesn’t mean there wasn’t oddball stuff. Niklaus Wirth, for example, decided that logical operators had higher precedence that mathematical ones in Modula-2. So that “if x<y and z=5 then …” was considered a mess. (It would think your were trying to “and” y and z.) You basically always had to use parens when logical operators were used.

These “alternate answers” stuff is nothing but clickbait. It has nothing to do with real life stuff.

Wow, we’re slipping, it took 28 posts to get the correct answer this time. The correct answer is that the original expression is ambiguous and could be misleading in how it should properly be interpreted, and so whoever wrote it in the first place should have written it differently to be more clear.

Yes, and not all calculators will interpret the OP’s expression in the same way.

But the point is, the original expression is NOT ambiguous under the rules, it’s just written in an unusual manner (using the divided-by sign) that people rarely encounter and so is liable to misinterpretation unless someone is a math pedantic. Yes, it should have been written more explicitly, but then it wouldn’t be click-bait, would it?

I mean who writes 8÷¾×½÷¾ ? It’s meant to be deliberately confusing and deceptive since it’s rarely encountered.

I see no ambiguity whatsoever.

It is ambiguous. Implied multiplication has precedence over explicit multiplication or not?

Parentheses take precedence, then exponents. Multiplication and division come next, working from left to right. Neither is superior to the other. Lastly comes addition and subtraction, again from left to right and neither is superior to the other.

You’re making the claim that 1/xy = y/x and that truth is unambiguous.

That, I think, is a minority opinion.