Your quote of my post suffers from Discourse’s habit of eating unescaped asterisks and I failed to escape them properly in my original. Not your fault, not a complaint, just an observation of a potentially confusing artifact for other readers. Also note that in my work I used “*” as the multiply operator while you seem to be using “×”. Neither is wrong, but the difference invites miscommunication.
There are certainly multiple orders of evaluation that can work and deliver the same answers (net of floating point hardware rounding and other distractors). Including starting as you did by refactoring the polynomial taking advantage of distributivity.
And you’re right I did screw that up, both in sequence and in missing some essential keystrokes. In the post you quoted I said (with proper escaping this time):
x^2a*xb*c++
And that should be
x[enter]2^a*x[enter]b*c++ or euivalently
x[enter]2^a*x[enter]b*+c+ depending on your taste.
or even
x[enter][enter]*a*x[enter]b*+c+
Lots of possible permutations just taking advantage of commutivity and associativity.
I screwed around a bit to see if I could figure out how to avoid keystroking the x value twice and I failed. Obviously if one has storage registers you can STO & RCL the x value, but now we’re getting out of the essence of pure RPN and into specific calculator’s implementations of RPN.
Once you have the polynomial you could denote it the usual way. To enter, say 5x^2+4x+3 then, assuming you have a variable named x, you could enter x2'5*x4*+3+. (I have subbed ’ for ^ since I cannot stop markdown from actually carrying out the operation.)
As far as matrices or other algebraic objects, you simply use reverse Polish. If you want AB, you simply type AB* to multiply them and AB+ to add them.
Yes it does take a bit of getting used to. When Bonaccio’s son (you know him under a different name) returned from North Africa, where he had been managing his father’s business (and studying population growth of rabbit colonies) he brought back with him Arabic numbers and tried to show people how much easier they were to do arithmetic with than Roman numbers, he was originally dismissed because they were so much harder to use. Nowadays we laugh, but unfamiliarity is a powerful disincentive.
Something about prying from my cold dead hands is appropriate here.
But indeed. Calculators generally do arithmetic. They don’t do mathematics. RPN is great for arithmetic. I still use a HP-25. Nowadays an app on my phone. But it is the calculator I grew up with at school and university. Anything more complicated than it can manage and I reach for modern tools.
Symbolic manipulation is a whole different problem. RPN would do your head in. Which is why we have an accepted notation in the form it is. When you are working with an algebra with associative, distributive and commutative operators it is easy. Once you add operators that don’t commute the need for clarity forces you down a narrowing path. Lack of the others makes it ever more constrained, but no harder to reason with.
I too used my HP-25C until it died and have the app on my phone, although for nostalgia’s sake rather than daily use. Indeed it was, and still is, a nearly ideal tool for what it was aimed at. Nowadays we all usually do bigger things.
As always for a man of your keen perception and expert background, the rest of your comments are spot-on.
The right tool for the right job makes everything easier.
I would suggest that the “conventional” order of operations also only survives because of its use in an obsolete hand calculator. In fact, I suspect that HP calculators will remain in use (if only in emulated form) for longer than any Texas Instruments product.
Every phone, computer, many watches, etc. all have TI style calculators based on earlier adding machines. I think the vast majority of people needing simple calculations will keep using that format with keypads, keyboards, or by voice, until AI makes humans obsolete.
I have no love of TI calculators. Never owned one, never wanted one.
Infix operator notation with PEMDAS precedence is built into every spreadsheet app and almost every programming language. And a heck of a lot of textbooks and scholarly papers over centuries.
It’ll have lots of staying power, for good or for ill.
OK, maybe not any specific calculator. But I think the reason why most calculators do it that way is just that most calculators do it that way, and everyone’s copying the way their predecessors did it, not because that way actually is in any way inherently better. If we were used to using postfix notation in algebra, it would seem just as natural to us, and the system we currently use would seem cumbersome and unnatural.
My last HP calculator was stolen a couple of years ago, and I almost bought the latest re-re-re-release of the HP-15C last year because I did not want to pay $130 (I have the emulator). I regret that decision—those are quality products that will cast for decades and decades, and suitable for real work by people who actually need to calculate things.
Knuth gave a course on Mathematical Writing at Stanford that is worth looking at. The choice of notation and conventions makes a world of difference.
I collect older calculators and you can see the evolution from adding machines, where everything was addition, to the current PEDMAS style used by everyone, even HP it seems. The first calculators that could do multiplication had keys marked × and ÷ and += and -=. The += and-= keys could work like an Enter key: 2+3 would be typed 2 += 3 +=, which is accidentally similar to RPN. The formula 3×4 is entered as 2 × 3 += (or -=, it didn’t matter), but without a stack or a memory register it couldn’t do 2×3+4×5.
I bought my first calculator when I was in high school, a Commodore SR1400. It was amongst the first to have parentheses but used straightforward arithmetic operations with no precedence levels. At the same time a classmate had a Texas Instruments SR50, which actually used PEDMAS but didn’t have parentheses. I couldn’t say which was better, but the option for parentheses made more sense to me at the time.
I used Commodore calculators until my senior year in college, where I studied Electrical Engineering. There were many non-TI options for scientific calculators back then, such as Rockwell, Casio, Litronix, etc. My final year I “graduated” to a HP 41C calculator and came to love RPN. I never have used a TI calculator, and have none in my collection.
No memory on a slide rule either… at some point you need a pen.
I cannot specifically recall where I was first taught how to parse expressions like \displaystyle a^{\displaystyle b^c}, but consistency and repetition legitimize.
One variable of memory on a slide rule, or arguably two: One from the position of the slide, one from the glass window with the crosshair. Which did come in handy in the not-infrequent case where you needed to multiply a bunch of things all by the same number.
If I’m reading it correctly, Cayley–Dickson construction - Wikipedia seems to give orders of symmetry that PEMDAS follows from highest to lowest; i.e. associativity, commutativity, order, etc.
The symmetries of the real field disappear as the Cayley–Dickson construction is repeatedly applied: first losing order, then commutativity of multiplication, associativity of multiplication, and finally alternativity.
IOW, PEMDAS becomes obligatory when working with higher algebras.
Aside: you keep using this acronym which no one has ever seen outside a propaedeutic textbook and I’m not even 100% sure what it is supposed to mean. [E.g., I guess “E” means exponents, but what about an (admittedly contrived) expression like \log e^x, cf. \sin 3x.]
Let me just say here that a^{b^c} has to mean a^{(b^c)} because {(a^b)^c}=a^{bc}. That said I would always use parens anyway to guarantee that it be unambiguous.
Notice that when we were in 4th grade and wrote
13
21
±—
34
we were using vertical Polish. I can’t get that formatted propperly, but you know what I mean.