9 ms·
3 caculators = 3 different answers to one math problem
- deleted 15y ago[deleted]
- joejohnson 15y agoAnyone have a guess to how the iPhone calculator computed 2?
- deleted 15y ago[deleted]
- sadfaceunread 15y agoComments on the original post indicate that if you do 6/7(1+2) then you get 2 as well and the iPhone is just throwing away whatever digit is in the position of the 7.
- martingordon 15y agoIt seems that pushing "(" doesn't push the entered value onto the stack, even though it's still visible on the screen. "6 / 2 (2 + 1)" becomes "6 / (2 + 1)".
- pacaro 15y agoThe calculator on WP7 does the same thing, but is a little more explicit - it shows the current expression as it is being built, so you see that while the first 2 was entered, the final expression is 6 ÷ (2 + 1)
- trjordan 15y agoOK, I get the first two. Strictly speaking, mult and div have the same precedence (6 / 2 * 3 should be the same as 6 * 3 / 2 , both 9), but in one case, the calculator interpreted the multiplication in 2(1+2) as having higher precedence than 2*(1+2). Arguably a bug, but nothing crazy. But ... the iPhone gives 2? I don't get it. (FWIW, Android says 9)
- laacz 15y agoMy iPhone gives 9. I entered "6/2*(1+2)".
- thekungfuman 15y agoYou have to test it without the explicit "*" and see if it performs the order of operations correctly.
- laacz 15y agoMy iPhone gives 9. I entered "6/2*(1+2)".
- mrgoldenbrown 15y agoI don't like calling one interpretation of an ambiguous notation a bug but not the other. Either they are both possible bugs or neither are. The ambiguity comes in when we try to apply rules we learned for encoding (handwritten notation) to another encoding scheme (the calculator). Handwritten math uses positional information to encode order of operations. Calculator math can either try to mimic this (like one Casio did) or ignore this and revert to strict "all multiply and divide operations have equal precedence" (which the other Casio did) Fractions and exponents are other areas where handwritten notation and calculator notation don't overlap very well.
- ricardobeat 15y agoThe iPhone ignores any input before opening a group if you don't give it an operator. 5(2) = 2 999(2+2) = 4
- mrgoldenbrown 15y ago1 ambiguous notation, 3 different interpretations. The Casios both have reasonable interpretations, but the iPhone should probably give some kind of warning that it is about to ignore entire numbers.
- jetti 15y agoHow is that ambiguous? PEMDAS and since multiplication and division have the same rank, you go left to right. Pretty clear if the calculators follow the basic order of operations.
- baddox 15y agoAll infix notations (without sufficient parentheses) require an agreement (implicit or explicit) among all concerned parties. This is nothing new. The same ambiguity occurs with the unary negation operator, as in -5^2. While I wouldn't choose it, I don't think it's entirely unreasonable to give the "multiplication by juxtaposition" operator greater precedence than the normal multiplication and division operators.
- uiri 15y agoIf you write the expression as a fraction without anything beside it being multiplied, it is ambiguous as to whether (1+2) ought to go above or below the fraction bar. The fact that parentheses/brackets ought to be resolved before anything else complicates things because 6/2 * 3 could reasonably be interpreted either way. An unambiguous way to write it would be either as (6/2) * 3 or as 6/(2*3).
- excuse-me 15y agoBEDMAS is easier to remember There is an ambiguity if Division comes before Multiplication - although in this case you assume left->right
- patricklynch 15y agoHow is that ambiguous? Although that was probably rhetorical: It's ambiguous because most people[1] automatically view implicit multiplication as higher rank than both division and explicit multiplication. -- [1]this is a wild guess with no data to back it up edit: baddox's answer is much better
- jonsen 15y agoIn WolframAlpha 6÷2(1+2) gives 9 but 6÷2x with x=(1+2) gives 1.
- Rust 15y agoI might be remembering incorrectly, but 2x and 2(x) are totally different things in algebra. 2x would be expanded as (2 * x), whereas 2(x) expands as 2 * x. In this case, since the equation is 2(1+2) which results in 2(3), it's final DMAS form is 6 ÷ 2 * 3 = 9, instead of 6 ÷ ( 2 * 3 ) = 1
- cytzol 15y agoMentally, I perform no-written-operator multiplication first, then anything else, so I can see why the calculators (and WolframAlpha, in some cases) are getting the intention wrong: "6 ÷ 2x" gets parsed as "6 / (2 * x)" "6 ÷ 2 * x" gets parsed as "(6 / 2) * x" All that's done in the equation in the article is having a pair of brackets instead of a variable, but the result is the same to my brain.
- merijnv 15y ago> "6 ÷ 2x" gets parsed as "6 / (2 * x)" Edit: I'm probably wrong about precedence for 2x, which should be stronger. Which would leave 2(1+2) still really ambiguous. I guess the true lesson here is to always parenthesize explicitly or use over/under notation, But this is wrong! Division and multiplication have the same precedence and left-to-right application order! Hence, "6 ÷ 2x" should be parsed as "(6 ÷ 2) * x", which I admit is a bit confusing, so you probably should write out either the parenthesis or the multiplication. But, just because the notation is confusing doesn't mean the rules no longer apply.
- chc 15y agoBut this makes almost everybody wrong. Going by this, you would evaluate 6x ÷ 2x to 3(x^2) rather than 3. That is clearly not the intention, so somebody is wrong here, but it's a matter of opinion whether it's the writer (for not precisely following standard notation) or the standard notation (for being counterintuitive) that deserves the blame.
- droithomme 15y agoYes, this is correct and is the reason why I set implicit multiplication to a higher precedence in the calculators I've written. Obviously not everyone agrees though, but it's certainly the way it's always been interpreted in written algebra textbooks. Precedence rules are essentially arbitrary. We have to make them up. Going by most common historical use is a reasonable choice.
- dalke 15y ago
- thekungfuman 15y agoI'm happy to say my mental math and my phone's (Nexus S) math get 9.
- snitzr 15y agoRPN (Reverse Polish Notation) gets things done on a calculator. This article shows one reason why it's not just for finance.
- kstrauser 15y agoYou beat me to it. Enter one of 6 [enter] 2 [enter] 1 [enter] 2 + * / or 6 [enter] 2 / 1 [enter] 2 + * depending on how you prioritize the implicit *, and never have to wonder how your calculator might interpret the input.
- michaelcampbell 15y ago> depending on how you prioritize the implicit *, I believe this is the crux if the issue, RPN notwithstanding.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- rometest 15y agowhen i was a kid, i was told to use the BODMAS rule i.e Brackets, Orders, Division or Multiply, Addition or Substraction After you have done "B" and "O", just go from left to right doing any "D" or "M" as you find them. Then go from left to right doing any "A" or "S" as you find them.
- alexchamberlain 15y agoI was taught the same, but with strict precedence - division comes first. Having said that, a mathematician would never write those down anyway, as it's too confusing.
- kylec 15y agoHm, Calcbot on the iPhone also returns 2 if entered without a multiplication after the first "2". Hitting the open parenthesis key removes the "2" from the calculation. Since Calcbot displays what you've entered below the answer, it's easy to see the mistake with a trivial calculation like this, but if you're not watching for it it's easy to miss. Better than the built-in calculator and PCalc, which provide no feedback and give the wrong answer, but surprising.
- xamuel 15y agoMath PhD student here. The issue is that people are confusing two symbols which are distinct: the solidus (/) and the obelus (÷). The latter is rather obsolete and it's not clear why exactly calculators use it. Anyway, this blog post clears up the issue better than I could hope to in a comment: http://www.matthewcompher.com/posts/trouble-with-semantics-the-obelus-or-division-symbol-%C3%B7/ http://www.matthewcompher.com/posts/trouble-with-semantics-t...
- batista 15y agoNo, this is not the problem in this case at all. Read the article. Besides, both calculators use the obelus, and still give different results.
- anonymous 15y agoMultiplication and division have the same precedence, so you do them left-to-right as written. Like addition and substitution. Or better yet, realise that writing it all on one line is stupid and ambiguous, and write properly.
- ghshephard 15y agoIn Microsoft Excel we get: "Microsoft Excel found an error in your formula you entered. Do you want to accept the correction proposed below?" =6/2*(1+2) Which then gives 9.
- Rust 15y agoI enjoyed the bit at the end where the writer managed to use the wrong (IMO) formula to arrive at the correct answer. Using BEDMAS as I was taught, so many moons ago: 6 ÷ 2 ( 1 + 2 ) 6 ÷ 2 ( 3 ) 6 ÷ 2 * 3 // because 2(3) is not an exponent or algebraic construct, it's straight multiplication 3 * 3 // division and multiplication are in left-to-right order, no precedence 9
- Rust 15y agoUpdate: after reading the article at http://www.matthewcompher.com/posts/trouble-with-semantics-the-obelus-or-division-symbol-%C3%B7/ http://www.matthewcompher.com/posts/trouble-with-semantics-t... , the writer used the ÷ as a line operator, not a natural division operation. I would maintain that since this is not taught in any school I've ever attended, it is at least questionable. I've never seen a math textbook use the / symbol for natural division either.
- falling 15y agoI never knew about the distinction either. But if interpreted that way 6 ÷ 2 (1 + 2) should then translate to 6 / (2 * (1 + 2)) = 1 I guess this only reaffirms the fact that the expression is ambiguous.
- falling 15y agothat seems wrong to me too, either I lost my math or I don’t see how he went from 6 ÷ 2 (1 + 2) to (6 * (1 + 2)) / 2
- nraynaud 15y agoto me, elided multiplication has a higher precedence than the explicit one (and by transitivity, than the explicit division), but I don't remember in which grammar I read that (mathematica, matlab ?).
- ernesth 15y agoI would have expected an answer of 3 as 2(1+2) cannot mean anything else than applying the constant function 2 to the sum.
- hcarvalhoalves 15y ago...about time we start teaching prefix notation on schools.