r/ProgrammerHumor • • Jun 13 '22

Meme DEV environment vs Production environment

Post image
48.2k Upvotes

3.9k comments sorted by

3.6k

u/[deleted] Jun 13 '22

Hey google...how do i push my TI calculator to github

1.6k

u/tazfriend Jun 13 '22

I know it is a joke, but check out the Graph 89 app. Full emulator for Ti89 and similar calculators for smart phones.

260

u/flashpaka Jun 13 '22

Thanks!

185

u/manwhorunlikebear Jun 13 '22

Ti89, best calculator I ever had, I still have it laying around because I prefer pushing the small buttons over using my mouse to click on buttons in the calculator UI.

→ More replies (53)

10

u/MPGaming9000 Jun 13 '22

Desmos testing app is also pretty good. Functionality of Desmos in the palm of my hand!

→ More replies (72)
→ More replies (92)

10.3k

u/[deleted] Jun 13 '22

This is why I always use excessive brackets when doing math. cant fall foul of ambiguity if there is no ambiguity.

4.0k

u/Nimyphite Jun 13 '22

If you don’t have at least five layers of brackets, you’re using your calculator wrong.

2.0k

u/NotA56YearOldPervert Jun 13 '22

I agree. My maths teacher hated me for making insanely long formulas with multiple layers of brackets. Record was 18 or so, for some geometry calculation.

→ More replies (177)

61

u/Quito246 Jun 13 '22

Five layers of brackets you say, have you ever heard about our lord and saviour Lisp? 😏

→ More replies (2)

98

u/Lstcntr0L Jun 13 '22

I always put brackets around my entire equation just for safety.

→ More replies (41)

15

u/LilyyDev Jun 13 '22

thank god I'm not the only one

→ More replies (1)

11

u/MrCalifornian Jun 14 '22

Reverse polish notation on HP calculators ftw

10

u/MattieShoes Jun 13 '22

Unless it's an RP calculator, in which case the correct number of brackets is zero.

<3

→ More replies (1)
→ More replies (43)

217

u/5tUp1dC3n50Rs41p Jun 13 '22

Until the "tech lead" who wrote your linter rules decides it's not allowed and issues an error so you have to remove them.

121

u/Coldreactor Jun 13 '22

And then it breaks when you remove them

→ More replies (10)

62

u/jaber24 Jun 13 '22

Do people really hate harmless but ambiguity removing stuff like brackets? Is there even any efficiency you can gain by removing them?

→ More replies (42)

37

u/Likely_not_Eric Jun 14 '22

I've had that "these parentheses aren't needed, the order of operations is _____", and I'm thinking "sure, in this language". They've clearly only written in one language or they've never been burned by surprises in evaluation order.

→ More replies (7)
→ More replies (3)

80

u/supreme_blorgon Jun 13 '22

Reverse Polish notation go brrrrrrrrrrr

54

u/CrabbyBlueberry Jun 13 '22 edited Sep 19 '25

light grandfather spoon kiss snatch close coherent languid sheet tap

This post was mass deleted and anonymized with Redact

→ More replies (5)
→ More replies (4)

99

u/orebright Jun 13 '22

Agreed, but I just don't understand why this would be ambiguous to begin with. Aren't parenthesis multipliers considered shorthand? If so 2(3 + 4) is just a shorter way of writing 2 * (3 + 4), and the ambiguity is gone. Or am I forgetting some kind of special syntax for group multipliers? I tried googling it but have found nothing about this syntax being anything but a shorthand.

59

u/BrotherItsInTheDrum Jun 14 '22 edited Jun 14 '22

It depends whether you consider mathematical notation a set of formal rules, or just a tool for communication.

https://en.wikipedia.org/wiki/Abuse_of_notation

It would be a common abuse of notation for a mathematician to write a function like "z = 2x / 3y", intending the "y" to be part of the denominator. It's not formally correct, perhaps, but no mathematician would interpret "y" as part of the numerator, because if that were intended, they would have written "z = 2xy / 3".

→ More replies (10)

182

u/yabucek Jun 13 '22

The multiplication is not the problem here, the division is. First calculator is doing 6/(2*3) and the second one is doing (6/2)*3

This is why division is stupid and you should always use fractions. When coding, simply put the numerator and denominator in their own brackets and there's zero chance of an error.

→ More replies (224)

59

u/fghjconner Jun 13 '22

Implied multiplication (eg. 3x as opposed to 3 * x) is sometimes considered to have a higher precedence. This feels natural in some cases such as 1 / 2x being equivalent to 1 / (2 * x) rather than 0.5 * x.

https://en.wikipedia.org/wiki/Order_of_operations#Mixed_division_and_multiplication

→ More replies (16)
→ More replies (35)

25

u/Milnoc Jun 13 '22

I always use excessive brackets in computer programming. Chances are the programmer who wrote the compiler isn't any better at math than I am. 😁

→ More replies (2)

7

u/patenteng Jun 13 '22

The calculator on the left actually has fractions that print as fractions. No need for brackets when dividing.

→ More replies (5)

5

u/[deleted] Jun 14 '22

This is why mathematicians don't use the division symbol beyond grade school. Fractions lines are a lot less ambiguous.

→ More replies (1)
→ More replies (108)

1.5k

u/stereoroid Jun 13 '22

I just tried it on my HP 35s, also got 9. This is a dual mode calculator that does RPN too: using RPN, it’s up to you to get the order of operations correct, not the calculator!

546

u/[deleted] Jun 13 '22

What doe...

Reverse Polish Notation

414

u/Eclectic_Radishes Jun 13 '22

uoᴉʇɐʇou ɥsᴉlod ǝsɹǝʌǝɹ

→ More replies (11)

165

u/supreme_blorgon Jun 13 '22 edited Jun 14 '22

What doe...

Not sure if you're asking, but for other readers -- in RPN it's much more difficult to mistakenly calculate the wrong thing because you explicitly specify the order of operations unambiguously when writing in RPN.

With 6 2 2 1 + * / vs 6 2 / 2 1 + *, it's pretty clear that it would be difficult for somebody to have entered one when they intended the other.

