this post was submitted on 03 Dec 2023
418 points (100.0% liked)

196

16244 readers
1986 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] mindbleach@sh.itjust.works 111 points 9 months ago (21 children)

Different compilers have robbed me of all trust in order-of-operations. If there's any possibility of ambiguity - it's going in parentheses. If something's fucky and I can't tell where, well, better parenthesize my equations, just in case.

load more comments (21 replies)
[–] Pavidus@lemmy.world 98 points 9 months ago (38 children)

There's quite a few calculators that get this wrong. In college, I found out that Casio calculators do things the right way, are affordable, and readily available. I stuck with it through the rest of my classes.

[–] queue@lemmy.blahaj.zone 52 points 9 months ago (4 children)

Casio does a wonderful job, and it's a shame they aren't more standard in American schooling. Texas Instruments costs more of the same jobs, and is mandatory for certain systems or tests. You need to pay like $40 for a calculator that hasn't changed much if at all from the 1990's.

Meanwhile I have a Casio fx-115ES Plus and it does everything that one did, plus some nice quality of life features, for less money.

[–] burgersc12@sh.itjust.works 33 points 9 months ago

$40??!! My ti that was required was like over $200!!

[–] cerement@slrpnk.net 24 points 9 months ago* (last edited 9 months ago)

TI did the same thing Quark and Adobe did later on – got dominance in their markets, killed off their competition, and then sat back and rested on their laurels thinking they were untouchable

EDIT: although in part, we should thank TI for one thing – if they hadn’t monopolized the calculator market, Commodore would’ve gone into calculators instead of computers

load more comments (2 replies)
load more comments (37 replies)
[–] Elderos@sh.itjust.works 76 points 9 months ago (5 children)

In some countries we're taught to treat implicit multiplications as a block, as if it was surrounded by parenthesis. Not sure what exactly this convention is called, but afaic this shit was never ambiguous here. It is a convention thing, there is no right or wrong as the convention needs to be given first. It is like arguing the spelling of color vs colour.

[–] Zagorath@aussie.zone 58 points 9 months ago (7 children)

This is exactly right. It's not a law of maths in the way that 1+1=2 is a law. It's a convention of notation.

The vast majority of the time, mathematicians use implicit multiplication (aka multiplication indicated by juxtaposition) at a higher priority than division. This makes sense when you consider something like 1/2x. It's an extremely common thing to want to write, and it would be a pain in the arse to have to write brackets there every single time. So 1/2x is universally interpreted as 1/(2x), and not (1/2)x, which would be x/2.

The same logic is what's used here when people arrive at an answer of 1.

If you were to survey a bunch of mathematicians—and I mean people doing academic research in maths, not primary school teachers—you would find the vast majority of them would get to 1. However, you would first have to give a way to do that survey such that they don't realise the reason they're being surveyed, because if they realise it's over a question like this they'll probably end up saying "it's deliberately ambiguous in an attempt to start arguments".

[–] itslilith@lemmy.blahaj.zone 26 points 9 months ago (21 children)

The real answer is that anyone who deals with math a lot would never write it this way, but use fractions instead

load more comments (21 replies)
load more comments (6 replies)
[–] And009@reddthat.com 17 points 9 months ago (26 children)

BDMAS bracket - divide - multiply - add - subtract

[–] Tlaloc_Temporal@lemmy.ca 15 points 9 months ago (9 children)

BEDMAS: Bracket - Exponent - Divide - Multiply - Add - Subtract

PEMDAS: Parenthesis - Exponent - Multiply - Divide - Add - Subtract

Firstly, don't forget exponents come before multiply/divide. More importantly, neither defines wether implied multiplication is a multiply/divide operation or a bracketed operation.

load more comments (9 replies)
load more comments (25 replies)
[–] doctorcrimson@lemmy.today 14 points 9 months ago (2 children)

I think when a number or variable is adjacent a bracket or parenthesis then it's distribution to the terms within should always take place before any other multiplication or division outside of it. I think there is a clear right answer and it's 1.

[–] derphurr@lemmy.world 14 points 9 months ago (4 children)

No there is no clear right answer because it is ambiguous. You would never seen it written that way.

