Post Reply 
8÷2(1+3)
12-03-2023, 01:46 PM
Post: #1
8÷2(1+3)
Apologies for posting this, but I am curious what people think this evaluates to.

Luckily, as RPN users, we don't need to argue about whether our calculator does it "right" or not.

But wanted to see what people thought the answer is and why.

There's a lot of viral videos out there and argument, and I agree the general consensus is that there are better ways of writing equations with less ambiguity.

However, I think it is still worth considering what a sequence of infix algebraic operators evaluates to, especially since many calculators and programming languages do not allow for natural mathematical expressions.
Find all posts by this user
Quote this message in a reply
12-03-2023, 01:55 PM
Post: #2
RE: 8÷2(1+3)
Yet another religious topic.

Some believe that implied multiplication is higher precedence than explicit, others insist they are the same, resulting in different answers. Passionate arguments will ensue both ways, but neither is formally more "correct" than the other, this has different adherents from different camps. Unless the device you are using states how it treats this, you cannot be certain how to be sure you get the "right" answer (meaning the one you want based on where you pray).

So, these debates continue...

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
12-03-2023, 02:43 PM
Post: #3
RE: 8÷2(1+3)
.
This has been discussed here ad nauseam many times, every so often one person or another brings it out again. For example, here you are, a thread on it from 2021, with 20+ messages for you to rejoice:

https://www.hpmuseum.org/forum/thread-16593.html

Me, I pass. Life's too short to waste time with such useless nonsense. Others may vary.

V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
12-03-2023, 04:11 PM
Post: #4
RE: 8÷2(1+3)
(12-03-2023 02:43 PM)Valentin Albillo Wrote:  This has been discussed here ad nauseam many times

Ah I hadn't seen it before. Thanks for the link!

Please ignore all Smile
Find all posts by this user
Quote this message in a reply
12-03-2023, 06:50 PM
Post: #5
RE: 8÷2(1+3)
OMG you are right about this being discussed before... Each thread seems to link to three more, ad infinitum! I liked the referenced [video](https://www.youtube.com/watch?v=4x-BcYCiKCk).
Find all posts by this user
Quote this message in a reply
12-03-2023, 08:09 PM (This post was last modified: 12-03-2023 08:10 PM by Johnh.)
Post: #6
RE: 8÷2(1+3)
I've seen that video too. It's worth watching, and I kinda fell in love....

Meanwhile, my view is, because it's ambiguous and clearly open to different interpretations, then it should never be written. Anyone who writes something like that should take another 0.5 seconds to add whatever explicit symbol or brackets are needed to make their intent unambiguous for others.
Find all posts by this user
Quote this message in a reply
12-03-2023, 10:11 PM
Post: #7
No, never, not even once
Always absurd because if you have no idea why these numbers and operators were put together in that order, then you cannot tell if you are solving a real problem.
Find all posts by this user
Quote this message in a reply
12-03-2023, 10:25 PM
Post: #8
RE: 8÷2(1+3)
(12-03-2023 10:11 PM)striegel Wrote:  Always absurd because if you have no idea why these numbers and operators were put together in that order, then you cannot tell if you are solving a real problem.

Yes. It is exactly the same with plain language, as opposed to mathematical language. What is meant by: "I shot an elephant in my pajamas" (Groucho Marx)?
Find all posts by this user
Quote this message in a reply
12-03-2023, 10:31 PM
Post: #9
RE: 8÷2(1+3)
I didn't learn algebra with PEMDAS. So I'm a bit confused.
Does this really mean addition before subtraction?
And multiplication before division?
How would you parse the following expressions?

\(1 - 2 + 3\)

\(
\begin{matrix}
a) & (1 - 2) + 3 & = & 2 \\
b) & 1 - (2 + 3) & = & -4 \\
\end{matrix}
\)

\(1 - 2 - 3\)

\(
\begin{matrix}
a) & (1 - 2) - 3 & = & -4 \\
b) & 1 - (2 - 3) & = & 2 \\
\end{matrix}
\)

\(1 \div 2 \times 3\)

\(
\begin{matrix}
a) & (1 \div 2) \times 3 & = & \frac{3}{2} \\
b) & 1 \div (2 \times 3) & = & \frac{1}{6} \\
\end{matrix}
\)

\(1 \div 2 \div 3\)

\(
\begin{matrix}
a) & (1 \div 2) \div 3 & = & \frac{1}{6} \\
b) & 1 \div (2 \div 3) & = & \frac{3}{2} \\
\end{matrix}
\)

If all your answers are \(a)\) then why on earth should implied multiplication make any difference?

In my understanding the operations \(-\) and \(\div\) are left-associative.
The operations \(+\) and \(\times\) are associative.
And the power-operation is right-associative.

