4

What is 9-5+2 ?

9-5+2 = 6; //With Calculator

9-5+2 = 2; //Using BODMAS

If you evaluate from the right it give you "2" which follows the law: Brackets-Of-Division-Multiplication-Addition-Subtraction

Why don't calculators follow that rule?

Remember:

9-5*2 = -1

Tawani
  • 231
  • 2
    The right answer is $6$. You should read from left to right. – TMM Apr 06 '12 at 13:49
  • 1
    BODMAS does not ask you to evaluate expressions from right to left, does it? In any case this is just a sum of three numbers 9, -5, 2, so it shouldn't matter... – Xabier Domínguez Apr 06 '12 at 13:51
  • 1
  • 1
    BODMAS does not mean B>O>D>M>A>S, but rather (B)>(DM)>(AS). The "of" isn't seen in real-world mathematics outside of certain school textbooks. :-) – ShreevatsaR Apr 06 '12 at 14:06
  • 9
    Why are you telling us to "remember" something about "BODMAS" when you clearly don't know how to use it yourself? – The Chaz 2.0 Apr 06 '12 at 14:16
  • 2
    I think you're thinking that $9 - 5 + 2$ is equal to $9 - (5+2)$. This is not the case because the binary operation subtraction is not associative. What is correct is that $9 - 5 + 2 = 9 -(5-2)$. –  Apr 06 '12 at 14:28
  • 4
    Not sure about the weight of downvotes... this is a fair and considered question fitting the stated brief "We welcome questions about: Understanding mathematical concepts" – Ronald Apr 06 '12 at 15:36
  • Maybe you can understand it better if you do $9-5+2 = (9+2)-5=11-5=6$. This means grouping the positive and the negative terms. – dot dot Apr 06 '12 at 15:37
  • 2
    -1, Even the generalized form of this question is not interesting. The only interesting part of this question is that the asker used a calculator, got a different answer, and thought the calculator was wrong. – Joshua Shane Liberman Apr 06 '12 at 15:48
  • 3
    @Ronald: Not sure about the weight of upvotes... This is 1. certainly not about understanding mathematical concepts and 2. a multi duplicate. – Did Apr 06 '12 at 16:11
  • 3
    "Why don't calculators follow that rule" is not a mathematical question, but a user interface question. – Aryabhata Apr 06 '12 at 18:08
  • 1
    I downvoted, and I'll stick to it, because the question cannot get answered. If you have a convention which settles the precedence of "-" and "+", then you can answer something for "what is the value of x+y-z". But, as stated (since the formula happens in an infix notation), there exists no convention given, implied, or assumed. So, there does not exist a value for 9-5+2. You can also tell that 9-5+2 has no value, since it can't uniquely get rewritten in either Polish or Reverse Polish notation. – Doug Spoonwood Apr 06 '12 at 20:55
  • 19
    There's a meta thread on this question (please vote this comment up so that it becomes visible above "the fold") – t.b. Apr 06 '12 at 23:50
  • 3
    @DougSpoonwood: That is absurd. There is an existing convention by which $9 - 5 + 2$ is equal to $6$; saying that it has no value is very strange. And the question is precisely about this convention. – ShreevatsaR Apr 09 '12 at 04:53
  • @ShreevatsaR You've missed a key clause in what I wrote. I said "as stated (since the formula happens in an infix notation), there exists no convention given, implied, or assumed." The author did not seem to want to give priority to either BODMAS or the calculator's convention. So, the question does not have a correct answer. And it is not absurd to think this at all. Saying that 9-5+2 in the absence of has a value appears like saying that x+(y-z)=(x+y)-z for all x, y, z, when x, y, and z are natural numbers. That is absurd. – Doug Spoonwood Apr 09 '12 at 11:56
  • 1
    @DougSpoonwood: Er yes, I do say that "x+(y-z)=(x+y)-z for all x, y, z, when x, y, and z are natural numbers". Why is that absurd? (And there does exist a convention implied and assumed: namely, what the whole world uses, including, in particular, the calculator and the usual (not the OP's) interpretation of BODMAS.) – ShreevatsaR Apr 09 '12 at 15:58
  • @ShreevatsaR You caught me making an incorrect simile. I commend you for the catch. However, saying that 9-5+2 in the absence of a convention for evaluating the order of operations is like saying that x+(y MIN z)=(x+y) MIN z, where MIN indicates the minimum operation for two real, rational, or natural numbers. – Doug Spoonwood Apr 09 '12 at 23:20
  • @DougSpoonwood: I really don't understand why you speak of "the absence of a convention", when a universal convention exists. (Read Carl's and Jasper's answers below.) Under this convention, 9-5+2 means (9-5)+2 and never 9-(5+2), so it is not at all like whatever you're saying. In a hypothetical universe where no such convention existed, your comments would make sense. – ShreevatsaR Apr 10 '12 at 01:47
  • @ShreevatsaR The convention is not universal, that is shared by all, since the author did not have that convention in the very first place. Second, even if there do exist experts here, and "all" experts agree, the experts can quickly say "we're going to let x-y+z mean x-(y+z)" by fiat and establish a contrary convention also, and write x-y+z without parentheses. If, as Carl Mummert claims, we could no longer worry about these things by prioritizing associative operations, then maybe his explanation would work. But, that doesn't work. What is 4 + 6 MIN 8? – Doug Spoonwood Apr 10 '12 at 02:13

3 Answers3

15

The rule as I learned it was: do brackets, then do both multiplication and division at the same time from left to right, then do both addition and subtraction at the same time from left to right. I did not learn a rule that would do all subtractions before all additions.

Note that most programming languages also evaluate addition and subtraction from left to right (this is called "left associative" evaluation).

In this case the "calculator" way matches 9 + (-5) + 2 which is how, in some sense, we ought to read expressions that involve subtraction. The motivation is that subtraction is not an associative operation, but addition is, and so if we just rewrite the subtractions as additions then we no longer have to worry about these things. If someone wants to write 9 - (5 + 2) then they will need to use parentheses. Unfortunately, we generally teach subtraction before negative numbers, which leads to this sort of confusion. The same situation exists with division and multiplicative inverses.

Carl Mummert
  • 81,604
  • Why do you start making a moral argument here? Saying that you won't have to worry about these things just because one of the operations associates only works when a-b=a+(-b). How many binary operations work that way in the first place? Let Letting "+" and "-" stand for any binary opeartions. Suppose them both non-associative. What does x+y-z mean? Suppose them both associative, what does x+y-z mean? x+(y-z)=(x+y)-z for binary operation isn't something which holds very often, and how often can you introduce a unary operation "-" such that a-b=a+(-b)? – Doug Spoonwood Apr 09 '12 at 12:05
  • And how do you deal with the equivocation that has happened when you have a-b=a+(-b), since on the left - is binary, and on the right - is unary? Is "-" an operation of variable arity? But, "-" isn't this way, unless you have another convention which tells us what a-b-c means. And what if we want to consider a system with the same set, those two binary operations "-" and "+", and a third binary operation "x"? Or a fourth, a fifth, a sixth, a seventh, or an eighth? Saying that one has to use parentheses to say something like 9-(5+2), since -9+52, and 952+- both say it! – Doug Spoonwood Apr 09 '12 at 12:13
6

In BODMAS, division and multiplication are to be performed from left to right followed by addition and subtraction from left to right. The scientific calculator has done it correctly.

6

This illustrates an important misconception: BODMAS doesn't work in the way you think it does.

In training for mathematics education, we were told to avoid using BODMAS because it's confusing to most people... nonetheless teachers often use it at a low level of education because it's convenient. Other people may use PEMDAS, which may illustrate to you that the order of M and D is not strict (nor is the order of A and S).

A clear way to consider the situation is to split the expression into separate terms, by the location of $+$ and $-$:

$9$ is one term, $-5$ is another term, $+2$ is another term. We're effectively adding the terms. So we have $9 + (-5) + 2$. This avoids any notion of ambiguity.

A question that will generate more controversy is "What is the value of $1/2\pi$?" ;)

Ronald
  • 1,343
  • 1
    Ronald: 1. I downvoted the question. 2. " $1/2 \pi$" isn't a question... :) 3. This is spam, and possibly what you had in mind? – The Chaz 2.0 Apr 06 '12 at 15:44
  • 3
    @TheChaz Understood. It's your right to downvote the question.

    However, I believe it was asked in good faith and with an interest in understanding the mathematical concept: which is the clearly stated purpose of these pages.

    I think it's essential to provide a satisfactory answer to this poorly-understood question, at least once.

    $1/2\pi$ is an interesting and insightful edge case, I have updated it to a question for your benefit.

    – Ronald Apr 06 '12 at 18:03
  • 2
    In particular, the closure reason (ambiguous, vague, incomplete, etc) of this question does not apply here. The question is, contrary to the given reason, very specific. I think this is a poor closure decision. This is a valid question - a better solution would be to redirect to a duplicate that answers the question appropriately (if one exists). – Ronald Apr 06 '12 at 18:15
  • @Ronald: Well, if the question is "Why don't calculators follow that rule", then this is off-topic, and overly broad etc etc. Of course, don't go by the closure reasons, sometimes they are off, as it is a subjective matter. If the question is, how do you put the brackets in $9-5+2$, it either does not have a specific answer, is a dupe or is too localized. Any interpretation seems to be leading to closure. So IMO, closing is fine, and we should not worry about the exact close reason. Besides, OP probably got what they came here for. – Aryabhata Apr 06 '12 at 18:22
  • @Didier: I suppose we can flag it for closure as dupe. – Aryabhata Apr 06 '12 at 18:27
  • Ronald, please excuse my cynicism! If you would like to petition (for lack of a better word) for a reopening, meta would probably be the best place. – The Chaz 2.0 Apr 06 '12 at 18:57