Does it mean A÷[(B)(C)] or A÷B*C

load more comments (4 replies)
load more comments (1 replies)
load more comments (2 replies)
[–] linuxdweeb@lemm.ee 73 points 9 months ago (4 children)

Please Excuse My Dear Aunt Sally, she downloaded a shitty ad-infested calculator from the Google Play store.

load more comments (4 replies)
[–] GTG3000@programming.dev 51 points 9 months ago (2 children)

I'm with the right answer here. / and * have same precedence and if you wanted to treat 2(2+2) as a single unit, you should have written it like (2*(2+2)).

[–] sushibowl@feddit.nl 75 points 9 months ago (6 children)

It's pretty common even in academic literature to treat implied multiplication as having higher precedence than explicit multiplication/division. Otherwise an expression like 1 / 2n would have to be interpreted as (1 / 2) * n rather than the more natural 1 / (2 * n).

A lot of this bullshit can be avoided with better notation systems, but calculators tend to be limited in what you can write, so meh. Unless you want to mislead people for the memes, just put parentheses around things.

[–] GTG3000@programming.dev 14 points 9 months ago (7 children)

That's fair. Personally, I just have a grudge against math notation in general. Makes my programmer brain hurt when there's no consistency and a lot of implicit rules.

Then again, I also like Lisp so I'm not exactly without sin.

load more comments (7 replies)
load more comments (5 replies)
load more comments (1 replies)
[–] Pharmacokinetics@lemmy.world 50 points 9 months ago (30 children)

People keep debating over this stuff. I have a simpler solution. Math is not real.

load more comments (30 replies)
[–] complacent_jerboa@lemmy.world 47 points 9 months ago* (last edited 9 months ago) (1 children)

this is why I never use ÷ (or more realistically "/") without explicit brackets denoting order of operations.

load more comments (1 replies)
[–] arisunz@lemmy.blahaj.zone 30 points 9 months ago (27 children)

this comment section illustrates perfectly why i hate maths so much lmao

love ambiguous, confusing rules nobody can even agree on!

[–] onion@feddit.de 39 points 9 months ago (5 children)

The problem isn't math, it's the people that suck at at it who write ambigous terms like this, and all the people in the comments who weren't educated properly on what conventions are.

load more comments (5 replies)
[–] UnRelatedBurner@sh.itjust.works 18 points 9 months ago (17 children)

lol, math is literally the only subject that has rules set in stone. This example is specifically made to cause confusion. Division has the same priority as multiplication. You go from left to right. problem here is the fact that you see divison in fraction form way more commonly. A fraction could be writen up as (x)/(y) not x/y (assuming x and y are multiple steps). Plain and simple.

The fact that some calculator get it wrong means that the calculator is wrongly configured. The fact that some people argue that you do () first and then do what's outside it means that said people are dumb.

They managed to get me once too, by everyone spreading missinformation so confidently. Don't even trust me, look up the facts for yourself. And realise that your comment is just as incorrect as everyone who said the answer is 1. (uhm well they don't agree on 0^0, but that's kind of a paradox)

[–] Zagorath@aussie.zone 14 points 9 months ago (12 children)

If we had 1/2x, would you interpret that as 0.5x, or 1/(2x)?

Because I can guarantee you almost any mathematician or physicist would assume the latter. But the argument you're making here is that it should be 0.5x.

It's called implicit multiplication or "multiplication indicated by juxtaposition", and it binds more tightly than explicit multiplication or division. The American Mathematical Society and American Physical Society both agree on this.

BIDMAS, or rather the idea that BIDMAS is the be-all end-all of order of operations, is what's known as a "lie-to-children". It's an oversimplification that's useful at a certain level of understanding, but becomes wrong as you get more advanced. It's like how your year 5 teacher might have said "you can't take the square root of a negative number".

load more comments (12 replies)
load more comments (16 replies)
load more comments (25 replies)
[–] Buffaloaf@lemmy.world 29 points 9 months ago

Just write it out as a fraction and avoid all the confusion

[–] ICastFist@programming.dev 25 points 9 months ago (8 children)

The problem is that there's no "external" parentheses to really tell us which is right: (8 / 2) * 4 or 8 / (2 * 4)

