Jump to content

Talk:Order of operations

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

left to right

[edit]

I am not surprised that my removing the false information "operations with the same precedence are generally performed left to right" was reverted. So many people have been taught that false "rule" in grade school that many people insist that what they learned in grade school is true. But all mathematicians know that addition is commutative and associative and multiplication is commutative and associative, and mathematicians generally perform operations in whatever order is most convenient.

It is a bit ironic that I think 12/6*2 = 4, which is what you get when you perform operations left to right. But most physicists insist that 12/6*2 = 1. Of course, my reasoning has nothing to do with left to right. It makes sense to me that subtraction is addition of the opposite and division is multiplication by the reciprocal. It is strange that after all these centuries, there is nobody who can settle the question. Rick Norwood (talk) 10:02, 5 September 2023 (UTC)[reply]

You might see from my edit summary that my reason for the revert was that your new text was flawed, too (as was/is the previous text). If you come up with a better suggestion how to fix the false information, I won't object.
As for your 2nd paragraph above, there is no question to be settled - it is very common in mathematics that different authors introduce different ("local") conventions and use them afterwards. - Jochen Burghardt (talk) 17:14, 5 September 2023 (UTC)[reply]
Agreed. Mathematics is a human language and like any other human language there are variations and no universal "correct" standard. This article presents a set of conventions that are not universally applicable as there is not a set of rules that are universally applicable.
Also agree that the current wording is flawed. Where there is a specification to be followed (e.g. computer languages, spreadsheet and other number crunching software) almost everything evaluates addition/subtraction left-to-right (with subtraction interpreted as adding the inverse)* while other non-transitive operations such as division and exponentiation are sometimes left-to-right and sometimes right-to-left. Hence all those ambiguous memes that have everybody arguing on facebook.
In short, there is no convention for evaluating expressions like 12/6*2. And we shouldn't imply that there is.
Perhaps we should say something like addition and subtraction is usually performed left-to-right but there is no general agreement for division or exponentiation. We'd need a good source to back it up, and it may be a distraction this early in the article. Or we could just remove the sentence. Not really sure what is the best approach.
  • And when done this way, there's no need for a rule since you get the same result due to associativity.
Mr. Swordfish (talk) 18:31, 5 September 2023 (UTC)[reply]
Do you have a source for "But most physicists insist that 12/6*2 = 1."? 62.46.182.236 (talk) 23:00, 24 February 2024 (UTC)[reply]
Yes, very strange that this claim went unchallenged!
Unless perhaps something has changed very drastically in the decades since I studied physics that would explain such a claim? I have heard that physics is in a bad shape, and this would explain a lot. So I would be happy to be enlightened. 118.208.8.117 (talk) 04:21, 24 November 2024 (UTC)[reply]
This is a more-than-a-year-old conversation and the article has since been improved to discuss this point in much greater detail. To reiterate though, people rarely if ever write anything similar to . What they do routinely write is expressions like , which is interpreted to mean . –jacobolus (t) 03:47, 12 December 2024 (UTC)[reply]
Unless otherwise stated, the default convention is left-to-right. Physics journals use a different convention to save space in inline expressions. VaiaPatta (talk) 17:39, 11 December 2024 (UTC)[reply]

Picture

[edit]

I like the idea of a picture at the top of the page, and I even like the picture. But, sadly, it seems much too complicated for readers who are not mathematicians. Rick Norwood (talk) 10:33, 16 July 2024 (UTC)[reply]

Maybe something like this?

http://sweeneymath.blogspot.com/2011/05/how-i-see-exponent-rules-and-log-rules.html

Rick Norwood (talk) 10:40, 16 July 2024 (UTC)[reply]

I hadn't noticed the picture. I agree it could be better. A couple of possibilities I can imagine are (1) relation of a (not too) complicated expression to a tree (cf. binary expression tree, parse tree) which is effectively what the order of operations describes, (2) a [slow] animation showing evaluation of a numerical example from inside outward. –jacobolus (t) 16:18, 24 August 2024 (UTC)[reply]
Syntax trees of expressions can be found at commons:Category:Syntax_trees, e.g. commons:Exp-tree-ex-11.svg. Imo, any animation [no matter at which speed] severly distracts a reader's attention - so, while it is a good idea to provide an animation as you described, it is a bad idea to let it run within the article. Instead, it could be put in the category, and its name could be linked from the article. - Jochen Burghardt (talk) 17:16, 25 August 2024 (UTC)[reply]
One concern with a tree is that it might be confusing to some of the intended audience. –jacobolus (t) 17:41, 25 August 2024 (UTC)[reply]
You have a point there. What about modifying the current image such that in each line, one subexpression is evaluated? We'd need to replace "a" by some number for this (*); and probably we'd start from a less involved expression. If the changed parts are highlighted, an impression of a tree-like structure will arise (somewhat like in the right part of the bottommost picture), but without the need to talk about the concept of syntax tree.
(*) BTW: Maybe, we should mention somewhere in the article that only ground expressions can be evaluated, independent of the picture issue? - Jochen Burghardt (talk) 18:19, 25 August 2024 (UTC)[reply]

