3 caculators = 3 different answers to one math problem
mathmagical.co.uk
mathmagical.co.uk
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.
There is an ambiguity if Division comes before Multiplication - although in this case you assume left->right
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
"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.
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.
Consider the expression "h-bar is h over 2 pi". That's "ħ = h/2π", and is definitely not the same as "(h/2) * π". This is because of the convention that you write the numerator terms and then the denominator terms. That is, if you wanted "h/2 * π" then you would tend to write it hπ/2.
As another example, consider Schrödinger's equation, with (-ħ²/2m) * Ψ(r, t). There too the 'm' is well-understood as being in the denominator.
My intuitions (astrophysics/finance background) say multiplication-by-juxtaposition is higher-precedence than multiplication-by-symbol, so "x/y(1+y)" would be "x/(y(1+y))"; interpreting it as "(x/y)(1+y)" seems wrong.
Then again, "x/y*(1+y)" already looks wrong. The solidus is too powerful. I'd write "(x/y)(1+y)" explicitly.
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.I believe this is the crux if the issue, RPN notwithstanding.
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
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.
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. 6 ÷ 2 (1 + 2)
to (6 * (1 + 2)) / 2 *a /b *c = *a *b /c = /c *b *a etc.
so 6 /2 *(...) = 6 *(...) /2."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.
But ... the iPhone gives 2? I don't get it.
(FWIW, Android says 9)
5(2) = 2
999(2+2) = 4
2*2455(6) = 12
2+47435)7 = 14
(according to the iPhone calculator in scientific mode)I get 9 as written on my iPhone. The correction above gives 14.
The interesting thing to me is that the close parenthesis cause the same behavior. The consistent logic appears to be "an operator entered in error causes input to reset" or something like that. Also errors are silently ignored in the easiest way possible, perhaps internally the value never gets pushed to the stack or something along those lines.
I wonder what other 'errors' could show this behavior?
6 ÷ 2 ( 1 + 2 )
6 ÷ ( 1 + 2 )
6 ÷ ( 3 )
2
The iPhone appears to operate this way:
6
6%
6%2
6%(
At this point the 2 (or any value in that slot) has been dropped
6%(1
6%(1+
6%(1+2
6%(1+2)
and the result is processed in this order:
6%(3)
6%3
2
giving the result.It appears what most people are objecting to is that it performs an unexpected operation when it discards the value at 2 (because opening the parenthesis without giving 2 an operator has been designed to be 'invalid') but it does NOT indicate this in ANY way.
It is also interesting to note that all of his other examples had the entire formula written out, where the iPhone did not. If it had, it would have been more clear when the 2 was dropped.
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.
Or better yet, realise that writing it all on one line is stupid and ambiguous, and write properly.
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