# Order of Operations Question

**URL:** <https://boards.straightdope.com/t/order-of-operations-question/106420>\
**Category:** Factual Questions\
**Created:** [April 30, 2002, 5:28am UTC](https://boards.straightdope.com/t/order-of-operations-question/106420 "2002-04-30T05:28:00Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Netbrian](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@Netbrian](https://boards.straightdope.com/u/Netbrian)\
**Post date:** [April 30, 2002, 5:28am UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/1 "2002-04-30T05:28:00Z")

</div>

After sitting around just randomly thinking for awhile, I begun to truly wonder… What is the origin of the Order of Operations? Why is it what it is? When new mathematical operations are invented, whom decides where they fit in to the order of operations?

---

<div class="post-metadata">

**Author:** ![David\_Simmons](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@David\_Simmons](https://boards.straightdope.com/u/David_Simmons)\
**Post date:** [April 30, 2002, 6:11am UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/2 "2002-04-30T06:11:36Z")

</div>

> [@](#):
>
> \*Originally posted by Netbrian \*  
> \*\*After sitting around just randomly thinking for awhile, I begun to truly wonder… What is the origin of the Order of Operations? Why is it what it is? When new mathematical operations are invented, whom decides where they fit in to the order of operations? \*\*

For example: “Add or subtract before you multiply or divide.” This rule arises because multiplication is distributive with respect to addition. That is:

a(b + c) = ab + ac

So you must add b and c together before you multiply by a, or else multiply each of them separately by a before adding.

---

<div class="post-metadata">

**Author:** ![robinc308](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@robinc308](https://boards.straightdope.com/u/robinc308)\
**Post date:** [April 30, 2002, 6:17am UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/3 "2002-04-30T06:17:29Z")

</div>

If you’re talking about arithmetic operations, at school we were always taught:

BODMAS (or BOMDAS)  
Brackets before Of before Division before Multiplication before Addition before Subtraction

Except that Division and Multiplication are done together, as are addition and subtraction. If I recall correctly, you should insert Exponents between the Brackets and Division/Multiplication. I can’t even remember what the “Of” does.

So if you had 4 + 3^2 \* 5 - 3 / (1 + 2) you would work it out like:  
1: Brakets -\> 4 + 3^2 \* 5 - 3 / 3  
2: Exponents -\> 4 + 9 \* 5 - 3 / 3  
3: Division -\> 4 + 9 \* 5 - 1  
4: Multiplication -\> 4 + 45 - 1  
5: Addition -\> 49 - 1  
6: Subtraction -\> 48

I hope I understood the OP properly…

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [April 30, 2002, 2:01pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/4 "2002-04-30T14:01:27Z")

</div>

The order of operations was designed to match the way we talk about things in English. There’s an old GQ thread from last summer entitled “Please Excuse My Dear Aunt Sally” in which I explained this in greater detail than I can right now. Search on that for some info.

As for new mathematical operations…well, there really aren’t any fundamentally new ones being invented. Not something to worry about, I’d say.

---

<div class="post-metadata">

**Author:** ![easy\_e](https://avatars.discourse-cdn.com/v4/letter/e/eb8c5e/32.png) [@easy\_e](https://boards.straightdope.com/u/easy_e)\
**Post date:** [April 30, 2002, 2:12pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/5 "2002-04-30T14:12:11Z")

</div>

> [@](#):
>
> \*Originally posted by David Simmons \*  
> \*\*
> 
> For example: “Add or subtract before you multiply or divide.” This rule arises because multiplication is distributive with respect to addition. That is:
> 
> a(b + c) = ab + ac
> 
> So you must add b and c together before you multiply by a, or else multiply each of them separately by a before adding. \*\*

You have this backwards. You muliply or divide before you add or subtract.

However, you follow parentheses or brackets first, which is why you add first in the example you gave.

---

<div class="post-metadata">

**Author:** ![Netbrian](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@Netbrian](https://boards.straightdope.com/u/Netbrian)\
**Post date:** [April 30, 2002, 2:26pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/6 "2002-04-30T14:26:17Z")

</div>

Robin: I may have been unclear. What I was getting at is asking why the order of operations was designed the way it was.

And I’ll search for the other thread as soon as I get home, and see what it said.

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [April 30, 2002, 3:23pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/7 "2002-04-30T15:23:57Z")

</div>

Try [this](http://mathforum.org/dr.math/problems/huffine.11.22.00.html):

l

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [April 30, 2002, 4:22pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/8 "2002-04-30T16:22:59Z")

</div>

Actually, quite a few new operations have been invented in recent decades and order of precedence has to be worked out. But in the realm of computer languages. Take the following expression:

x != 4\*y | a^3^b \> 50872

Where:  
!= is “not equal”  
| is logical “or”  
^ is exponentiation.

Clearly you want to do the arithmetics, then the relations, then the Boolean operations. (Although Wirth screwed this up in designing Pascal and Modula and you have to insert parens.) OTOH, a few languages have only one precedence rule: go left to right period.

Note also that it’s a good idea to have a^3^b to be interpreted as a^(3^b) and not (a^3)^b as the latter is the same as a^(3\*b) which is much clearer when written that way. Hence exponentiation is (usually) right associative unlike most other operations. (Oddly, quite a few computer languages don’t have an exponentiation operator.)

Languages such as C/C++ have dozens of operators, all of whose order and associativity have to be exactly spelled out. There’s even a ternery operator! In C++ you can extend the meaning of operators, but you are stuck with the original precedence rules. E.g., you can “overload” + to mean string concatenation. In C++, brackets ("[" “]”) themselves are operators. C++'s rules are a lot more sane than Pascal’s. But there are still weird cases, such as when using some operations involving pointers and structures (records) together.

In the case of computer languages and the OP: It is the designer of the language that determines the precedence rules. No two designers have to agree. Ditto which operators to include and what symbols to use ("^" vs. “\*\*” for exponentiation).

I could also ramble on about strange operators you might find in academic papers in logic and mathematics, but this is enough for now.

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [April 30, 2002, 4:55pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/9 "2002-04-30T16:55:27Z")

</div>

> [@](#):
>
> \*Originally posted by ultrafilter \*  
> **The order of operations was designed to match the way we talk about things in English.**

Given that English was not the preferred language of mathematics at the time modern algebraic notation came into use, I very much doubt that this is the case. Until recently, most mathematical research and pedagogy was conducted in Latin, and expressing even the most simple mathematical statements was incredibly convoluted. Take this famous line by Fermat:

> [@](#):
>
> Cubum autem in duos cubos, aut quadrato-quadratum in duos quadrato-quadratos, et generaliter nullam in infinitum ultra quadratum potestatem in duos eiusdem nominis fas est dividere cuius rei demonstrationem mirabilem sane detexi.

All that work just to say that you can’t have x[sup]n[/sup] + y[sup]n[/sup] = z[sup]n[/sup] for n \> 2. In fact, by the time modern notation was taking hold, we hadn’t completely liberated ourselves from the Greek idea that numbers were tied to geometrical figures and line segments.

---

<div class="post-metadata">

**Author:** ![David\_Simmons](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@David\_Simmons](https://boards.straightdope.com/u/David_Simmons)\
**Post date:** [April 30, 2002, 5:38pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/10 "2002-04-30T17:38:28Z")

</div>

> [@](#):
>
> \*Originally posted by easy e \*  
> \*\*
> 
> You have this backwards. You muliply or divide before you add or subtract.
> 
> \*\*

I think maybe you are right. The mnemonic came from my grade school days which were a long time ago. Maybe I needed a mnemonic to recall the mnemonic.

Maybe this will teach me to think a little before answering, do you suppose? Nah.

---

<div class="post-metadata">

**Author:** ![jawdirk](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@jawdirk](https://boards.straightdope.com/u/jawdirk)\
**Post date:** [April 30, 2002, 6:11pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/11 "2002-04-30T18:11:45Z")

</div>

Mathematically, all you really need is parentheses.  
a\*(b+c)=(a_b)+(a_c) regardless of whether addition comes before multiplication or vice versa.

The scientific order of operations is:

1. A standard to avoid confusion among scientists
2. Designed to minimize the use of parentheses
3. Fairly intuitive to humans.

Calculators often use a left to right order of operations, i.e.  
1+2_4=12. If they don’t have memory or parentheses, this can be a problem. (89_53)+(83_101) requires scratch paper or operator memory with such a calculator. Of course, if there was a scientific calculator without memory or parentheses, (1036+897)_(6789+5021) would require scratch paper or operator memory.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 1, 2002, 3:22pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/12 "2002-05-01T15:22:21Z")

</div>

> [@](#):
>
> \*Originally posted by psychonaut \*  
> **Given that English was not the preferred language of mathematics at the time modern algebraic notation came into use, I very much doubt that this is the case. Until recently, most mathematical research and pedagogy was conducted in Latin, and expressing even the most simple mathematical statements was incredibly convoluted.**

I knew that, but didn’t want to get into it cause not everyone knows that. Replace “English” with “natural language” in my post and see what you think.

---

<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:** [May 1, 2002, 4:25pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/13 "2002-05-01T16:25:15Z")

</div>

> [@](#):
>
> Mathematically, all you really need is parentheses.

Naw… Mathematically, all you need is a stack :). Why yes, I do use an HP calculator, why do you ask?

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [May 1, 2002, 7:35pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/14 "2002-05-01T19:35:50Z")

</div>

> [@](#):
>
> \*Originally posted by ultrafilter \*  
> \*\*I knew that, but didn’t want to get into it cause not everyone knows that. Replace “English” with “natural language” in my post and see what you think. \*\*

I think you don’t realize that not every natural language has English’s subject-verb-object (SVO) word order. In fact, 60% of the world’s languages, including Latin, use some other ordering. If the precedence and associativity of mathematical operators really were based on Latin grammar, which usually uses SOV, everything would probably be in Reverse Polish Notation. For example, instead of writing “5 + 3 = 2 + 6”, we would write “5 3 + 2 6 + =”.

Given that our modern system of mathematical notation arose gradually and haphazardly over hundreds of years, with contributions from dozens of mathematicians with different native tongues, I think it’s safe to say that there is no short answer to the question of how operator rules were established.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 1, 2002, 8:40pm UTC](https://boards.straightdope.com/t/order-of-operations-question/106420/15 "2002-05-01T20:40:32Z")

</div>

> [@](#):
>
> \*Originally posted by psychonaut \*  
> **I think you don’t realize that not every natural language has English’s subject-verb-object (SVO) word order. In fact, 60% of the world’s languages, including Latin, use some other ordering. If the precedence and associativity of mathematical operators really were based on Latin grammar, which usually uses SOV, everything would probably be in Reverse Polish Notation. For example, instead of writing “5 + 3 = 2 + 6”, we would write “5 3 + 2 6 + =”.**

I’m well aware of Latin word order, having taken it for two years. Actually, the more I think about it, the more I think that I’m confusing cause and effect here.

> [@](#):
>
> **Given that our modern system of mathematical notation arose gradually and haphazardly over hundreds of years, with contributions from dozens of mathematicians with different native tongues, I think it’s safe to say that there is no short answer to the question of how operator rules were established.**

This is probably very true.