history section

[edit]

@Gronk Oz – can you find better sources for the claims you are making here? One of your sources is a (non-expert) university professor's personal website repeating the claims of your other link, an email from Dave Peterson, a former software engineer and community college teacher who was part of the "Ask Dr. Math" team, which is now defunct but with some of the same people at the website themathdoctors.org. None of these is a peer reviewed source, or really cites its sources, and while I think Ask Dr. Math / The Math Doctors was/is a nice website, it doesn't really meet Wikipedia's "reliable sources" standard. I don't think this history seems quite right, which is unsurprising for an informal email reply from a hobbyist (as compared to e.g. a professional historian doing careful research and publishing in a peer-reviewed journal). –jacobolus (t) 19:12, 4 October 2024 (UTC)[reply]

@Jacobolus: I agree these are not great sources. I thought the absence of a History section was a real deficiency in this article, so I wanted to get the ball rolling with what sources I could find. Now that I look into it further, there is what looks like a good resource at web.archive.org/web/20020621160940/http://members.aol.com/jeff570/operation.html - while it is still a blog-style entry, it refers to a number of published works that would be worth following up - especially A History of Mathematical Notations (1928-1929) by Florian Cajori. Unfortunately, I don't have access to those, so I will keep looking.--Gronk Oz (talk) 03:00, 5 October 2024 (UTC)[reply]
I have found an online archive of the Cajori book at archive.org/details/historyofmathema031756mbp/mode/2up. But it will take some time until I can address this, since I am caught up with real-life matters at the moment. I will try to get to it when I can, unless somebody else wants to... --Gronk Oz (talk) 03:07, 5 October 2024 (UTC)[reply]
The relevant part of Jeff Miller's site (one of the best sources on the web about the history of mathematical terms) is now at https://mathshistory.st-andrews.ac.uk/Miller/ – this page specifically is https://mathshistory.st-andrews.ac.uk/Miller/mathsym/operation/jacobolus (t) 04:07, 5 October 2024 (UTC)[reply]

Doesn't work in the real world

[edit]

Here is the problem with the order of operations: it only works in a context where it can be assumed that everybody knows it and follows it. It allows you to simplify an expression by leaving out the parentheses, which is all well and good...unfortunately, that isn’t the way the real world works.

For example: Suppose your brother-in-law agrees to fix something for you and will only charge you for the parts. He needs 3 identical parts, which cost $10 each, but are on sale at $2 off.

So he writes you a note that says: 10 - 2 x 3, meaning $8 for each part, times 3 parts, equals $24. You use the order of operations and think he means 10 minus 6 or $4. Who’s right?

Well, you could say he wrote it wrong, but that’s not correct. What he did was write it ambiguously: taken one way you get the right answer of $24, taken the another way you get the wrong answer of $4. But the bottom line is, the order of operations didn’t give you the correct answer. 2600:4040:5D3F:9A00:5D51:8DD6:75E3:9EED (talk) 14:25, 28 February 2025 (UTC)[reply]

I agree that this kind of evaluation order (simply left to right, and even with = symbols inserted to indicate intermediate results, as in 10 - 2 = 8 x 3 = 24 appears often (among non-mathematicians). Maybe we should mention this kind of habit; preferrably with a reliable source. - Jochen Burghardt (talk) 14:49, 28 February 2025 (UTC)[reply]
The "order of operations" is a loose description of the prevailing conventions in mathematics, not a prescriptive rule for how you have to communicate with your family. –jacobolus (t) 19:07, 28 February 2025 (UTC)[reply]
To the IP editor: you removed your comment from special:diff/1278209806, but to answer anyway: "order of opperations puzzles" on social media are at best a curious bit of internet trivia and not really worth worrying about. Shaming people about them is definitely not a good use of attention. I don't really know why these are popular, and in my opinion they're only worth mentioning here on Wikipedia to explain why not to care. As we explicitly say (quoting an expert), "one never gets a computation of this type in real life", and they are "a kind of Gotcha! parlor game designed to trap an unsuspecting person by phrasing it in terms of a set of unreasonably convoluted rules". –jacobolus (t) 04:01, 1 March 2025 (UTC)[reply]
Your brother-in-law might also drive on the wrong side of the road. (Or at least, on the other side of the road from everybody else in your country.) I don't think that means we should just abandon the road rules because people don't follow them "in the real world". Gronk Oz (talk) 02:25, 2 March 2025 (UTC)[reply]

Symbols of grouping (reverted edit)

[edit]

For context: I had slightly changed the sentence "Symbols of grouping can be removed using the associative and distributive laws, also they can be removed if the expression inside the symbol of grouping is sufficiently simplified so no ambiguity results from their removal", adding "many" to the beginning. The edit reversion summary states "that e.g. the inside of a sqrt differs from brackets also doesn't need a vague pedantic caveat".

Up to that point, only three symbols of grouping had been described by the article, the first being parentheses, the second being monomials (or at least linear expressions) as argument of a function and the third being roots/radicals. Of those only the first allows simplification with distributivity and even then only in the case of a linear function applied to the parenthesized expression. More importantly, even if you ignore the less common grouping symbols including exponents and roots, fractions are a very common case and they don't allow you to simplify the denominator with distributivity either.

Finally, the last part of the sentence only applies to parentheses, for the other grouping symbols ambiguity has almost nothing to do with whether they can be removed. So I guess the sentence was supposed to mean that specifically parentheses can usually be simplified with distributivity and/or associativity and it just overshot the mark by a lot.

In any case it's a clearly false and misleading statement, even if not read as written (which would mean that not just some or most, but all grouping symbols could be removed with distributivity and associativity), and my edit was a simple and uncomplicated fix, thus unrelated to any "pedantic caveat". (Though I probably shouldn't have combined my three unrelated edits into one, that was pretty much begging for a revert.)