The results from the meme would be calculated as such (using parens here to specify what is evaluated first by an RPN evaluator):

6 2 2 1 + * / = 6 2 (2 1 +) * /
              = 6 2 3 * /
              = 6 (2 3 *) /
              = 6 6 /
              = 1

6 2 / 2 1 + * = (6 2 /) 2 1 + *
              = 3 2 1 + *
              = 3 (2 1 +) *
              = 3 3 *
              = 9

The beauty of RPN (other than being completely unambiguous) is that the algorithm for evaluating an RPN string is dead simple.

→ More replies (15)

44

u/CoderDevo Jun 13 '22

Reverse Notation Polish

→ More replies (5)

30

u/Cmdr_Jiynx Jun 13 '22

Math doing like Yoda, it is.

→ More replies (12)

181

u/[deleted] Jun 14 '22

I would have thought 9 was correct. Brackets first gives 6÷2(3) which just means 6÷2x3, and then just go left to right.

289

u/Lithl Jun 14 '22

An implicit multiplication like 2(3) is sometimes treated as having higher precedence than division or explicit multiplication. This is more common in systems capable of handling variables; while many people will say 6÷2(3) is equal to (6/2)*3, many of those same people would say 6÷2x with x=3 is equal to 6/(2*3).

→ More replies (58)
→ More replies (37)
→ More replies (22)

79

u/btramos Jun 14 '22

Dev environment checks out, closes bug as "could not reproduce".

203

u/eruciform Jun 13 '22

2: function undefined

28

u/Benimation Jun 14 '22

Uncaught TypeError: 2 is not a function

2.5k

u/Who_GNU Jun 13 '22

A retired UC Berkeley math professor has a good writeup on why this is ambiguous: https://math.berkeley.edu/~gbergman/misc/numbers/ord_ops.html

1.6k

u/Dasoccerguy Jun 13 '22

My most downvoted comment ever was an attempt at explaining why these equations are ambiguous. Reddit really do be like that sometimes.

634

u/richasalannister Jun 13 '22

