# Math Q: Who invented the Order of Operations?

**URL:** <https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061>\
**Category:** Factual Questions\
**Created:** [October 3, 2023, 6:35pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061 "2023-10-03T18:35:54Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [October 4, 2023, 1:42am UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/21 "2023-10-04T01:42:49Z")

</div>

Yes, thanks to all for the answers. Very interesting.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [October 4, 2023, 1:52am UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/22 "2023-10-04T01:52:22Z")

</div>

Once you get used to RPN, you realize that that’s what you always do when doing math yourself; it’s just usually not notated that way.

Of note, you need an “ENTER” key, or the like, to use between numbers, so you can distinguish “Four Three Two” from “Four Hundred Thirty-Two”. So @Hari_Seldon 's example should read

```auto
4[Enter]2[Enter]3+*
```

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [October 4, 2023, 2:16am UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/23 "2023-10-04T02:16:39Z")

</div>

> [@Hari\_Seldon](#):
>
> 423+\* means apply the + operator to the last two operands, giving 5, leaving 45\* and then the times operator to those giving 20. By the same logic 423\*+ = 10. This is exactly how an RPN calculator works. Unambiguous and free of parens. Incidentally, if you do your income tax return by hand, this is also how you can do it most efficiently. Only its unfamiliarity makes it seem hard.

RPN needs some kind of symbol or key entry to let it know that 423 is not one number. On an HP calculator, you’d type:

4 {enter} 2 {enter} 3 + \*

---

<div class="post-metadata">

**Author:** ![Marvin\_the\_Martian](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/marvin_the_martian/32/2898_2.png) [@Marvin\_the\_Martian](https://boards.straightdope.com/u/Marvin_the_Martian)\
**Post date:** [October 4, 2023, 3:11am UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/24 "2023-10-04T03:11:24Z")

</div>

In RPN the operator (or equivalent) is not just a separator, it is an instruction to push the current value onto the stack. Other operators pop a value off the stack and perform an operation between that value and the current value, with the result becoming the new current value.

Very simple to implement in hardware and easy to key into a calculator, but not IMHO very readable.

---

<div class="post-metadata">

**Author:** ![Saffer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saffer/32/6440_2.png) [@Saffer](https://boards.straightdope.com/u/Saffer)\
**Post date:** [October 4, 2023, 11:44am UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/25 "2023-10-04T11:44:43Z")

</div>

> [@Saint\_Cad](#):
>
> I think there is great love for Reverse Polish Notation.

By far my favourite

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [October 4, 2023, 12:25pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/26 "2023-10-04T12:25:29Z")

</div>

> [@Hari\_Seldon](#):
>
> For me, RPN seems ideal.

What does, say, a polynomial look like in RPN?

Would you use it for expressions involving, say, matrices or vectors?

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [October 4, 2023, 1:06pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/27 "2023-10-04T13:06:38Z")

</div>

Isn’t a space the usual delimiter for writing out RPN? The example given was confusing as heck to me as 432 was written out as a single number.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [October 4, 2023, 1:39pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/28 "2023-10-04T13:39:08Z")

</div>

> [@Thudlow\_Boink](#):
>
> What does, say, a polynomial look like in RPN?

ax2 + bx + c turns into  
x^2a\*xb\*c++ or equivalently  
x^2a\*xb\*+c+ depending on your taste.

It’s essentially just rattle off the inputs and operators in the sequence you’d perform the calculation by hand.

Which works well for actual calculation with numbers resulting in a number, but is less than convenient for symbolic manipulations, like factoring that same polynomial into (x+d)(x-f) format.

> [@Thudlow\_Boink](#):
>
> Would you use it for expressions involving, say, matrices or vectors?

You could. Given suitable mechanisms for denoting or storing vectors and matrices. Again it’s simply a matter of writing  
[operand][operator] or  
[operand1][operand2][operator]  
in preference to some other way of indicating what is to be done to who. It’s particularly suited to denoting scalar values and unary/monadic and binary/dyadic operators. But it doesn’t have to be limited to just that.

The fact its popularity is almost entirely down to one brand of long-obsolete hand calculators sorta suggests its real strengths lie near that use case, not in general mathematical or computer programming discourse.

---

<div class="post-metadata">

**Author:** ![Great\_Antibob](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Great\_Antibob](https://boards.straightdope.com/u/Great_Antibob)\
**Post date:** [October 4, 2023, 1:52pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/29 "2023-10-04T13:52:27Z")

</div>

Yes, that kind of gets to the heart of it.

The easiest way for human beings to _read_ mathematical expressions or at least with the most clarity is not necessarily optimal from the sense of disambiguation or for mechanical calculation

---

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [October 4, 2023, 2:29pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/30 "2023-10-04T14:29:49Z")

</div>

> [@Great\_Antibob](#):
>
> The easiest way for human beings to _read_ mathematical expressions or at least with the most clarity

Except that’s what students do rather than OoPs. 3 + 7 x 2 becomes in their head reading left to right Three plus Seven times Two.  
Maybe we should rewrite expressions to be read left to right as our new order of operations so that if I want multiplication first I would have to do 7 x 2 + 3

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [October 4, 2023, 2:41pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/31 "2023-10-04T14:41:40Z")

</div>

> [@Saint\_Cad](#):
>
> Maybe we should rewrite expressions to be read left to right as our new order of operations so that if I want multiplication first I would have to do 7 x 2 + 3

The problem with that approach is it can only be sufficient for very, very simple expressions when using “infix” (= operator between operands) notation.

Try rearranging this expression using your idea:  
3 x 4 + 7 x 2  
You can’t.

RPN as discussed above is a solution that _does_ reorder things to be left-to-right with no built-in precedence for e.g. multiplication over addition. At the expense of creating an implicit or explicit stack of intermediate partial solutions, and sacrificing infix operators for post-fix operators.

  

Further, all this comes back to the difference between teaching kids to calculate versus teaching (older?) kids to understand and manipulate formulas as formulas, not just plugging in input values to arrive at a result value.

Understanding very basic algebra concepts like the commutability, associativity, and distributivity would be hampered if our notation drove how we expressed those ideas.

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [October 4, 2023, 2:54pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/32 "2023-10-04T14:54:55Z")

</div>

In the future the graphic representation of expressions will be adjustable to the display device and your choice of operator precedence and order of operations will be selectable to your preference along with the representation of all the other elements of the expression. It is rather easy to convert expression format between defined systems. Discussions like this about the limitations and limited choices of hard text based expressions will seem rather quaint. Many coding studios already have the feature of adding parentheses to expressions for clarity and offering optimizer hints and tips for expression syntax alternatives.

---

<div class="post-metadata">

**Author:** ![Great\_Antibob](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Great\_Antibob](https://boards.straightdope.com/u/Great_Antibob)\
**Post date:** [October 4, 2023, 2:57pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/33 "2023-10-04T14:57:51Z")

</div>

> [@Saint\_Cad](#):
>
> Except that’s what students do rather than OoPs. 3 + 7 x 2 becomes in their head reading left to right Three plus Seven times Two.

Exactly what I meant

An expression like 3 + 7 x 2 is very easy for us to read. But it requires disambiguation to determine if the multiplication should be done first or not, which is what an Order of Operations is intended to do.

RPN resolves this issue from a mechanical calculation standpoint but it’s not intuitive for us to read and parse.

An “Order of Operations” is more of a bridge between natural human language and mathematical calculation than something that is inherently necessary for mathematical expression.

It’s very easy to say “well, everybody should just follow ‘the’ order of operations” but that misses the point. The purpose of an order of operations is to make it easier for people to communicate mathematical expressions unambiguously, not to provide arbitrary rules for people to follow thoughtlessly.

---

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [October 4, 2023, 3:03pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/34 "2023-10-04T15:03:17Z")

</div>

Just thought of something. You know how people can’t agree how 60 ÷ 2(3 + 2) should be calculated via order of operations? RPN makes it unambiguous.

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [October 4, 2023, 3:14pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/35 "2023-10-04T15:14:59Z")

</div>

It’s no more or less ambiguous in RPN. Any expression is ambiguous if the rules aren’t known. RPN is a name for some simple rules, PEMDAS is a name for slightly more complex rules.

---

<div class="post-metadata">

**Author:** ![Marvin\_the\_Martian](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/marvin_the_martian/32/2898_2.png) [@Marvin\_the\_Martian](https://boards.straightdope.com/u/Marvin_the_Martian)\
**Post date:** [October 4, 2023, 3:37pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/36 "2023-10-04T15:37:17Z")

</div>

> [@LSLGuy](#):
>
> Which works well for actual calculation with numbers resulting in a number, but is less than convenient for symbolic manipulations, like factoring that same polynomial into (x+d)(x-f) format.

Exactly the point I made about readability. I couldn’t fathom doing algebra in RPN.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [October 4, 2023, 3:49pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/37 "2023-10-04T15:49:12Z")

</div>

> [@TriPolar](#):
>
> It’s no more or less ambiguous in RPN. Any expression is ambiguous if the rules aren’t known. RPN is a name for some simple rules, PEMDAS is a name for slightly more complex rules.

Agree 100%.

But it is also true that the more complex the rules the greater the odds there will be unnoticed corner cases. Witness the Federal tax code.

Or, more realistically for something as time-worn and well-tested as PEMDAS, the greater the likelihood that the more complex rules will be misunderstood or misremembered in a simplified form which causes mistakes and exposes what looks like corner cases that aren’t really per the no-kidding actual rule, but are per the simplified caricature rule that most non-experts think they accurately learned or remember.

Viewed in isolation the upside to RPN is its comparative simplicity over PEMDAS. After that, much like Dvorak keyboards, it’s mostly esoterica for esoterica’s sake.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [October 4, 2023, 3:54pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/38 "2023-10-04T15:54:25Z")

</div>

> [@Great\_Antibob](#):
>
> The purpose of an order of operations is to make it easier for people to communicate mathematical expressions unambiguously

…and to be able to work with and manipulate them in a way that is as convenient, flexible, and intuitive as possible.

---

<div class="post-metadata">

**Author:** ![filmore](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@filmore](https://boards.straightdope.com/u/filmore)\
**Post date:** [October 4, 2023, 4:30pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/39 "2023-10-04T16:30:49Z")

</div>

I loooove RPN for calculator work, but I don’t like it for written notation. With written RPN notation, I have to do the full calculation from left to right to understand what’s happening. But with PEDMAS, I can visually see the big jumps and small changes that lead to the answer. It’s easier for me to read “10x4+4” than “10,4x4+”. But it’s easier for me to compute “10,4x4+” with my beloved, decades old HP calculator than to compute “10x4+4” on a traditional calculator.

---

<div class="post-metadata">

**Author:** ![DrCube](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@DrCube](https://boards.straightdope.com/u/DrCube)\
**Post date:** [October 4, 2023, 4:31pm UTC](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061/40 "2023-10-04T16:31:45Z")

</div>

It’s basically the exact same process for English grammar, except math is supposedly a universal language, so there aren’t thousands of different versions, like there are different grammars for different languages.

Grammar evolved naturally over time. Much later, people started writing down the rules of grammar as they understood them, and then teachers started treating them like indisputable, set-in-stone rules, and smacking students’ fingers with rulers whenever they got it wrong.

But nevertheless, it is _not_ set in stone, different people will express the same ideas in different ways, and some care and communication needs to happen in order to avoid ambiguity and confusion. Even in a supposedly universal, standardized, rule-based language like mathematics.

[Previous page](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061.md?page=1)

[Next page](https://boards.straightdope.com/t/math-q-who-invented-the-order-of-operations/991061.md?page=3)