Since my edit wasn't accepted, I'm asking here for more ways to turn the sentence from a simple but false and misleading one into a still as simple but also true one. After all, a central point of the article itself is about how ambiguity should be avoided. In case of no feedback, I will just try another version soon. Ninjamin (talk) 03:48, 5 May 2025 (UTC)[reply]

Can you elaborate on why you think "it's a clearly false and misleading statement"? Mr. Swordfish (talk) 17:18, 6 May 2025 (UTC)[reply]
The most obvious and direct interpretation of the statement in question would be "For symbols of grouping, they can be removed with the associative and distributive laws, […]", a possibly more appropriate interpretation would be "both associativity and distributivity are able to remove [some] symbols of grouping".
The first interpretation means that at least all those symbols of grouping could be removed that are relevant in the context of the article, including the abovementioned counterexamples, which the article introduces in the directly preceding paragraph of the same section, a few lines above.
The second interpretation doesn't necessarily imply that they were able to remove all symbols of grouping, but still implies that associativity were able to remove at least some symbols of grouping, which is also not the case, because either
  1. the symbol of grouping is doing nothing else other than just grouping, which applies only to parentheses, then associativity by definition can only move the parentheses around, never remove them
  2. the symbol of grouping also applies a function to the contained expression, like a division in case of a fraction bar. In this case it can only be removed with a separate cancellation rule, never due to the change of parentheses via associativity. Examples would be canceling a function with its inverse function (in case of a double fraction or a square of a square root) or applying the knowledge that the square root of 4 is 2, which can only be applied once there are no parentheses left, not just because of moving them around.
