# Why do I disagree with my calculator?

I followed the order of opperations but my answer disagrees with my calulator's.

Problem: $331.91 - 1.03 - 19.90 + 150.00$

Calculator answer: $460.98$
My answer: $162.98$

Why the discrepancy?

• $331.91 - 1.03 - 19.90 + 150.00=331.91+ 150.00- 1.03 - 19.90$ – lab bhattacharjee Jul 27 '13 at 19:16
• If you write the details on how you got -your- answer, maybe we can help you pinpoint your mistake. – Lord Soth Jul 27 '13 at 19:18
• This sort of issue never arises in fully parenthesized infix notation, prefix notation, or suffix notation. – Doug Spoonwood Jul 27 '13 at 23:42
• Nor do these issues ever arise when one knows and follows the accepted conventions of order-of-operations and uses minimal common sense in forming expressions with parentheses. Whereas the conventions as they stand create issues when people are unfamiliar with them and there is the learning curve of memorizing a single acronym, the alternative of drowning equations and expressions in parentheses and visually disconnecting operators from the things they act on creates a vastly more harmful and pervasive cognitive tax many orders of magnitude outside of comparison (albeit perfect for computers). – anon Jul 28 '13 at 0:10

## 6 Answers

It is clear that you did the operation $$331.91 - 1.03 - (19.90 + 150.00)$$ while the calculator instead simply did $$(331.91 - 1.03 - 19.90) + 150.00$$ A strict order of operations (PEMDAS) is in some cases not really the actual convention used in actual mathematics in some sense. When you see something like

$$3.2345-9000+2345$$ the intent of the author is $$(3.2345-9000)+2345$$ as subtraction is really just addition by a negative (as division is just multiplacation by an inverse) and it is quite convenient to just work left to right in these cases.

• I would phrase it differently. In $3.2345−9000+2345$ the intent of the author is not $(3.2345−9000)+2345$ but $3.2345+(−9000)+2345$. – GEdgar Jul 27 '13 at 20:08
• @GEdgar I don't know at this level if I should expect him to be familiar with negative numbers, so I think I'll leave it as is. That is probably closer to what is meant, but I just want to stress the order. – PVAL-inactive Jul 27 '13 at 20:19
• good point.${}$ – GEdgar Jul 27 '13 at 21:15
• I agree with GEdgar, but if remembering that numbers have to be packaged with the sign to the left of them is hard, it's enough to remember that + and - are to be given the same priority, and so you should work from left to right, which always gives the right answer. – Billy Jul 27 '13 at 23:02

"I follow the order of operation."

Addition (+) and subtraction (-) have the same priority; and should be evaluated from left to right.

Another responder noted you did the addition first, then the subtractions.

As PVAL has pointed out, the problem seems to be a misinterpretation of the PEMDAS mnemonic for operator precedence. You seem to be interpreting it to mean:

1. Parentheses
2. Exponentiation
3. Multiplication
4. Division
5. Addition
6. Subtraction

And thus interpreting the expression $331.91−1.03−19.90+150.00$ as $331.91−1.03−(19.90+150.00) = 160.98$.

However, the actual convention used in mathematics (and in most computer and calculator programming languages) is:

1. Parentheses
2. Exponentiation
3. Multiplication and Division
4. Addition and Subtraction

That is, the + and - operators have equal precedence, and are evaluated in strict left-to-right order. So, $331.91−1.03−19.90+150.00$ means $((331.91−1.03)−19.90)+150.00 = 460.98$.

Also, note that the Muliplication/Division precedence level works slightly differently in mathematical notation than in programming languages, due to implicit multiplication and two-dimensional fraction notation. In a spreadsheet or a computer program, the fraction $\frac{ab}{cd}$ must be written in a "linear" form with explicit multiplication as a * b / (c * d), where the parentheses are required because * and / have equal precedence (just like + and -), and so the unparenthesized expression a * b / c * d would be interpreted as $\frac{a \times b}{c} \times {d}$. In mathematical typesetting, however, the expression $ab/cd$ is ambiguous and prone to get interpreted as $\frac{ab}{cd}$ instead of $\frac{ab}{c} d$.

The calculator is correct of course (at least in magnitude of the answer, I haven't actually calculate it, and I won't). I bet you are having problems with those negative terms.

For this particular exercise and infinite more like this one, you can take another approach, more intuitive than just following rules like a robot. Look at what you are being asked: it's a sum. A sum with negative and positive numbers. We can already see that the positive numbers exceed in magnitude the negative ones, so there is no way in hell that your answer is correct.

Structurally you could add all positives, add all negatives and then add those two groups, just like you can identify the 'subject' and 'predicate' part in a grammatical sentence. In my experience, that has always minimize sign-related errors.

Obviously calculator is correct.Steps to do it manually: since + and - have same priority we can solve them in any order so add $331.91$ and $150.00$ (since they have same sign) and add $1.03$ and $19.90$ (same sign) $$331.91+150.00=481.91$$ and$$-1.03-19.90=-20.93$$ then $$481.91-20.93=460.98$$ Another way: $$331.91-1.03-19.90+150.00\implies 330.88-19.90+150.00\implies 310.98+150.00 \implies 460.98$$

To add a bit to the other answers, especially in applied disciplines it is often common to first do an approximation. In your terms given by $$331.91 −1.03−19.90+150.00$$ rounding to the next $50$ gives $$300 + 150$$ so your results should be in the ballpark of $450$. If this is not the case something went completely wrong. This simple example can of course be generalized to other operations but the approach stays the same.