Ok, I understand that maybe in the seventies it was hard to type something like the following in a paper:

\(
c_k = \frac{1}{2 \sqrt{\pi}} \cdots
\)

Thus instead of writing on a typewriter:

      1
c = ------ ...
 k      __
    2 -/pi


You'd rather write:

           __
c  = 1/2 -/pi ...
 k


But is that reason enough to come up with a special rule about implied multiplication?

The following expression is not ambiguous:

\(
\frac{1}{2\sqrt{3}}
\)

It only becomes a problem once you enter it into a calculator.

In Mathematica I'd enter it as:

1/(2Sqrt[3])

This leads to:

0.288675...

And yes, I'd be surprised if a calculator gives the same result if I enter: \(1\div2\sqrt{3}\).
Find all posts by this user
Quote this message in a reply
12-03-2023, 11:15 PM
Post: #10
RE: 8÷2(1+3)
(12-03-2023 10:31 PM)Thomas Klemm Wrote:  Does this really mean addition before subtraction?

No. It's meant to be a helpful acronym, but it is, in itself, ambiguous in this regard. Addition/subtraction and multiplication/division are equal precedence. In other places it can be called 'BODMAS' for example.

(12-03-2023 10:31 PM)Thomas Klemm Wrote:  But is that reason enough to come up with a special rule about implied multiplication?

I only recently came across this apparent facebook craze. When I first worked it out, I naturally calculated '1'. A few youtube videos in, and I got the impression I was wrong about this. To be fair I'd forgotten about the left-to-right rule. But the explanations didn't sit with me, so I went on a deeper dive.

My conclusion is that BODMAS/PEMDAS etc are just helpful acronyms to remind school children the order of operations. It isn't gospel, and in fact it isn't very clear as you demonstrated above. It doesn't even have the 'left-to-right' rule as part of it.

The video I mentioned above is probably the clearest and most concise explanation to me. She uses the term 'juxtaposition'. I don't think 'implicit multiplication' is a real thing, so I'm glad she doesn't use that term. I would use the term 'coefficient of a term', and I believe that it makes most sense for coefficients to have a higher precedence than the operators. They are not equivalent to the multiplication operator IMO, though can be converted to it with brackets, i.e. 2a = (2 x a).

There is a fair argument that where there is ambiguity, then it is best to be clear with liberal use of parens. To be fair though, you can take this to an extreme. You could write out y = 2x + 36 always as y = (2x) + 36, or y = 2a^2 as y = 2(a^2). I'll admit that these are less ambiguous, but I feel like we should agree on this topic to make this clear. The video demonstrates that something like 8÷2(1+3) was used in maths long before we were limited in typing out algebraic expressions on a calculator or in python on a single line, and we will continue to be typing out expressions on a single line for a while.

Here is someone's thread with quite an interesting take and series of arguments about why the answer is 1.

If we take a step back, and if we accept that what the video and that thread say are true, then how on earth did we get into this situation? It seems like most calculators were doing it right, then TI changed quite abruptly. Casio wavered back and forth. HP were inconsistent. Even Wolfram Alpha is inconsistent. Only Sharp have steadfastly stuck from what I can see. I think programming languages go with this rigid PEMDAS interpretation.
Find all posts by this user
Quote this message in a reply
12-04-2023, 12:09 AM
Post: #11
RE: 8÷2(1+3)
(12-03-2023 11:15 PM)dm319 Wrote:  Even Wolfram Alpha is inconsistent.

What are these?
Find all posts by this user
Quote this message in a reply
12-04-2023, 12:30 AM
Post: #12
RE: 8÷2(1+3)
(12-03-2023 11:15 PM)dm319 Wrote:  They are not equivalent to the multiplication operator IMO, though can be converted to it with brackets, i.e. 2a = (2 x a).

If that is the case then:

\(
2a^3 = (2 \times a)^3 = 2^3 \times a^3 = 8 \times a^3
\)

Do you agree or do you come up with another special rule out of thin air?
Find all posts by this user
Quote this message in a reply
12-04-2023, 12:30 AM (This post was last modified: 12-04-2023 12:31 AM by Steve Simpkin.)
Post: #13
RE: 8÷2(1+3)
The Casio fx-9750GIII has an interesting solution to this type of problem. It has the option to interpret Implicit Multiplication either way. Its "Imp Multi" option will determine if the answer to problems such as 6/2(1+2) is either 1 or 9.

https://drive.google.com/file/d/1Jj67ga2...sp=sharing
Visit this user's website Find all posts by this user
Quote this message in a reply
12-04-2023, 01:15 AM (This post was last modified: 12-04-2023 01:17 AM by Eddie W. Shore.)
Post: #14
RE: 8÷2(1+3)
(12-04-2023 12:30 AM)Thomas Klemm Wrote:  
(12-03-2023 11:15 PM)dm319 Wrote:  They are not equivalent to the multiplication operator IMO, though can be converted to it with brackets, i.e. 2a = (2 x a).