This is why it's false. I also claimed that it's misleading and that's additionally because it implies that among the symbols of grouping it were common to find those that can be simplified with those two replacement rules, while the first rule doesn't affect any of them and the second only affects parentheses. Finally, this article is supposed to be useful for beginners and I've met many beginners that would and did simplify e.g. sqrt(x+y) falsely to sqrt(x)+sqrt(y), so it's very much relevant that it affects the square root function.
I thus suggest changing the statement either to refer specifically to parentheses or at least no longer significantly overgeneralize. Ninjamin (talk) 20:39, 6 May 2025 (UTC)[reply]
[…] and like I wrote in my post starting this section of the talk page, even distributivity only affects parentheses and the nominator of a fraction (and some more advanced symbols of grouping like integrals and some inner product notations), another way in which it's overgeneralized. Ninjamin (talk) 20:57, 6 May 2025 (UTC)[reply]
As your explanations are confusing, I went to the article, which was effectively very confusing. I would not say it was wrong, because it was too vague for that. I rewrote the sentence, and hope that the new version represents well what was intended by its author. D.Lazard (talk) 11:35, 7 May 2025 (UTC)[reply]
I think your version is both more accurate and more helpful, that should be enough. Ninjamin (talk) 14:36, 7 May 2025 (UTC)[reply]
I mainly was reverting the addition of "but for less common operations there is typically no consensus, which means that parentheses should be used to avoid confusion and misunderstanding" which is both vague and also too prescriptive for wikipedia, and doesn't really help clarify in context. But I don't think the change from "Symbols of grouping" to "Many Symbols of grouping" was to any particular benefit. However, thanks for starting a discussion. I agree with you and D.Lazard that the previous sentence was pretty mediocre. I don't think I ever paid close attention to that sentence before and am not sure where it originated, but I'll try to take another crack at it. –jacobolus (t) 15:10, 7 May 2025 (UTC)[reply]
Our articles Symbols of grouping and Bracket (mathematics) (which should probably be renamed Brackets (mathematics) since they always come as a pair in the context discussed) are both quite mediocre and should probably be merged. –jacobolus (t) 15:21, 7 May 2025 (UTC)[reply]
I assumed as much, that's what I meant when I wrote I shouldn't have combined my three edits into one. And I agree with you, the way I stated that part was too prescriptive.
My goal with that part of the edit was to prevent a beginner reading it and thinking "Oh, so I always go from left to right except for a few special operators!", when it's the other way around: The left-to-right convention is unversally accepted for sequences of additions and subtractions, but for every other infix operator I know I've found there to be a significant lack of consensus or even outright rejection. As far as I have seen, using the left-to-right rule for sequences of multiplications and divisions is mostly limited to primary education and programming languages /calculators. Even (digitally) printed mathematics using the solidus/slash for division will either define multiplication with higher precedence than division or the other way around or always use parentheses, in all three cases not following the left-to-right rule. Many common analysis teaching books for university students don't even define any infix symbol for division (no colon, no solidus) and only write it with the horizontal fraction bar or negative exponents and that's also how I've seen it in handwritten mathematics from secondary education on. If you disagree with my depiction or have any counterexamples, I would be happy to revise my view. Ninjamin (talk) 17:06, 7 May 2025 (UTC)[reply]
The first introductory section is aimed at primary education and laypeople. I put some effort (like a year ago?) into improving the section § Mixed division and multiplication, which discusses in more detail conventions found in more advanced material. –jacobolus (t) 18:22, 7 May 2025 (UTC)[reply]
Yes, I was happy when I saw that section! I just think that since already secondary education stops using that convention except with subtractions and possibly some additions inbetween, the article shouldn't imply that it was universal in mathematics, especially since school mathematics is often still taught as rigid application of rules the students don't understand. But if you think that it's unlikely someone will falsely conclude an overly general validity of the left-to-right rule, then I'll leave it as is. Ninjamin (talk) 18:36, 7 May 2025 (UTC)[reply]
The rule as stated is generally valid (for addition and multiplication of numbers), so I don't think there's too serious a problem. Anyone trying to interpret multiplication of matrices or octonions or whatever is probably not going to be trying to pedantically over-interpret the first section here. But if anyone has concrete suggestions about improvements that don't compromise basic understanding for the broadest possible audience, they can boldly make changes (which might be reverted if anyone disagrees) and we can certainly talk about it. –jacobolus (t) 21:53, 7 May 2025 (UTC)[reply]


BODMAS

[edit]

The article implies that the O in BODMAS stands for "Of" and sometimes this is given as "Order" instead - however I think this is the wrong way around. "Order" seems to be far more commonly used than "Of", a Google of BODMAS related pages shows that "Order" is overwhelmingly more common than "Of". Also one of the references used to support the "Of" version dates from 1979 so is a bit suspect for an article that should be describing current usage in my view. 123.255.61.246 (talk) 19:44, 20 May 2025 (UTC)[reply]

(Note previous discussion at Archive 3 § BODMAS' O.)
Have you done a book survey? The books and scholarly sources I found more commonly had "of", especially older ones. I'm fairly certain that "Of" was the original. It seems like some more recent authors (teachers?) who remembered the letters but not their meaning made up a new word for the O to represent, perhaps under the influence of the PEMDAS mnemonic where "E" means "Exponent", but both "O" interpretations are still quite common among the sources I looked at. I don't think a generic web search is a good way to answer this type of question. (To be honest all of these mnemonics are a harmful distraction for educators and students, and the less we think about them the better.) –jacobolus (t) 20:30, 20 May 2025 (UTC)[reply]
I'm not sure how "original" the use of Of is, I was certainly taught it was Order at school, college and university in the UK from the late 80s to the mid 90s. The first time I have ever heard it standing for Of was reading this article. That's just my personal experience of course but a quick poll of friends and colleagues from the UK found none of them remember O standing for "Of", hence my querying this statement. 2404:4400:4149:9F00:3414:127F:EF2:EEA2 (talk) 09:37, 21 May 2025 (UTC)[reply]
Can you find a reliable source clearly saying how relatively common these are / explaining the history of the variations? Otherwise, you could try to do your own survey of books and research papers. I can only tell you what I found when I went looking into this before; but I didn't do a super comprehensive survey. I'm not opposed to changing our sentence or two about this, but it should be based on something more than what one or a few people can remember about what they saw in primary school decades before. –jacobolus (t) 16:16, 21 May 2025 (UTC)[reply]
Here are some examples – "Of" is nearly universal among books I can find, especially from before the past few years, including in tertiary sources like abbreviation dictionaries and encyclopedias:
etc. Feel free to use some kind of better methodology and count if you want. –jacobolus (t) 17:10, 21 May 2025 (UTC)[reply]