The amount of comments here shows how much debate this "simple" thing generates

[–] qarbone@lemmy.world 32 points 9 months ago

When there are no parentheses, you process left to right on the same tier of operations. That's how it's always been processed.

[–] EvokerKing@lemmy.world 20 points 9 months ago (1 children)

Afaik the order of operations doesn't have distributive property in it. It would instead simply become multiplication and would go left to right and would therefore be 16.

load more comments (1 replies)
load more comments (6 replies)
[–] brlemworld@lemmy.world 25 points 9 months ago

The calculator is correct

[–] dynamo@lemm.ee 25 points 9 months ago (1 children)
load more comments (1 replies)
[–] MystikIncarnate@lemmy.ca 25 points 9 months ago (13 children)
load more comments (13 replies)
[–] queue@lemmy.blahaj.zone 23 points 9 months ago* (last edited 6 months ago) (16 children)

For anyone like me who has math as their worst subject: PEMDAS.

PEMDAS is an acronym used to mention the order of operations to be followed while solving expressions having multiple operations. PEMDAS stands for P- Parentheses, E- Exponents, M- Multiplication, D- Division, A- Addition, and S- Subtraction.

So we gotta do it in the proper order. And remember, if the number is written like 2(3) then its multiplication, as if it was written 2 x 3 or 2 * 3.

So we read 8/2(2+2) and need to do the following;

  • Read the Parentheses of (2 + 2) and follow the order of operations within them, which gets us 4.
  • Then we do 2(4) which is the same as 2 x 4 which is 8
  • 8 / 8 is 1.

The answer is 1. The old calculator is correct, the phone app which has ads backed into it for a thing that all computers were invented to do is inaccurate.

[–] a_fine_hound@lemmy.world 33 points 9 months ago* (last edited 9 months ago) (12 children)

Well that's just wrong... Multiplication and division have equal priorities so they are done from left to right. So: 8 / 2 * (2 + 2)=8 / 2 * 4=4 * 4=16

load more comments (12 replies)
[–] CaptDust@sh.itjust.works 21 points 9 months ago* (last edited 9 months ago) (2 children)

Uh.. no the 1 is wrong? Division and multiplication have the same precedence, so the correct order is to evaluate from left to right, resulting in 16.

[–] kakes@sh.itjust.works 28 points 9 months ago (1 children)

The real correct order is to use brackets to remove ambiguity.

[–] Kalkaline@leminal.space 13 points 9 months ago

Exactly, these types of problems are designed to make people confused and discuss PEMDAS and drive social media engagement.

load more comments (1 replies)
[–] amtwon@lemmy.world 13 points 9 months ago (1 children)

not to be That Guy, but the phone is actually correct... multiplication and division have the same precedence, so 8 / 2 * 4 should give the same result as 8 * 4 / 2, ie 16

load more comments (1 replies)
[–] nutcase2690@lemmy.dbzer0.com 13 points 9 months ago (2 children)

The problem with this is that the division symbol is not an accurate representation of the intended meaning. Division is usually written in fractions which has an implied set of parenthesis, and is the same priority as multiplication. This is because dividing by a number is the same as multiplying by the inverse, same as subtracting is adding the negative of a number.

8/2(2+2) could be rewritten as 8×1/2×(2+2) or (8×(2+2))/2 which both resolve into 16.

load more comments (2 replies)
load more comments (11 replies)
[–] LopensLeftArm@sh.itjust.works 23 points 9 months ago (3 children)

The correct answer is 16. Multiplication and Division happen at the same level of priority, and are evaluated left-to-right.

[–] onion@feddit.de 19 points 9 months ago (2 children)

No it's ambiguous, you claiming there is one right answer is actually wrong.

[–] LopensLeftArm@sh.itjust.works 12 points 9 months ago (23 children)

It is not ambiguous at all, there absolutely is one right answer, and it is 16.

load more comments (23 replies)
load more comments (1 replies)
load more comments (2 replies)
[–] Malgas@beehaw.org 19 points 9 months ago (7 children)

Left is correct; implicit multiplication takes precedence over explicit multiplication or division.

load more comments (7 replies)
load more comments
view more: next ›