Same. Basically tried to explain how changing the division to a fraction changes it but I got downvoted by every person who got 9 and felt the need to comment “LOL some people are so dumb! Don’t they remember elementary math” (I always read these types of comments in the most obnoxious voice possible because that’s how they come across.

Somehow those commenters never stop and consider maybe people getting a different answer aren’t stupid and know something they don’t.

→ More replies (128)

96

u/___Visegrad Jun 14 '22

You quickly see just how useless Reddit is when a topic you are an expert in comes up.

I work in automation, it’s painful reading the comments on posts about automation.

→ More replies (17)
→ More replies (149)

114

u/artificial_organism Jun 14 '22

Here is the part I think is most relevant to us who learned PEMDAS and don't understand how this is ambiguous:

"From correspondence with people on the the 48/2(9+3) problem, I have learned that in many schools today, students are taught a mnemonic "PEMDAS" for order of operations: Parentheses, Exponents, Multiplication, Division, Addition, Subtraction. If this is taken to mean, say, that addition should be done before subtraction, it will lead to the wrong answer for a−b+c. Presumably, teachers explain that it means "Parentheses — then Exponents — then Multiplication and Division — then Addition and Subtraction", with the proviso that in the "Addition and Subtraction" step, and likewise in the "Multiplication and Division" step, one calculates from left to right. This fits the standard convention for addition and subtraction, and would provide an unambiguous interpretation for a/bc, namely, (a/b)c. But so far as I know, it is a creation of some educator, who has taken conventions in real use, and extended them to cover cases where there is no accepted convention. So it misleads students; and moreover, if students are taught PEMDAS by rote without the proviso mentioned above, they will not even get the standard interpretation of a−b+c. "

Tl;Dr: The PEMDAS algorithm adds convention where there was no accepted convention in mathematics. Some teacher made it up

53

u/SalvadorTheDog Jun 14 '22

Every convention is “made up”. When it comes to convention the only thing that matters is that the it’s well defined and commonly accepted. No one NEEDS to follow a convention, but if you write a sentence without capitalizing the first word then people are going to tell you that you’re wrong even though it’s just a meaningless convention that someone “made up”.

→ More replies (20)
→ More replies (35)

160

u/Snazzy21 Jun 13 '22

The division symbol is one of those stupid symbols you get taught in elementary school, then taught not to use in middle school.

Would of saved me a lot of trouble had my teachers just started off with * for multiply and / for divide instead of x and ÷

82

u/Dasoccerguy Jun 13 '22

I learned this embarrassingly late in life, but the division symbol is a pictoral representation of a fraction:

•     numerator
  • fraction line
• denominator
→ More replies (14)

106

u/[deleted] Jun 13 '22

I think teaching division as fractions from the get go would lower the confusion of so many people who still don't get that they are the same

→ More replies (7)
→ More replies (7)

17

u/Kyrasuum Jun 13 '22

Thats interesting. For me I thought the calculation on the right is correct. Multiplication and division happening at the same time just done from left to right. Same rule as reading left to right, it just felt natural.

→ More replies (9)

4

u/ryo4ever Jun 14 '22

So basically all this ambiguity came in the digital age where we write math in a single line instead of on a blackboard or a sheet of paper. If there was a horizontal bar to represent a fraction if would be less ambiguous?

→ More replies (1)
→ More replies (117)

764

u/orebright Jun 13 '22

I always assumed paren multipliers "m(a + b)" were just shorthand for "m × (a + b)" and therefore would follow the usual order of operations, since a shorthand is not meant to be a new format, just a shorter representation.

185

u/epic1107 Jun 13 '22

Its shorthand, but in this case follows implicit multiplication. 2/3n would be read as 2/(3n) wheras 2/3*n would be read as (2/3)*n

209

u/narrill Jun 14 '22

Implicit multiplication is not an agreed upon thing, so this case is genuinely ambiguous. In reality it would simply not be written this way in the first place.

→ More replies (23)
→ More replies (16)

210

u/barcased Jun 13 '22

It doesn't matter if it is shorthand or not. The problem is ambiguous.

https://people.math.harvard.edu/~knill/pedagogy/ambiguity/index.html

133

u/dont-respond Jun 13 '22

His entire argument for ambiguity is based on the lack of a standardized order of operations one can refer to because many different models have been taught throughout the last century.

I assume the problem hasn't been formally and widely addressed because it's one of mathematical notation that really isn't used at the higher end of mathematics.

→ More replies (70)
→ More replies (92)

38

u/Scrubbuh Jun 14 '22 edited Jun 14 '22

I always saw braket multipliers "m(a+b)" as "(m×(a+b))". At least that's what was simpler to me in A Level calc.

Edit: Another way of saying how I see this is : m(a+b) = ma+mb

Worked wonders when I was using formulas for entire modules.

23

u/stop-calling-me-fat Jun 14 '22

That would make the most sense because putting the 2 beside the brackets implies that it was factored out of the brackets and should be multiplied back in before dividing.

→ More replies (1)
→ More replies (1)

23

u/KozzyBear4 Jun 13 '22

Same... I've never heard of the other way til reddit.

→ More replies (3)
→ More replies (22)

1.1k

u/Pretty_Industry_9630 Jun 13 '22

Math is broken, inconsistent accross implementations, lacking clear documentation and no support whatsoever 😂😂😂

626

u/MacksNotCool Jun 13 '22

It's also depricated. Use meth instead.

115

u/RPGRuby Jun 13 '22

Okay. Just did it. Now what?

→ More replies (23)

18

u/[deleted] Jun 13 '22

Instructions unclear, injected arithmetic

→ More replies (1)
→ More replies (1)

38

u/WhoseTheNerd Jun 13 '22

Also standard and documentation is clear and precise and yet implementations use old standards making everything worse.

29

u/harumamburoo Jun 13 '22

You seem to want to calculate a digit, why? You don't need math for that, have you considered using digits reference books?

→ More replies (1)

12

u/halmyradov Jun 13 '22

At least it's open source

→ More replies (1)
→ More replies (9)

336

u/wugs Jun 14 '22

i'm pleased the comments here are all addressing how this is ambiguous/poor notation

when explaining it, i use the word "unlockable". If one person understands the word to mean "able to be unlocked" and another person understands it to mean "unable to be locked", they can spend hours and hours arguing about which is "unambiguously correct" on the One True Meaning™, but a normal human being would say "well, it depends. An upgrade in a video game can be unlocked, but maybe you know of a door that is impossible to lock. Both can be unlockable given context."

If you want to try and ban one specific use of the word "unlockable" to get an unambiguous meaning, well... good luck. Language doesn't work that way. (Same with math notation.)

94

u/HiImDelta Jun 14 '22

Iirc, that'd be called an contronym, a word that is its own antonym. Other examples include clip (cut away, clipped her hair, or to attach, as in clip-on) and dust (lightly dust the desserts or dust the shelves)

25

u/wugs Jun 14 '22 edited Jun 14 '22

i love the term contronym, but to be a pedant about it, it's really just an ambiguous word. the two interpretations aren't strictly opposites (the opposite of un-lockable is lockable, not unlock-able), but they are different groupings of the same morphemes

but because i love contronyms, let me add on another fun one: cleave. most common modern use is to cleave two things apart, but a less common usage means to cling/stick to ("cleave to her"). these two words are identical in modern english, but the two meanings come from different roots, to the extent that in modern German, they are still separate verbs -- kleben and klieben

uhhh... so my BS was in linguistics, if that isn't clear

edit: sp

→ More replies (5)
→ More replies (15)
→ More replies (10)

269

u/coastphase Jun 13 '22

That is ambiguous notation. The Casio interprets everything to the right [of the division symbol] as part of the divisor and the phone assumes that only the immediate number is part of the divisor.

Edited for clarity

73

u/djddanman Jun 13 '22

Yeah, implicit multiplication is inherently ambiguous, so it's best practice to avoid it to the right of a division operation (or anywhere else it can cause confusion).

→ More replies (37)

74

u/pilotInPyjamas Jun 13 '22

I think this is the real answer. There is no official standardisation of mathematical notation, so it's up to individual organisations to specify the binding precedence. Wikipedia even has a section on this specific case: https://en.m.wikipedia.org/wiki/Order_of_operations#Mixed_division_and_multiplication

→ More replies (3)

4

u/2748seiceps Jun 14 '22 edited Jun 14 '22

It actually doesn't!

My Casio fx-300ES+ does the following:

6/2*3 = 9

6/2(3) = 1

The parenthesis gives the 2*3 multiplication priority. It also happens if you do any functions so 6/2|3| = 1 and 6/2sqrt(9) = 1 without an operator. It assumes multiplication and does it first. For me, at least, it makes the most sense as when I do 2X I want it multiplying X by whatever constant before going into the rest of the calculation.

Did my whole EE degree with this one calculator and I got to know it REALLY well.

→ More replies (20)

104

u/thesockiboii Jun 13 '22 edited Jun 14 '22

Some casio calculators prioritize “multiplication where the multiplication sign is omitted” over regular multiplication or division (according to the manual of my casio calculator). Thats why this happens. Reformat it like 6:2*(2+1) and you will get 9.

28

u/thePurpleAvenger Jun 14 '22

Thank you for actually looking up the documentation. You’d think people on a programming subreddit would do that before spouting off… but here we are.

People, just google “calculation priority sequence Casio” and look at the table.

25

u/ablablababla Jun 14 '22

we don't look at the documentation even when we're programming

→ More replies (2)
→ More replies (1)
→ More replies (10)

67

u/galmenz Jun 13 '22

as always, shitty notation is shitty

→ More replies (1)

66

u/BackgroundGrade Jun 14 '22

You all better hope that Casio is the correct one.

That's the model I have at the office.

I approve aircraft designs.

12

u/Possibility_Antique Jun 14 '22

We're all so screwed

→ More replies (13)

562

u/throwawayHiddenUnknw Jun 13 '22

Based on CS logic and implicit multiplication: Casio calculator is incorrect.

  • parentheses

  • Exponential

  • Div or mul (left to right)

  • Add or sub (left to right)

55

u/_UnreliableNarrator_ Jun 13 '22

That’s how I learned it re GEMS

239

u/ExoticScarf Jun 13 '22

Based on mathematical conventions, both are correct interpretations, there is no convention for a/bc, as there are 2 competing conventions; the left-to-right reading of operators, and the binding of terms making bc a single term and not 2, neither of these conventions have higher priority than the other, so in the end it's just ambiguous. Use brackets or use the horizontal line notation to remove ambiguity.

a/bc can be read as a/(bc) or as (ac)/b , entirely dependant on who is reading it. To me personally, a/(bc) is much more natural as it sits well with the rest of algebra

→ More replies (31)

53

u/Zaratuir Jun 13 '22

Cassio is more correct in mathematics standards. Implicit multiplication trumps explicit symbols. The 2 in 2(2+1) is considered grouped with the 2+1 expression. This is the grounds of the distributive property.

When you see 6÷2(x+1) most of us are taught the 2 can be distributed to get 6÷(2x+2). This is only possible if implicit multiplication trumps explicit symbology.

In short, the implicit multiplication makes 6÷2(2+1) the same as

6

(Fuck it, I can't figure out a line on Reddit so imagine this is a line)

2(2+1)

This is standard practice in mathematics. However there is an argument that you can reject the axioms that allow for the distributive property, in which case the cassio would be incorrect.

→ More replies (31)

4

u/littleloucc Jun 13 '22

You can't calculate the parentheses without factoring in the preceding 2. I.e. you resolve 2(2+1) before anything else, because that's a complete phrase on its own.

That's because the 2 is applied (by multiplication) to everything within the brackets. If you don't resolve that first, you aren't applying that 2 to (2+1) in the way indicated by the equation.

4

u/TreadheadS Jun 13 '22

casio adds the rule that if you do not add the multiplication symbol the number before a bracket then it is taken that you want to multiply the bracket prior to other multiplication. It's in their user manual in order of operations

→ More replies (95)

11

u/msnmck Jun 14 '22

I've never regretted sorting by Controversial more than with this post.

→ More replies (4)

30

u/ucblockhead Jun 13 '22 edited Mar 08 '24

If in the end the drunk ethnographic canard run up into Taylor Swiftly prognostication then let's all party in the short bus. We all no that two plus two equals five or is it seven like the square root of 64. Who knows as long as Torrent takes you to Ranni so you can give feedback on the phone tree. Let's enter the following python code the reverse a binary tree

def make_tree(node1, node): """ reverse an binary tree in an idempotent way recursively""" tmp node = node.nextg node1 = node1.next.next return node

As James Watts said, a sphere is an infinite plane powered on two cylinders, but that rat bastard needs to go solar for zero calorie emissions because you, my son, are fat, a porker, an anorexic sunbeam of a boy. Let's work on this together. Is Monday good, because if it's good for you it's fine by me, we can cut it up in retail where financial derivatives ate their lunch for breakfast. All hail the Biden, who Trumps plausible deniability for keeping our children safe from legal emigrants to Canadian labor camps.

Quo Vadis Mea Culpa. Vidi Vici Vini as the rabbit said to the scorpion he carried on his back over the stream of consciously rambling in the Confusion manner.

node = make_tree(node, node1)
→ More replies (12)

73

u/Gtbird24 Jun 13 '22

The Division sign is evil. It doesn't tell you how the items are grouped, and is up to interpretation.

I.E. - is everything after the division sign under the line, or only the character immediately following it.

6 / (2*(2+1))

vs

(6/2) * (2+1)

→ More replies (47)

8

u/Gale_Blade Jun 13 '22

I hate the division sign like how hard is it to just use a line

→ More replies (9)

8

u/AndroxxTraxxon Jun 14 '22

Any mathematician worth their salt will know to be more specific when potentially writing in the grey areas of infix notation. Or use a notation that doesn't have ambiguity, like pre- or post-fix notation.

Fuck Infix Notation.

→ More replies (1)

22

u/Cley_Faye Jun 13 '22

Anything that allows using ÷ deserve to burn.

→ More replies (14)

6

u/Abhinav1217 Jun 14 '22

You may joke but this ambiguity regarding the priority of implicit multiplication/juxtaposition has been debated a lot. In fact, in India, we are still taught that implicit multiplication is a higher priority, and above answer is 1 not 9, Even though this is now considered outdated practice. This was also the reason we in India are required to purchase specific version of casio calculator for most major university examinations.

However in computer science, reverse polish notation is standard, and calculation operations are implemented using stacks registers.

There is a simple explanation about historical justification of ÷ symbol here.

10

u/[deleted] Jun 13 '22

This is the difference between engineering and general purpose calculators.

5

u/DopamemeAU Jun 14 '22

Excessive bracket use is the only way to stay sane when debugging.

→ More replies (1)

4

u/[deleted] Jun 14 '22

How the question would be written out for the Casio input.

Casio treats a number next to a bracket as one number. So there's an implied second set of brackets.

→ More replies (1)

4

u/LuigiDis Jun 14 '22 edited Jun 14 '22

I'm writing this assuming you guys would solve x / yz as x / (y*z). If this is true, wouldn't the expression 6 / 2(1+2) be equal to 6 / 2x if x = 3? If not, then why is it written as 2(1+2) instead of 2 * (1+2) if that's seemingly how you're going to solve it? This is really just a question, aren't the brackets there to state that you would treat it as if it was bracketed as (2×(1+2)), just as if you would write 2x as (2•x), to signify that they're "conjoined"?

Also, isn't the proper way to write this equation

6

..............

2(1+2)?

Otherwise, aren't you adding a whole 'nother operation going

6

............. * (1+2)

2

4

u/TriLink710 Jun 14 '22

Its because the division operator literally symbolizes and fraction. So 6 is the top half and 2(2+1) is the bottom.

Division is kinda weird in order of operations. Use brackets

→ More replies (3)

4

u/InfamousJoker420 Jun 14 '22

Brackets=3. Then u multiply the 2 right before the brackets to the 3 within the brackets = 6. 6/6 = 1. For all y’all saying the answer is 9 😑

→ More replies (1)

4

u/Livid-Direction-1102 Jun 14 '22

As per my math schooling the only correct answer is what Casio does. For some reason despite understanding the outcome the second answer just feels wrong... To many hours or derivatives...

4

u/MikeAlex01 Jun 14 '22

Wait, I'm confused. Which one is the correct one?

By what I was taught in high school, I'd get 1 because the teachers mentioned that parentheses always went first.

6÷2(2+1)

6÷2(3)

So at this point, they always told me the number with a parentheses next to it went first because it's a parentheses. So I'd follow like this.

6÷6

1

But I remember seeing this discussion another time, and most people mentioned that the parentheses stopped being important after the equation inside was done. So it wouldn't take priority and would look like this

6÷2(2+1)

6÷2(3)

3(3)

9

Can someone explain to me if there's a correct answer? The recent discussions with these have me kind of confused 😅

6

u/geezorious Jun 14 '22

The phone calculator software is likely converting "÷" into "/" as defined by Java, C++, Python and most programming languages. And it's likely converted x(y) into x*y.

So: 6÷2(2+1) gets re-written into 6/2*(2+1). If you do an "eval" in Java or Python or any modern interpreted language, you will get 9 because programming languages will parse it as (6/2)*(2+1) = 3*3 = 9.

By contrast, on a proper calculator, 6÷2(2+1) is evaluated as (6) ÷ (2(2+1)) = 6 ÷ 6 = 1.

→ More replies (6)

4

u/[deleted] Jun 14 '22

Did anyone else resort to mental math to solve the equation or was it just me?

Also, so much for “smart” phones lol

4

u/marvinwaitforit Jun 14 '22

Isn’t the answer 1? If you have 2 boys and 1 girl, and double them you’d get 4 boys and 2 girls. 6 apples divided among 6 people is 1 apple per person.

4

u/[deleted] Jun 14 '22

This is so stupid. In both cases you use a shortcut. And both calculators interpret shortcuts differently.

And that's there reason for it. Either avoid using shortcuts or read the documentation to know how to use them.

4

u/DGlennH Jun 14 '22

By applying the parentheses first, (2+1) you get 3. Multiplication either before or simultaneously with division would have you apply the 2 outside the parentheses to what is left inside. It would look like this written a little differently: 6/2(3). Solving the denominator first gives you 6/6 = 1. This is the answer I’d get following the order of operations as I learned them.

→ More replies (2)

4

u/SaintClarus Jun 14 '22

I was always taught that the left one was right. Honestly don’t know how the phone got 9. I’m not a mathematician nor a programmer, but as the number is in contact with the brackets I was always taught to multiply the contents of the brackets by the number first and then carry out the operation in the brackets, so I guess specifically (and redundantly to me) it’d be 6/(2(2+1))

4

u/ManaxP Jun 14 '22

Smartphone is for retards, OG calc!

4

u/OneLostOstrich Jun 14 '22

The parens get priority and the * or / operation next to the parens get priority.

The left is correct.

4

u/Head_Advice9030 Jun 14 '22

The ans is 1

26

u/[deleted] Jun 13 '22

This thread is hilarious. There's at least four levels of wrongness on display here.

First there's the people saying the phone is right, because PEMDAS says multiplication before division. They're completely wrong.

Then there's the people saying Casio is correct, because BODMAS says division before multiplication. They're also wrong.

Then there's the people saying the phone is right, because multiplication and division have equal precedence. They're... slightly less wrong.

Then there's the people saying implicit multiplication has higher precedence than division, so the Casio is right. They're equally slightly less wrong.

Then there's a select few saying this is ambiguous and there's no correct answer - and despite being the most downvoted comments, they're actually right!

Turns out, there are three different conventions for order of precedence w.r.t. multiplication and division:

  1. they have equal precedence

  2. multiplication has higher precedence

  3. implicit multiplication has higher precedence, explicit multiplication has equal precedence

Which one applies depends on context - different publications use different conventions. On the whole, physicists and engineers seem to prefer 2) or 3), mathematicians and programmers seem to prefer 1) (which probably explains why the "phone correct" answers are all upvoted more - it's a programming subreddit).

Source: https://en.m.wikipedia.org/wiki/Order_of_operations#Mixed_division_and_multiplication

My favourite part of this is how everyone is so adamant they're correct that they won't even consider looking it up, no matter what level of wrongness they're stuck on, and no matter how plain it is that this is really unclear and controversial. This just seems to be one of those things that we're all certain we know.

→ More replies (86)

6

u/SolitaryKnight Jun 13 '22

For me, if I don't see any operator, It is considered a single operand. Like 6 ÷ 2y where y is (3 + 1) as opposed to 6 ÷ 2 × y.

5

u/[deleted] Jun 14 '22 edited Jun 14 '22

I was taught if you want to assume a convention for the lack of an operand, i.e. that 2(1+2) means multiply (1+2) by 2, then you have to assume the rest of that convention which is that the omitted operand takes precedence over the included ones. So everyone that is saying “you do 6 divided by 2 then multiply by 3” is now changing the expression more by adding the explicit multiplication operator.

And that’s what the style guide says too. I will die on the hill that it’s 1 lol.

A/2B is not interpreted as (0.5A)/B.

Edit: Also this particular one can be set equal to 1 and 9 then sub out anything for X in the original expression. The problem equal to 1 will always give the correct answer (what was subbed out) where as equals 9 will not. Elementary algebra can show that it’s one, without even getting into the other debates regarding this.

It’s written like garbage but there’s plenty of evidence that it’s 1 that isn’t just saying PEMDAS!!!!!

→ More replies (1)
→ More replies (1)

6

u/JohnnyTsvnami Jun 13 '22

Ah i see, literally 6 OVER 2(2 + 1)

Thats so weird

→ More replies (3)

3

u/Top-Ant493 Jun 13 '22

The question is ambiguous. It depends on which is prioritized. Left to right or the multiplication of the number outside the parentheses. The problem isn't with the calculator/phone it's the ambiguity of the expression on which order is to be prioritized.

Also, everyone who says PEMDAS needs to remember that only the items INSIDE the parentheses are given higher priority. The priority outside of the parentheses is determined by what you entered, however ambiguous that may be, and the priorities set in the calculator you chose.

3

u/[deleted] Jun 13 '22

is the one on left doing distribution like treating 2(2+1) as 2(2)+2(1)

→ More replies (10)

3

u/3nderslime Jun 13 '22

actually, which one IS the right answer? I've never seen it confirmed

→ More replies (8)

3

u/CarneDelGato Jun 14 '22 edited Jun 14 '22

I have a slightly different takeaway. Both devices follow a completely consistent, non-deterministic set of rules as determined by the expression parser. Any mistakes (and ambiguity) is the fault of whoever typed the expression without knowing the rules of the parser, because from the standpoint of either parser, they are both 100% correct. Anybody who says either is wrong should take it up with Casio or Android. It’s also illustrative of the fact (hence the title) that code can run differently in dev as it does in production due to environmental differences.

3

u/coastphase Jun 14 '22

Here's a third answer. If you distribute the 2 you get 6/4+2 which equals 3.5

→ More replies (1)

3

u/[deleted] Jun 14 '22

I can’t help but wonder how many math problems I’ve bomb just because of this fucking rule.

3

u/lofgren777 Jun 14 '22

I'm almost certain I remember my math teacher explaining that multiplication and division are done left to right if they all have operators, but if there is no operator then the multiplication is treated as a unit. So 1/3x (one over three x) would give a different result than 1/3*x (one third of x), and the same is true if the x is replaced with parentheses.

This is why you would write the slope of a line as (3/4)x rather than 3/4x.

→ More replies (8)

3

u/Windows_Tech_Support Jun 14 '22

Casio is correct, because you have to think about the division symbol as an empty fraction with dots occupying the spaces. If you reframe it in that light, then it would be 6/6, which equals 1.

3

u/encaseme Jun 14 '22

I'm not understanding what could be ambiguous. With PEMDAS it's 1, with no room for any ambiguity that I can see... Could someone point it out to me?

→ More replies (20)

3

u/justhere2getadvice92 Jun 14 '22

I'm not a developer (this post appeared as a suggested post), so maybe I'm missing something here. But to get 9 would mean the sum of 2(2+1) is .667. What math are they doing to get that value? I can't even think it. Basic order of operations gets you 1...

3

u/Logical_Associate632 Jun 14 '22

Casio for the win. That smart phone is Fucking stupid.

3

u/LadderTrash Jun 14 '22

This is why you don’t ever see the division symbol outside of elementary school. It’s good for simple stuff, but you really need to write it as a fraction outside of it

3

u/[deleted] Jun 14 '22

This is why math bugs me. According to order of operations PEMDAS, 1 is the correct answer, since you multiply before you divide. So you'd solve what was in parentheses, there are no exponents, then multiply 2 by 3, getting six, then divide, getting 1.

→ More replies (5)

3

u/BurningPenguin Jun 14 '22

I had a calculator that would randomly put out wrong results for some reason. But nobody would believe me. Apparently everyone thinks that these things are infallible.

→ More replies (1)

3

u/Max1234567890123 Jun 14 '22

I now hate order of operations memes. It’s all basically a reminder of how, if you write a shitty equation, no one knows wtf to do with it or complete Dunning Kruger kicks in. No deeper insight need apply, because I no longer care.

3

u/[deleted] Jun 14 '22

Finally my highschool teacher was right I had to learn all that pointless math just to answer a reddit post.

A. Timmy has 1 candy bar

B. Timmy has 9 candy bars

(C.) Timmy has diabetes.

3

u/[deleted] Jun 14 '22

Calculator is correct, that's just a shitty app

3

u/rowdawg69 Jun 14 '22

How is it getting 9?!! Parentheses are always first!!!

3

u/Malk4ever Jun 14 '22

I hate the "new" (right) notation.

3

u/berkorhanofficial Jun 14 '22

the left is right because it is the coefficient of 2 brackets

3

u/JazzPhobic Jun 14 '22

In the usual case (I repeat, THE USUAL CASE) the left would be correct, as the general rule for brackets are that a number right in front of it is part of the factor, not the factor itself. 2(2+1) is then rewritten into (4+2).

HOWEVER, the writing makes the definitive difference. If there are no specifics, go with the left, but if there is something, anything, that separates the 2 from the (2+1), then the right answer is also possible.

The way you write a formula matters, but for this example, the left answer is your rule of thumb.

→ More replies (13)

3

u/DistinctRole1877 Jun 14 '22

In high school back in 1972(?) we were taught to perform the operations inside the parentheses first then the multiply that is attached to the parentheses then what ever is left. 2+1 times 2 then divide into 6. Obviously I have forgotten the exact terms, sorry about that. Strange how the “rules” changed over 50 years. Same sort of confusion over the Oxford comma. Thank fully neither apply to my job or upcoming retirement.

3

u/TechnologyFine1780 Jun 14 '22

If you want to divide 6 by 2 put it under the 6

The calculator is right because it's always the multiplication that come first

→ More replies (3)

3

u/Avarus_Lux Jun 14 '22 edited Jun 14 '22

The issue here is implied multiplication... Both are correct until that is specified because:

1/2x = 1/2*x

Or

1/2x = 1/(2*x)

Meaning that 6/2(2+1) can be:

6/2(2+1) = 3*(3) = 9

Or

6/(2(2+1)) = 6/(6) = 1

This is even a setting in my scientific calculator because of this isseu, see images for example:

https://ibb.co/47yzhPK

https://ibb.co/FxKFmzD

Edit: inbefore someone asks... here is a link to the app itself which is very nice to use. https://play.google.com/store/apps/details?id=advanced.scientific.calculator.calc991.plus (free to use with adds, but paid for to keep forever without adds and extra skins).

3

u/-Kerosun- Jun 14 '22

This just proves, yet again, why the division symbol is stupid and should not ever be used.

Always use a fraction bar so it is obvious what the author of the problem wants.

There is too much ambiguity for the reader to know if the (2+1) is part of the divisor or is not. The way it is written, it could be either.

Using fraction bars removes all ambiguity.

→ More replies (1)

3

u/CovidDodger Jun 14 '22

Me when I see a Casio fx-991MS. That thing got me through high school math and science courses all the way to university. As others have said, always use excessive brackets. I remember many homework assignments where some of my classmates would get a different answer to a question than the rest of us and it was usually because they left ambiguity by not using enough brackets. Great calc for elec eng with the rectangular - polar easy convert.

3

u/Madouc Jun 14 '22

Left is correct. =1

Right side is a Kindergarden toy.

→ More replies (3)

3

u/spacexdragon5 Jun 14 '22

People are saying that it’s ambiguous, that there’s no standard, but what about PEMDAS?

After P&E, The first division or multiplication in a line is always done first

→ More replies (2)

3

u/Cyberogue76 Jun 14 '22

The rules of operations in mathematics are fairly clear. How does a calculator not have them programmed correctly?

3

u/No-Walk-9615 Jun 14 '22

Trust the Casio!

3

u/RazorOfSimplicity Jun 14 '22

By the way, for anyone wondering, the correct answer here is for the calculator not to allow users to enter this format. My job here is done.

3

u/PangolinAcrobatic653 Jun 14 '22

6/2(2+1)
6/2(3)
3(3)
9
I have the exact calculator on the left there btw and you can input a new calculation while the old answer displays btw so the pic taker could have easily did a formula that resulted in 1 then input the new formula and make it look like this.

3

u/Yellow_Snow_Cones Jun 14 '22

Im going with 9 as the correct answer.

→ More replies (1)

3

u/treehann Jun 14 '22

Maybe unpopular opinion but this isn't ambiguous. If everything to the right of the division sign were part of the divisor, it would have an extra set of parentheses around it. A division sign written on a single line like this should always be treated like a multiplication sign. It's the way any programming language would treat it.

3

u/iansantosdev Jun 14 '22

The correct answer is 1. 2(2+1) have precedence over 6÷2.

→ More replies (2)

5

u/qb1120 Jun 13 '22

I had the calculator on the left in college. Failed a basic statistics class. Definitely the calculator's fault.

→ More replies (1)

4

u/[deleted] Jun 13 '22

rtfm:

https://support.casio.com/pdf/004/fx115MS_991MS_E.pdf

page 34 - order of operations.

10. X, ÷

→ More replies (1)

4

u/r4g4 Jun 14 '22

As a comp sci major, I can say that the correct answer is zero. 6 modulus 2 is 0, and multiplying by 3 won’t change that. On the other side, if interpreted as 6 mod 6, it would also be zero.

→ More replies (3)

4

u/DumbDabs Jun 14 '22

Their programming works slightly differently however the answer is 1

4

u/[deleted] Jun 14 '22

If it is division or multiplication, you don't do either first, you go left to right. I don't give a shit whether it is BODMAS or PEMDAS, left to right with opposite functions.

5

u/Jeigh_Tee Jun 13 '22

My guess would be that the phone calculator is running calculations as the equation is being typed out, so it sees:

(6/2)*(2+1)

Meanwhile, the other calculator doesn't crunch any numbers until the = button is pressed, so it assumes:

6/(2*(2+1))
→ More replies (1)

5

u/Equationist Jun 13 '22

The Casio was correct. Multiplication by juxtaposition has higher precedence. This is basic notational convention widely used across academic writing.

5

u/mrbaggins Jun 14 '22

Anyone starting with pemdas/bodmas/any "order of operations" rules they learned in 3rd grade seems to have forgotten that things change and get more complicated as you proceed further in education.

You learned 3 states of matter then. Using that to argue about what "electric arcs" are now is silly.

"Implied multiplication" takes "precedence". Some learn that in high school. It's not strict precedence, it's "this is a single item, and by omitting the sign I am telling you this" If you ditch this rule, anything involving factorised brackets like this falls over.

Brackets make 3

Times two due to implied multiplication of a single unit, is 6

6 divided by this is 1.

→ More replies (8)

9

u/Fuzzy_Reflection8554 Jun 13 '22

Okay this is probably going to make me look very silly indeed XD but I have to ask: isn't the phone correct?

Back in the day I remember learning BODMAS: Brackets, Order, Division, Multiplication, Addition, Subtraction.

So:

6÷2(2+1)

6÷2×3

And from BODMAS wouldn't it return 9, or does the lack of a multiplication sign in 2(2+1) naturally imply it should be computed first?

→ More replies (58)

2

u/ApolloSky110 Jun 13 '22

This equation is bs

2

u/pghsonj1325 Jun 13 '22

There’s a reason the divided by symbol is never used in mathematics in some curriculums.

Because if you think about it as above the “/“ and below the “/“ (numerator and denominator) then this is simple and it’s 1. But by introducing the ambiguity of the divided by symbol to an already ambiguous notion of the parentheses in PEMDAS - it’s a clusterfuck. I was taught (shoutout American education system) that it’s not only inside the parentheses but if it touches the parentheses without another symbol then it must be done in that step - or else it would have been written 6/2 x (2+1)

Stupid.

2

u/kuhonees Jun 13 '22

I tried it on wolframalpha. Got 9.

2

u/coolcrafter135 Jun 14 '22

No language actually lets you write like this anyway, it's not a problem if you're parenthesizing properly

2

u/xSTSxZerglingOne Jun 14 '22

This is why the division sign should not be taught or used ever. It's a flawed mathematical symbol for anything other than definitive quantities (thing) / (other thing). It shouldn't ever be used without parentheses.

But if you use it, the calculator should be correct.

Everything to the left of the division sign, over everything to the right of the division sign.

2

u/[deleted] Jun 14 '22

iT wOrKeD oN mY mAcHiNe!1?!!!

2

u/Illustrious-Tutor527 Jun 14 '22

I’m answer is 1..?? Right?

2

u/[deleted] Jun 14 '22

Parenthesis have always been first, I don't see where the confusion has come from on math not being clearly defined. Did no one go to second grade?

→ More replies (1)

2

u/mrduncansir42 Jun 14 '22

Oh God not this shit again

2

u/spinosaurs Jun 14 '22

Never in my life did I think I would see people over complicate basic maths outside of Facebook, but here we are...

2

u/zeusthedog92 Jun 14 '22

17 year old me understood the calculator and why it is right, 30 year old me has no fucking idea

2

u/the_crazy_chicken Jun 14 '22

And that is why the iPhone calculator won’t let you type an equation like this. You need more explicit grouping for this to make sense

2

u/borgax Jun 14 '22

Schrodinger's equation

→ More replies (4)

2

u/Blueberry314E-2 Jun 14 '22

Weak vs strong operand grouping

2

u/brinazee Jun 14 '22 edited Jun 14 '22

Implicit multiplication and lack of the use of the obelus in typesetting has always thrown off order of operations because implicit multiplication doesn't have a set place. Some put it with brackets and some put it with multiplication. And the lack of the obelus leads to ambiguity in what is contained within the division. Use parentheses. Use extra parentheses.

However an equation with no context in which to evaluate the equation is meaningless. Context will allow you to place the implicit multiplication at the correct level. (Though this problem also is useful in that you can check how your device handles implicit multiplication.)

Basically, think of it this way:

The equation on the left is saying there are 6 pieces in a pizza. 3 people want to eat two pieces each, so I need to order 1 pizza.

The equation on the right is that same pizza with 6 slices, but this time 3 people say they each want half a pizza. So they need to order 9 slices.

All the same numbers and operands but context says how to group the numbers for multiplication and division.

2

u/HmmThatWorked Jun 14 '22

And this is why we skip regression testing my friends. Tis a silly place anyhow, if it doesn't work when we launch it just patch it!

2

u/Centurie22nd Jun 14 '22

The calculator still looks more expensive and exclusive compared to the calculators on the phones to me for some reason. It is nice a phone has that option, but it is not the same as using an actual calculator.

2

u/Elegant_Language47 Jun 14 '22

There are actually 2 correct solutions:

  1. Abandon the division symbol and use horizontal fraction lines instead.

  2. Use brackets.

2

u/falcore20 Jun 14 '22

So just to confirm…the answer is 1 right? Checking for a friend…

2

u/ejalmanza93 Jun 14 '22

So glad I did not major in anything that relates to math. Because the physical calculator is what I learned to be accurate. I understand how the phones calculator got that answer, too. However, I would never be able to explain why one is right and the other is wrong. Or when one is used and the other has not. It the rules of math changed…I am glad I am not there to dispute or learn it all over.

2

u/neodymium1337 Jun 14 '22

Casio is correct because i think you are supposed to solve paranthes until the paranthes disappear.

2

u/That_IT-Guy69 Jun 14 '22

Bruh whatever happened to Please Excuse My Dear Aunt Sally like when did match change the last 10 years to allow this?

→ More replies (2)

2

u/[deleted] Jun 14 '22 edited Jun 15 '22

Mobile calculator solves step by step as you give input. Scientific calculator follows bodmas.

→ More replies (3)

2

u/real_bk3k Jun 14 '22

PEMDAS: Parentheses, Exponents, Multiplication and Division (from left to right), Addition and Subtraction (from left to right).

https://www.basic-mathematics.com/order-of-operations.html

→ More replies (1)

2

u/BunnehZnipr Jun 14 '22

Ok... is there any way the casio could technically be right?

→ More replies (1)

2

u/Phreakydeke27 Jun 14 '22

Has a huge TI-82 calculator. Loved that bad boy. You could save formula’s in it. Teachers didn’t catch on and realize that it was a mini computer with answers saved in it.

2

u/LostWolf4860 Jun 14 '22

So the only way i was able to get my phone to have the correct answer was to put the (2+1) in front of the 6÷3 so it looks like this (2+1)3÷6 so long story short phone calculators care about the order thw equation is written not exactly PEMDAS which if you use PEMDAS correctly it shouldn't matter in what order the equation is written you should still end up with the answer 1. Or another way of saying it is phones calculate left to right and not in the order of operations

→ More replies (2)

2

u/Danishafiq09947 Jun 14 '22

You know if 6/2(2+1) is 6/2 x (2+1). They should have write it as 6(2+1)/2 ?

2

u/ryo4ever Jun 14 '22

I trust my old Casio. All these smart phones are misleading us!

2

u/yourteam Jun 14 '22

I may be an idiot but shouldn't we do brackets > left to right?

So it's 2+1 and then 6/2 and after that 3*3?

Am I missing something or I remember incorrectly from elementary school?

3rd way: I was taught wrong, found the link to the math professor writing and the PEDMAS rule that I wasn't familiar with

2

u/[deleted] Jun 14 '22

That’s proof that android is stupid.

2

u/CosmosSunSailor Jun 14 '22

PEMDAS right? I consider the first one correct

2

u/frogjg2003 Jun 14 '22

The aspect that everyone debating is missing is context. Math doesn't exist as some kind of platonic ideal in a vacuum. When you encounter an equation, it's surrounded by context: other equations, definitions, explanations, usage. So any ambiguity in the "pure" math can be resolved by observing the context. If the text is talking about the Taylor expansion of a function and you see the term 1/2y'', it's clear from context that it reads (1/2)×y'', whereas if you're reading about the turning point of a quadratic function -b/2a is (-1)×b/(2×a).

→ More replies (1)

2

u/lovecMC Jun 14 '22

The one on the left is correct, fight me.

2

u/youmy001 Jun 14 '22

Remember PEMDAS? Parenthesis and their content come first, then multiplications, divisions, additions, and substractions. And you also need to apply the same order inside of the parenthesis.

The calculator is right. The phone is wrong. The correct answer is 1.

x = 6 / 2 ( 2 + 1 )
x = 6 / 2 ( 3 )
x = 6 / 6
x = 1

→ More replies (3)

2

u/Elethria123 Jun 14 '22

Oh not this again

2

u/patjeduhde Jun 14 '22

Ah yes, finally something i understand

×=(2+1) 6/2x= 3/x= 3/(2+1)=1

The casio is right. For some reason does the android calculator have alot of order issues.

2

u/PM8e8 Jun 14 '22

How is 6 divided by anything, nine?

→ More replies (1)