# Math problem

**URL:** <https://boards.straightdope.com/t/math-problem/580084>\
**Category:** Factual Questions\
**Created:** [April 28, 2011, 9:54pm UTC](https://boards.straightdope.com/t/math-problem/580084 "2011-04-28T21:54:00Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [April 29, 2011, 3:13am UTC](https://boards.straightdope.com/t/math-problem/580084/41 "2011-04-29T03:13:35Z")

</div>

> [@Chronos](#):
>
> Math does not have an order of operations.

Until you get into studying formal grammars, at which point you realize just how arbitrary all of this really is.

> [@](#):
>
> There is a convention under which the answer to the OP’s problem is 1

[The one used by APL, for example](http://en.wikipedia.org/wiki/APL_%28programming_language%29):

> [@](#):
>
> It has just one simple, consistent, and recursive precedence rule: the right argument of a function is the result of the entire expression to its right.

This means that, if you translated 6÷2(1+2) into APL’s own notation, the interpreter would add 1+2 first (it’s both rightmost, and parentheses matter in APL), multiply that by 2, then divide 6 by the result of that. 1+2 is 3, 3\*2 is 6, and 6÷6 is 1.

It works like this because Kenneth Iverson, its inventor, got sick to death of the kind of crap we’re all hashing out here.

---

<div class="post-metadata">

**Author:** ![Pasta](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pasta](https://boards.straightdope.com/u/Pasta)\
**Post date:** [April 29, 2011, 3:21am UTC](https://boards.straightdope.com/t/math-problem/580084/42 "2011-04-29T03:21:36Z")

</div>

> [@Rigamarole](#):
>
> Can you show me any respected mathematical sources which assume a “convention” other than the standard convention (in which the answer is 9)?

No respected mathematical source would present the expression in that way. It is simply ambiguous. In other words, the convention you are missing is: “Avoid using adjacency to indicate multiplication if there is a division symbol to the left.”

I repeat my language analogy: “The book Jim did Bob give” probably means a particular thing (“Jim gave Bob the book”), but the deeply rooted convention in the language is that you simply shouldn’t write the sentence that way, even though a rigorous application of some set of rules will get you a specific interpretation.

In formal mathematical writing, you will not find 1/2x when x/2 is intended. This a syntactical convention that you probably won’t find stated anywhere, but it is present nonetheless. There are countless other unwritten syntactical conventions that you take without thinking about it, and we are just saying that this is another one that you might not be aware of.

When someone decides to write 1/2x anyway, they usually mean 1/(2x), but it is ambiguous. In particular contexts, the binding of the adjacent symbols is very strong. (For instance, “2[symbol]p[/symbol]” is often (though informally) treated as a single symbol, not to be broken apart.)

I encourage you to type “ **1 / 2 pi** ” into Google and see how it gets parsed. Then try “ **1 / 2 \* pi** ” and see that the parsing is different.

---

<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:** [April 29, 2011, 3:25am UTC](https://boards.straightdope.com/t/math-problem/580084/43 "2011-04-29T03:25:54Z")

</div>

As an aside, I’m finding it a little amusing that the posters who work most directly in mathematics are the ones arguing for ambiguity in adjacency operations.

Not that I’m advocating argument by authority.

---

<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:** [April 29, 2011, 4:22am UTC](https://boards.straightdope.com/t/math-problem/580084/44 "2011-04-29T04:22:11Z")

</div>

> [@Great\_Antibob](#):
>
> As an aside, I’m finding it a little amusing that the posters who work most directly in mathematics are the ones arguing for ambiguity in adjacency operations.
> 
> Not that I’m advocating argument by authority.

Ummmmm . . . no  
I’m saying it is unambiguous and I havn’t even mentioned that since the writer of the problem uses parentheses in one case, then its implied that had they meant to multiply before dividing, they would have used a grouping operator.

[QUOTE=Pasta]  
In formal mathematical writing, you will not find 1/2x when x/2 is intended. This a syntactical convention that you probably won’t find stated anywhere, but it is present nonetheless. There are countless other unwritten syntactical conventions that you take without thinking about it, and we are just saying that this is another one that you might not be aware of.  
[/QUOTE]

So if I write “The Conferderate States of America succeeded.” then my sentence is miswritten and does not say what I intended it to because I don’t want to say they won the Civil War? Just because something is miswritten doesn’t make it correct and if someone wrote 1/2x meaning 1/(2x) but it is properly parsed as (1/2)x, it is not ambiguous or correct anymore than the South won the war because I miswrote “seceeded”

---

<div class="post-metadata">

**Author:** ![SeaDragonTattoo](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@SeaDragonTattoo](https://boards.straightdope.com/u/SeaDragonTattoo)\
**Post date:** [April 29, 2011, 4:48am UTC](https://boards.straightdope.com/t/math-problem/580084/45 "2011-04-29T04:48:22Z")

</div>

I got 9.

All I know is that if I get math wrong, I could kill many of the animal patients I work with. I suck at math and have just the formulas I need in my head to calculate doses based on milligrams per kilograms. So maybe what’s in my head is completely unrelated to the discussion in this thread. I find this stuff fascinating, but my brain just doesn’t comprehend it, and by about a third of the way through this thread my eyes were already glazing over just like they did in high school and college!

The fact that math seems to be open to interpretation and two different answers could each possibly be right based on how you argue the equation, is making my brain leak out of my ears. I wish I could otherwise participate in the argument, I gotta go find some gray matter… :eek:

:smack:

---

<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:** [April 29, 2011, 5:30am UTC](https://boards.straightdope.com/t/math-problem/580084/46 "2011-04-29T05:30:48Z")

</div>

Quoth **Rigamarole** :

> [@](#):
>
> Can you show me any respected mathematical sources which assume a “convention” other than the standard convention (in which the answer is 9)? I’ve never heard of any other convention besides the one that has been explained in this thread already.

What do you mean by “the convention that has been explained in this thread already”? Multiple different conventions have been explained in this thread.

Quoth **Great Antibob** :

> [@](#):
>
> As an aside, I’m finding it a little amusing that the posters who work most directly in mathematics are the ones arguing for ambiguity in adjacency operations.

I wouldn’t exactly say that anyone’s arguing _for_ ambiguity. Several posters (myself included) are arguing that the expression is ambiguous, but that just means that whoever wrote the expression should have made it clearer (by tossing in some more parentheses, or changing the order of the elements, or writing it in numerator-denominator form, or whatever).

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [April 29, 2011, 5:56am UTC](https://boards.straightdope.com/t/math-problem/580084/47 "2011-04-29T05:56:35Z")

</div>

> [@SeaDragonTattoo](#):
>
> The fact that math seems to be open to interpretation and two different answers could each possibly be right based on how you argue the equation, is making my brain leak out of my ears.

This isn’t normal.

But on math it is.

Math. Not even once.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 29, 2011, 7:59am UTC](https://boards.straightdope.com/t/math-problem/580084/48 "2011-04-29T07:59:59Z")

</div>

Look, the very fact that we’re arguing about this ought to be an indisputable indication that there _is_ ambiguity… sure, you can say “According to these rules, it must be parsed this way”, but if those rules do not accurately describe how mathematicians and mathematical tools in practice actually always read and write expressions, then it doesn’t matter; there is still ambiguity. That’s what ambiguity is; not knowing for sure, upon looking at an expression like that, what was intended or how it would be interpreted by someone else.

You could claim “I’d like to thank my parents, John and Sally” can only possibly mean “I’d like to thank my parents, who are John and Sally” and cannot possibly mean “I’d like to thank four people: my parents, John, and Sally” on some theory of the usage rules of the comma, but the truth is that, in practice, as an empirical fact, the interpretation of that sentence is ambiguous (and whatever theoretical usage rules of the comma were being appealed to to say otherwise would turn out not to be universally strictly adhered to). And the same thing here. (In a way, what’s going on in this thread is a clash of descriptivism and prescriptivism… some of us are advocating recognition of the realities of how mathematicians and mathematical tools read and write expressions, while others are advocating strict adherence to a particular set of passed-down rules regardless of whether these rules are universally adhered to in actual practice)

[On another note, too small to need a post of its own:

> [@Saint\_Cad](#):
>
> As a math teacher for 14 years, I can assure you that even if the teachers does not teach multiplication before division, addition before subtraction (and yes I have seen elementary teachers make that mistake many times), PEMDAS is certainly learned that way by many students.

Oh, I have no doubt of this; I think PEMDAS is a terrible mnemonic precisely for not making the intended meaning clear in this way.]

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 29, 2011, 8:14am UTC](https://boards.straightdope.com/t/math-problem/580084/49 "2011-04-29T08:14:42Z")

</div>

> [@Saint\_Cad](#):
>
> (mini rant: what about roots? at least teach PERMDAS or better yet stay away from the mnemonic)

When does anyone use a root operator (e.g., the square root operator) without the intended scope of the operator being explicitly indicated as just what falls under its upper bar? [And, if using a general “nth root” operator, the “n” will be all and only whatever expression is raised up and placed in the appropriate position on the left side of the operator, again explicitly delimited…]. You don’t need (and, indeed, can’t make any actual use of) precedence rules for operators with such explicit delimiting of their scope…

---

<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:** [April 29, 2011, 9:44am UTC](https://boards.straightdope.com/t/math-problem/580084/50 "2011-04-29T09:44:13Z")

</div>

A representation of some thing is always ambiguous because it is not the thing. It is a symbol representing the thing, to some set of minds that agree to it. Any mind may chose to see it as a representation of something else. The written expressions aren’t the math, they are a representation of it. This is how language works, and mathematical expressions are written in languages. The common notations are probably interpreted by most mathematicians in the same way, but it is a sort of slang, because many relationships between the terms are assumed instead of explicit. And general conventions are assumed also, just as in English we assume words and sentences are read from left to right and downwards by line.

I’m a math idiot. But the subject here is the representation of mathematics, and I’ve spent decades dealing with that.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [April 29, 2011, 11:26am UTC](https://boards.straightdope.com/t/math-problem/580084/51 "2011-04-29T11:26:25Z")

</div>

I don’t know why they teach PEMDAS at all. Just remember that the higher order operations come first, and that parentheses change that.

Oh, and I was always told to write, for example, y = 2x/3 rather than y = 2/3x. I was explicitly taught by every teacher I’ve ever had that implied multiplication provides its own scope.

Also, who uses both implied multiplication and the obelus (÷) in the same expression? That’s like using both the raised cross (×) and raised dot (·) or asterisk (\*).

---

<div class="post-metadata">

**Author:** ![Colophon](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@Colophon](https://boards.straightdope.com/u/Colophon)\
**Post date:** [April 29, 2011, 11:43am UTC](https://boards.straightdope.com/t/math-problem/580084/52 "2011-04-29T11:43:56Z")

</div>

Brit here, never heard of PEMDAS, or PEDMAS (both are written several times on this thread, often in the same post!).

The mnemonic we had was BODMAS:

Brackets  
Of  
Divide  
Multiply  
Add  
Subtract

(Most references I can find state the O means “Order”, but we were always taught “Of”.)

6/2(1+2)

Brackets: 6/2( **3** )  
Of: n/a  
Divide: **3** (3)  
Multiply: **9**  
Add: n/a  
Subtract: n/a

---

<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:** [April 29, 2011, 12:04pm UTC](https://boards.straightdope.com/t/math-problem/580084/53 "2011-04-29T12:04:08Z")

</div>

> [@BigT](#):
>
> Also, who uses both implied multiplication and the obelus (÷) in the same expression?

I suspect that’s a big part of the reason for the confusion.

> [@Colophon](#):
>
> Brit here, never heard of PEMDAS, or PEDMAS (both are written several times on this thread, often in the same post!).
> 
> The mnemonic we had was BODMAS:
> 
> Brackets  
> Of  
> Divide  
> Multiply  
> Add  
> Subtract
> 
> (Most references I can find state the O means “Order”, but we were always taught “Of”.)

What do you mean by “Of”? I thought “of” meant multiplication (as in “three-fourths of” or “fifty percent of”).

---

<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:** [April 29, 2011, 12:27pm UTC](https://boards.straightdope.com/t/math-problem/580084/54 "2011-04-29T12:27:28Z")

</div>

Oh, and if you use “BODMAS,” what does that mean you do with your dear Aunt Sally?

---

<div class="post-metadata">

**Author:** ![md2000](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@md2000](https://boards.straightdope.com/u/md2000)\
**Post date:** [April 29, 2011, 12:46pm UTC](https://boards.straightdope.com/t/math-problem/580084/55 "2011-04-29T12:46:37Z")

</div>

The biggest problem in this whole thread is that on paper or from math textbooks (where most of us learned to do math) equations are written properly. It is only the lack of total text editor functions that forces us to put what should be a multiple line division into a linear format.

A  
BC

not to be confused with

AC  
B

Add to that the “implied” multiplication, which is a shorthand we understand. Yes, we say 2x with the implication that stays together, but 2/3x in a linear script can just as easily mean (2/3)x and without the variable, 6/2(3)can just as easily mean (6/2)(3).

However, everything I learned in grade school and high school math in the 60’s and early 70’s. and 4 years of math after that in college, never once did anyone suggest you complete all the multiplications before all the divisions.

The fact that all programming languages also obey the rule of evaluating (add, subtract) from left to right and (multiply. divide) from left to right merely means those languages were constructed to follow what was established convention for mathematics.

There is NO RULE that says implied operations take precedence over explicit operations.

Yes, the problem as written is deliberately erronously ambiguous to trick those who are not looking closely or who have forgotten the fine print of the basic rules of order of precedence.

---

<div class="post-metadata">

**Author:** ![Colophon](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@Colophon](https://boards.straightdope.com/u/Colophon)\
**Post date:** [April 29, 2011, 12:56pm UTC](https://boards.straightdope.com/t/math-problem/580084/56 "2011-04-29T12:56:57Z")

</div>

> [@Thudlow\_Boink](#):
>
> I suspect that’s a big part of the reason for the confusion.
> 
> What do you mean by “Of”? I thought “of” meant multiplication (as in “three-fourths of” or “fifty percent of”).

Of as in the square root of, or fourth power of.

---

<div class="post-metadata">

**Author:** ![Darth\_Panda](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@Darth\_Panda](https://boards.straightdope.com/u/Darth_Panda)\
**Post date:** [April 29, 2011, 1:15pm UTC](https://boards.straightdope.com/t/math-problem/580084/57 "2011-04-29T13:15:36Z")

</div>

I’ve never heard of any of the acronyms - I just recall learning what the order of operations were, and needing to go from left to right (just like reading) whenever dealing with operations of equal precedence. Under this method, I don’t see any ambiguity. Of course, if someone said to me “no, I’d like you to go from right to left” or “do division before multiplication” then I guess I’d get a different answer. I never realised that some people do those things.

---

<div class="post-metadata">

**Author:** ![brickbacon](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@brickbacon](https://boards.straightdope.com/u/brickbacon)\
**Post date:** [April 29, 2011, 1:34pm UTC](https://boards.straightdope.com/t/math-problem/580084/58 "2011-04-29T13:34:28Z")

</div>

Just an FYI: Many kids today learn [GEMS](http://www.acronymfinder.com/Grouping-Exponents-Multiplication-and-division-Subtraction-and-addition-%28Order-Of-Operations-Pneumonic%29-%28GEMS%29.html) instead of PEMDAS. GEMS is **G** rouping symbols, **E** xponents, **M** ultiplication/division, **S** ubtraction/addition. I believe this change was to address the concerns that came up in this thread.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 29, 2011, 4:10pm UTC](https://boards.straightdope.com/t/math-problem/580084/59 "2011-04-29T16:10:29Z")

</div>

Following up on **Jragon** ’s posts above, some interesting observations about Wolfram Alpha’s parser: [“6/2x”](http://www.wolframalpha.com/input/?i=6+%2F+2x) is parsed as 6 / (2x), but [“6 / 2 x”](http://www.wolframalpha.com/input/?i=6+%2F+2+x) is parsed as (6 / 2) x. Yet [“6 / 2e”](http://www.wolframalpha.com/input/?i=6+%2F+2e) is parsed as “(6 / 2)e”. But [“6 / xy”](http://www.wolframalpha.com/input/?i=6+%2F+xy) is 6/(xy), while [“6 / x y”](http://www.wolframalpha.com/input/?i=6+%2F+x+y) is (6 / x)y. Furthermore, [“6 / cos(8)x”](http://www.wolframalpha.com/input/?i=6+%2F+cos%288%29x) is (6 / cos(8))x, and [“6 / 2cos(8)”](http://www.wolframalpha.com/input/?i=6+%2F+2cos%288%29) is (6 / 2) cos(8). However, …

That is, it’s willing to treat juxtaposition differently based on whether there’s spacing involved or not, whether the second argument is a variable as opposed to a constant or result of a function, whether the first argument is a numeric literal or variable as opposed to the result of a function, and a host of other itty-bitty details about its particular choices for lexical analysis.

And the fact that no one can be expected to be aware of all these rules going in to using Alpha, nor can they expect those same rules to be followed in the same way by other tools? That’s what one might call “ambiguity”…

---

<div class="post-metadata">

**Author:** ![CaveMike](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cavemike/32/16379_2.png) [@CaveMike](https://boards.straightdope.com/u/CaveMike)\
**Post date:** [April 29, 2011, 4:24pm UTC](https://boards.straightdope.com/t/math-problem/580084/60 "2011-04-29T16:24:32Z")

</div>

> [@Jragon](#):
>
> Now, Wolfram isn’t God, but it is often pretty good about laying out generalities like that. Now, should it be unambiguous? Yes, it would make the world a much easier place, but just because the order of operations should be followed like law doesn’t mean it IS. The fact is, depending on who is using what, the correct answer will change. “Math” is universally true and correct if you follow the premises, mathematical _syntax_ is a lot closer to natural language in ambiguity sometimes.

Do you or anyone else have a cite that there is an accepted convention that multiplication should be evaluated before division? I see a lot of anecdotal evidence, but I don’t see a cite (maybe I missed it).

Wikipedia supports the notion that the multiplication and division are to be evaluated left-to-right: [http://en.wikipedia.org/wiki/Order\_of\_operations](http://en.wikipedia.org/wiki/Order_of_operations)

[Previous page](https://boards.straightdope.com/t/math-problem/580084.md?page=2)

[Next page](https://boards.straightdope.com/t/math-problem/580084.md?page=4)