If that is the case then:

\(
2a^3 = (2 \times a)^3 = 2^3 \times a^3 = 8 \times a^3
\)

Do you agree or do you come up with another special rule out of thin air?

To me, 2a^3 = 2 × a^3 = (2 × a^3) not 8 × a^3

As I maintain, problems like this need another symbol/set of parenthesis to make the problem clear.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-04-2023, 06:42 AM
Post: #15
RE: 8÷2(1+3)
(12-04-2023 01:15 AM)Eddie W. Shore Wrote:  As I maintain, problems like this need another symbol/set of parenthesis to make the problem clear.

Maybe... that's why real programming languages are explicit. Everything else discussed is academic tail chasing. What matters is when the code hits the silicon.

-J
Find all posts by this user
Quote this message in a reply
12-04-2023, 09:46 AM
Post: #16
RE: 8÷2(1+3)
(12-04-2023 12:30 AM)Thomas Klemm Wrote:  Do you agree or do you come up with another special rule out of thin air?

PEMDAS/BODMAS is not the rule book on the rules of algebra. You weren't taught it, and neither was I, so I guess we were taught a series of rules. To be fair, the acronym isn't even that good - it doesn't take into account multiply/divide and addition/subtraction being equal precedence, and it has no mention of the left-to-right rule.

So yes, I think there are plenty of special rules in maths, but they don't come from thin air. There's historical evidence to suggest that treating coefficients as a special case has been the case long before our calculators or programming languages. We were taught in school the rules for 'collecting like terms', and we were taught that x and x^2 are not like terms. The implication there is that the power takes precedence, and so we know it has precedence over the coefficient. I don't think that undermines coefficients being different to the multiply operator.

I agree though that there doesn't appear to be a formal documentation of these 'rules'.

(12-04-2023 12:30 AM)Thomas Klemm Wrote:  What are these?

Are you asking about inconsistencies or about Wolfram Alpha?

If you compare the result for:

8÷2b where b = 2
(8)

and:
8÷ab where a = 2 and b = 2
(2)

Anyway, I think it's an interesting subject, and it gets more curious the more I delve into it. I also find the different kinds of arguments about it interesting. Like whether we should care or not, whether we should use parens for everything, whether we should just accept the majority device way of doing it and move forward etc..
Find all posts by this user
Quote this message in a reply
12-04-2023, 11:25 AM
Post: #17
RE: 8÷2(1+3)
very interesting article
Howard Ludwig - “Why are people so confused about PEMDAS?”
https://www.quora.com/Why-are-people-so-...out-PEMDAS

Matlab:
8/2(1+2)
8/2(1+2)

Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
Find all posts by this user
Quote this message in a reply
12-04-2023, 08:05 PM (This post was last modified: 12-04-2023 08:08 PM by johnb.)
Post: #18
RE: 8÷2(1+3)
Of course, Dr. Kenneth Iverson solved the precedence problem an entirely different way.

APL (which he originally intended as a complete replacement for existing mathematical notation) evaluates operators from right to left... period. NO operator precedence.
In APL programs, you see a lot of odd-looking stuff, like y ← b + m * x.

Of course, he also thought that all the other symbology was just WACK, so _everything_ got reduced to explicit monadic and dyadic operators.

Daily drivers: 15c, 32sII, 35s, 41cx, 48g, WP 34s/31s. Favorite: 16c.
Latest: 15ce, 48s, 50g. Gateway drug: 28s found in yard sale ~2009.
Find all posts by this user
Quote this message in a reply
12-06-2023, 09:42 AM
Post: #19
RE: 8÷2(1+3)
(12-04-2023 09:46 AM)dm319 Wrote:  
(12-04-2023 12:30 AM)Thomas Klemm Wrote:  Do you agree or do you come up with another special rule out of thin air?
PEMDAS/BODMAS is not the rule book on the rules of algebra. You weren't taught it, and neither was I, so I guess we were taught a series of rules. To be fair, the acronym isn't even that good - it doesn't take into account multiply/divide and addition/subtraction being equal precedence, and it has no mention of the left-to-right rule.

We (in the USA) were taught simple PEMDAS where parentheses have the highest precedence, followed by exponentiation, then multiplication and division are of equal precedence, addition and subtraction are of equal precedence and operations of equal precedence are performed left-to-right. We were never taught that implied multiplication has precedence over explicit. There is neither a "right" or "wrong" way. Both have a good case for use. I agree with those people who call for writers to always using explicit symbols so there is no ambiguity.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)