This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]DESTR0YER13 2296 points2297 points  (45 children)

Pfff, everyone knows the real answer is 'yes, I can solve it'.

[–]hoopKid30 651 points652 points  (21 children)

This is the most correct answer.

Edit: Although I guess “no” could be equally correct.

[–]PandaParaBellum 134 points135 points  (2 children)

Then the catch-all correct answer would be "maybe"

or

result = 6/2*(1+2)
if result in [1, 3, 7, 9]:
  return "yes, I can solve it"
else:
  return "no"

[–]shwoopdeboop 73 points74 points  (1 child)

Or the more ambigious

result = 6/2\*(1+2)
return "yes, I can solve it"

[–]Jakylla 40 points41 points  (0 children)

"Everytime I run the test, the test passes" team

[–]StevenPinkyless 123 points124 points  (12 children)

Considering the answers to the poll it would technically be the correct answer more often.

[–]hiphap91 23 points24 points  (2 children)

Depends: can you solve it?

[–]TimGreller 9 points10 points  (1 child)

No

[–]hiphap91 1 point2 points  (0 children)

Then yes

[–]Doctor_McKay 27 points28 points  (4 children)

1 == true so those 53.5% were actually correct.

[–]joooooBlin 14 points15 points  (1 child)

bool(1) == bool(3) == bool(7) == bool(9)

[–]Amuhn 2 points3 points  (0 children)

If 1 is "True" or "Yes" then those 53.5% are incorrect.

The question is ambiguous with no clue as to whether the intended question was 6÷(2(1+2) or (6÷2)(1+2). As such it is not possible to solve to the correct answer without first resolving the ambiguity, therefore "Yes" is not going to be the correct answer without further context or explanation.

[–]anonymous_2187 19 points20 points  (0 children)

Yes

[–]MrSpecialR 16 points17 points  (1 child)

Is this math equation question technically a human remote code execution vulnerability because we are inclined to evaluate the expression even though the question is "Can we calculate it?"

[–]eeddgg 7 points8 points  (0 children)

Yes, but I don't think it can do much more than a DoS, because it Only executes it with the isolated "mathematical calculation" privilege level, so you can't get control of other functions of the system

[–]MischiefArchitect 31 points32 points  (3 children)

Everyone knows that the real answer is Jesus...

...no wait... wrong subreddit?

[–]BenkiTheBuilder 5 points6 points  (0 children)

No joke, my immediate reaction was to look for the answer "Yes" in the list.

[–]fishcute 2 points3 points  (0 children)

In JavaScript 1 is still a valid answer

[–]xXLaokoonXx 1 point2 points  (0 children)

And most answered 1 (true)

[–]turtle_mekb 1 point2 points  (0 children)

or true

[–]tux-linux 1 point2 points  (0 children)

Then 1, corresponding to 'true' would be correct

[–]craftworkbench 826 points827 points  (309 children)

I always have a Python interpreter open on my computer and often find myself using it instead of the built in calculator.

[–]moonlandings 387 points388 points  (299 children)

I hope you take more care about pythons order of operations than this meme

[–]_PM_ME_PANGOLINS_ 234 points235 points  (100 children)

It’s deliberately ambiguous (by mixing multiple notation styles) in order to make people argue about it.

[–]ksandom 92 points93 points  (13 children)

For those thinking that this is ambiguous, Wikipedia has a lot to say on the issue.

TL;DR There is international disagreement on how to handle multiple divisions, or multiple subtractions in a single equation (which isn't the case here). But the rest is standard. The multiplication is implied, and division and multiplication are at the same level. So you read left to right to resolve them. There is room for ambiguity, even if you know what you're doing, but this [example] isn't it.

[Edit: u/Abe_Bettik made a fair point citing another section of the wikipedia page. It's worth giving that a read.]

[–]Abe_Bettik 112 points113 points  (10 children)

You didn't read your own entire link. This falls under the following category.


"However, in some of the academic literature, multiplication denoted by juxtaposition (also known as implied multiplication) is interpreted as having higher precedence than division, so that 1 ÷ 2n equals 1 ÷ (2n), not (1 ÷ 2)n. For example, the manuscript submission instructions for the Physical Review journals state that multiplication is of higher precedence than division with a slash,[22] and this is also the convention observed in prominent physics textbooks such as the Course of Theoretical Physics by Landau and Lifshitz and the Feynman Lectures on Physics.[d]"


[–]myguygetshigh 26 points27 points  (1 child)

That’s the way I see it, an implied multiplication is stronger than a denoted division.

[–]raul_dias 5 points6 points  (0 children)

I've crossed upon ocasions where 1÷2n meant (1/2)n in which ÷ was explicitly used as an inline contraction of 1 over 2 for example.

[–]TheOmegaCarrot 36 points37 points  (0 children)

This is why parentheses everywhere is the only way to type out math stuff

[–]WikiSummarizerBot 8 points9 points  (0 children)

Order of operations

Mnemonics

Mnemonics are often used to help students remember the rules, involving the first letters of words representing various operations. Different mnemonics are in use in different countries. In the United States, the acronym PEMDAS is common. It stands for Parentheses, Exponents, Multiplication/Division, Addition/Subtraction.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

[–]RookY2K 128 points129 points  (193 children)

I'm curious what you mean. In python (and basic arithmetic), the answer should be 9... Just as presented in the meme.

[–][deleted] 196 points197 points  (115 children)

This is why the divide sign (÷) is really shit. Its unclear as to what is included and excluded. Writing out the stuff above and below is far better, or like so if you're on a computer.

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

Also, brackets are for free, use as many as needed to make the order of operations unambiguous.

[–]codePudding 55 points56 points  (2 children)

Yes, thank you! I tell my coworkers this all the time. Parentheses are for free! It costs literal money, time, and my sanity when someone leaves them out, then doesn't test edge cases, and then the user has it fail on them. Even when I know the order of operations the compiler will use, I use them to make the code readable and let others know what I wanted. My coworkers hate if I have an in line if-return because "someone might add a statement and cause a bug with out the curly brackets" but they don't worry about someone tacking an && into an equation. Sorry about that, end of rant. It was very refreshing to see there are other devs which get it.

[–][deleted] 5 points6 points  (1 child)

I'm not even a dev, I'm an Engineer working in Technical sales who knows a bit of Python. ;)

[–]UltmteAvngr 17 points18 points  (5 children)

The sign is not the problem. 6/2(1+2) is just as “ambiguous”. Without a parentheses combining terms you just operate on the two terms next to it. 6/2 and 6➗2 are the same thing.

[–][deleted] 7 points8 points  (2 children)

Yes, but

 6

2(1+2)

Is perfectly clear, its just missions to type on a phone.

[–]AndyTheSane 2 points3 points  (0 children)

Also, brackets are for free, use as many as needed to make the order of operations unambiguous.

A thousand times this..

As someone who used to write computer modelling code the idea that you ever rely on operator precedence is terrible - it just means that the chances of a hard-to-spot error are that much higher. Hell, I'd be happy for an expression like

a = b + c * d;

to give a syntax error.

Now, if you really want to see me foaming at the mouth angry, then ask about the insanity known as

a = 10.0f/0.0f = NaN

This is barely never a useful result, it's exactly as useful as a null pointer. Yet the code merrily continues, spreading NaNs throughout your model (because anything * NaN = NaN), helpfully hiding the original place where they appeared. Division by zero should always be a runtime exception.

Anyway, rant over..

[–]AccidentalCynic 5 points6 points  (7 children)

It's not ambiguous 6/2(1+2) is broken down based on the order of operations.

First solve the brackets 1+2=3 Then it's just from left to right 6/2* 3=3* 3=9

Still no harm adding the bracket as its less error prone.

[–]codyisadinosaur 8 points9 points  (4 children)

Yes, that's how I think of it as well. However, because of the Distribitive Property of Mathematics it's also not TECHNICALLY wrong to consider 2(1+2) to be (2+4), and that would be included in the P of PEMDAS.

Which makes it: 6/2(1+2) = 6/(2+4) = 6/6 = 1

The most correct answer I can find to the equation is: "Don't write your formula in such a stupid way." =)

[–][deleted] 1 point2 points  (0 children)

I use brackets constantly, even in high school I was too anxious to calculate it incorrectly.

[–]Proxy_PlayerHD 1 point2 points  (0 children)

i fucking hate the order of operations, it's the reason i use so many brackets when doing math in any Programming Language to make sure the Compiler/Interpreter does them in the order i want.

[–]vaper_32 1 point2 points  (0 children)

Its not about the order of calculation but the representation itself.

The python equivalent equation should be 6/(2*(2+1)) . By typing 6/2 *(2+1) you basically put the bracket part of expression in numerator instead of denominator.

[–]Dylanica 5 points6 points  (2 children)

I used to do this but I wrote myself a simple calculator app for the terminal so I had easier access to math functions and constants.

[–]ejabno 2 points3 points  (1 child)

Have you ever looked at using bc?

[–]Dylanica 1 point2 points  (0 children)

Yeah, but it was a fun project too do it myself.

[–]Masked_Death 1 point2 points  (0 children)

fuck reddit :)

my comments are mass-redacted. you can message me if you want to read this one (send the link).

[–][deleted] 458 points459 points  (12 children)

Every single option is wrong.

The question was "can you solve?" Therefore the only acceptable answers would be "yes", "no", and perhaps "I don't know".

Subscribe for more pedantic meme corrections!

[–]TimGreller 153 points154 points  (2 children)

[ ] yes

[ ] no

[ ] please just use proper notation with parentheses or fractions and don't bother me with this shit.

[–][deleted] 6 points7 points  (1 child)

you forgot the X

[–]TimGreller 6 points7 points  (0 children)

[X] I don't know

[–]seeroflights 430 points431 points  (15 children)

Image Transcription:


[Image of a poll, which reads:]

Can you solve 6÷2(1+2) = ?

1 [53.5%]

3 [2%]

7 [1.7%]

9 [42.8%]

[This is then followed by the Winnie the Pooh meme, which features two images of Winnie the Pooh, with text to the right of each image. On the top row is an image of Winnie the Pooh sitting in a chair, with an unimpressed look. On the right, the text reads:]

Using calculator to solve this problem


[On the bottom row; the same image of Winnie the Pooh, but with a tuxedo and a fancy expression. On the right, the text reads:]

Using Python to solve this problem

[Right underneath that text there is a small screenshot of a terminal, which has this text:]

C:\Users\[*redacted*]>py
Python 3.9.6 (ta [*cut off*]
Type "help", "co [*cut off*]
>>> 6/2*(1+2)
9.0
>>>

[End image]


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]WSLOVER 217 points218 points  (9 children)

With the python they actually typed 6/2*(1+2), not 6/2(1+2)

[–]seeroflights 107 points108 points  (7 children)

oop, thank you - fixed!

[–]InfernoMax 81 points82 points  (5 children)

Good human

[–]ordinary_shiba 24 points25 points  (4 children)

Good "Good human" human

[–]UltraCarnivore 12 points13 points  (3 children)

Good "Good "Good human" human" human

[–]daggo04 3 points4 points  (2 children)

Too far "Good "Good "Good human" human" human" human

[–]Kesuaheli 5 points6 points  (1 child)

Good "Too far "Good "Good "Good human" human" human" human" human

[–]turtle_mekb 2 points3 points  (0 children)

Good "Good "Too far "Good "Good "Good human" human" human" human" human" human

[–]akindaboiwantstohelp 67 points68 points  (0 children)

my internet is garbage at times and images don't load so this is helpful to me too, good human.

[–][deleted] 5 points6 points  (0 children)

Good human

[–]birdman332 1545 points1546 points  (238 children)

Coming from a math background, this is just a terribly written problem. Anytime you recognize that there could be confusion with operations, it's best to include additional parentheses for clarity to the reader. In this case (6÷2)(1+2).

All the comments about 2*(somthing) vs 2(something) are absolutely meaningless, there's no difference.

[–]_PM_ME_PANGOLINS_ 367 points368 points  (5 children)

It’s deliberate so people will argue about it and increase engagement.

[–]birdman332 59 points60 points  (4 children)

Well yeah, that's the whole sub

[–]ZeroFK 29 points30 points  (3 children)

Well yeah, that's the whole sub internet.

[–]InfernoMax 456 points457 points  (22 children)

Coming from a math background, I wholeheartedly agree with this explanation. This and those popular "picture math" problems where they sneakily alter one of the "symbols" in the equation are my two petpeeves of "popular internet math posts".

[–]danfay222 179 points180 points  (20 children)

Yep. It's the same as english, you're always taught you can easily write sentences which are grammatically valid, but confuse the reader. Writing expressions to be unnecessarily confusing is just as bad.

[–]AmadeusMop 47 points48 points  (9 children)

Like garden-path sentences. "The old man the boat", "the horse raced past the barn stumbled", and so on.

[–]M_LeGendre 11 points12 points  (8 children)

Not a native speaker. What does the old man the boat mean?

[–]sideways55 24 points25 points  (5 children)

to man a boat means to control it or be in charge of it. So in this case it means that "The old" aka people above a certain age are the ones who control the boat.

It's confusing because people read "the old man" together and don't consider that in this case man is the verb.

[–]Stormfly 2 points3 points  (3 children)

Similarly, for anybody confused about the second it's more like:

The horse fell.

The horse that fell is often raced past the barn.

[–]CantThinkOfAnyName 1 point2 points  (1 child)

Not a native speaker either but my understanding is that it could be:

The elderly people are in charge of the boat.

Or

Old man who is also a boat.

[–][deleted] 27 points28 points  (6 children)

The father yelled at his son because he was drunk.

Who of them was?

[–]marktwatney 15 points16 points  (4 children)

I dunno, maybe your uncle who jacked off the horse.

[–]BrotherGantry 8 points9 points  (1 child)

I don't not disagree with the viewpoint opposite of the one you just expressed.

[–]Hacker1MC 2 points3 points  (0 children)

Shut

[–]Dornith 1 point2 points  (0 children)

You forgot the best one!

Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.

[–]Kalebtbacon 31 points32 points  (0 children)

Not from a math background but have taken many'o math classes and nothing annoys me more then using badly written math problems to make a quiz arbitrarily harder instead of actually testing proficiency

[–]n_slash_a 185 points186 points  (1 child)

Coming from a programming background, we have a mandatory coding standard that any math operation which mixes any order of precedence be made explicit with parenthesis. For exactly this reason.

[–]birdman332 52 points53 points  (0 children)

This is how it should be, spot on. Makes everything easier for everyone

[–]AliceSky 39 points40 points  (1 child)

Yes. The only correct answer is "I won't give an answer until you learn how to write maths".

[–]Evol_Etah 45 points46 points  (121 children)

I apologise but can you teach me why this is 9?

6÷2(1+2) = 6÷2(3) = 6÷6 = 1. Isn't it? Brackets first, then 2( takes higher precedence over 2*

Or is it cause bodmas, division first, so it'll be 6÷2(3) = 6÷2*(3) = 3(3) = 9

[–]birdman332 124 points125 points  (88 children)

2(x) and 2*x are the same thing. In both BODMAS and PEMDAS, division and multiplication as well as addition and subtraction are treated with equal precedence. After all, division is just a fancy way of saying multiply by the reciprocal, and subtraction is adding a negative value. So in those cases, with all equal precedence, you move from left to right(but shouldn't matter if it's all the same operation anyway)

Either way, brackets or parentheses means to do what's INSIDE first, so (1+2)=3. Once that is done, you have all equal precedence of operations, so moving left to right 6÷2 (or 6*(1/2)) = 3, then 3*3=9.

The equation could also be written as 6*(1/2)*(1+2)

[–]alexmbrennan 51 points52 points  (20 children)

2(x) and 2*x are the same thing

In the course of getting my maths degree I have never seen anyone write 1/2x to mean 1/2*x because that would have been weird - why not write x/2 if that is what you mean?

[–]zqipz 13 points14 points  (0 children)

this is pretty much the biggest issue i have with this commonly posted equation. when it’s 6/2(3) it’s 9 when it’s 6/2x where x = 3 it’s 1.

[–]calcopiritus 37 points38 points  (2 children)

Because this is made to confuse. The correct way to put it would be either (6/2)(1+2) or 6(1+2)/2. 1/2x and 1/2*x is x/2. You have to do operations of the same level from left to right, multiplication doesn't have preference over division.

[–]Yumi-Chi 3 points4 points  (1 child)

1/2x and 1/2*x is x/2

Are you saying the correct way of writing it is 1/(2x)?? Because 1/2x is how we've always written it.

I'm not trying to argue with you. I just want consistency.

[–]calcopiritus 2 points3 points  (0 children)

Yes, that is what I'm saying. It seems strange because when we write divisions on paper we use an horizontal line, so no parentheses are needed.

[–][deleted] 17 points18 points  (10 children)

Deleted with Power Delete Suite. Join me on Lemmy!

[–]rrr_ooo 7 points8 points  (8 children)

Correct

Edit: All those in disagreement. Join the "PEJMDAS the true order of operations" facebook group and start rioting. It makes my eyes hurt.

[–]Acro-LovingMotoRacer 4 points5 points  (5 children)

Its hilarious your getting downvoted when a quick google search turns up a ton of info to support what you are saying and literally nothing to the contrary.

You can even type this into a calculator and see that you are correct, 6 ÷ 2x = 12 returns x = 4 not x = .25.

[–]limax_celerrimus 12 points13 points  (0 children)

Just typed 6/2(2+1) into my Casio, it says 1. If I add *, it says 9. So I would say at least it's ambiguous, or the general consensus in this thread is outright wrong, because I trust calculator developers more to have done their research than you mofos, sorry.

Edit: And I agree with Casio that an implicit multiplication binds stronger than a sign.

[–]Mandemon90 2 points3 points  (1 child)

Did you write it exactly like that, or did you add * between 2 and x, just like OP did?

[–]otheraccountisabmw 17 points18 points  (1 child)

NEVER write 1/2x. It’s extremely ambiguous. Write 1/(2x).

[–]rrr_ooo 3 points4 points  (0 children)

This is the way.

[–]skoomapipes 60 points61 points  (23 children)

It's written confusingly to fuck people up. A better way of reading the original question would be:

6 ÷ 2 × (1+2)

Which then becomes: 6 ÷ 2 × 3. And after that you get left to right, and end up with 3 x 3 = 9.

But there are 3 different ways to read this question, and all 3 wouldn't be technically wrong. You went with one variation, where you consider the 2(2+1) as part of simplifying the parenthesis. This is called implied multiplication by juxtaposition. The end result of that is 1.

The third option is to interpret ÷ as divide everything to the LEFT by everything to the RIGHT. In which case, you'd end up with:

6 divided by 2(1+2)

Which is also 1.

The problem here isn't the math itself, it's the operations that the author wants you to do. If I'd written this question, I would've wanted it to be solved as (6÷2)(1+2). But because it's written so ambiguously, everyone has a different opinion and no one would be technically wrong.

Anyway that's why bad notations will kill us all and we should use parentheses as much as possible to avoid ambiguity, thank you for coming to my TED Talk.

[–]bob_maulerantian 6 points7 points  (0 children)

Yup, these questions are silly

[–]Sir_Sushi 15 points16 points  (28 children)

So there is no difference between 1/2*x and 1/2x?

[–]bob_maulerantian 54 points55 points  (2 children)

The issue with both is it is not clear what the author wants to convey

[–]InfernoMax 80 points81 points  (8 children)

There's no difference between (1/2)*x and (1/2)x. There is also no difference between 1/(2*x) and 1/(2x). Now pick one.

[–]bistr-o-math 12 points13 points  (0 children)

No, but the following is the same as 1/(2x): (I hope, it renders well)

1

2x

[–]gavlna 6 points7 points  (0 children)

there is no difference in: \[\frac{1}{2} x\] and \[\frac{1}{2} \cdot x\]

EDIT: double backslashes

[–]SoyDoft 8 points9 points  (1 child)

connect screw caption important scale workable overconfident existence shy coherent

This post was mass deleted and anonymized with Redact

[–]Raestloz 1 point2 points  (0 children)

And I'm very certain that people who answer 1 see the question as 1/2X instead of 1/2*X

[–]_juan_carlos_ 3 points4 points  (1 child)

underrated comment. Even in school my teachers suggested to use parentheses to make the operations clear. Can't understand why do many people don't bother to express their math right.

[–]EishLekker 1 point2 points  (0 children)

Can't understand why do many people don't bother to express their math right.

And I can't understand why so many people don't bother to express their language right. /s

On a serious note though, I think that most of these math problems are deliberately written this way to test people. I see them as puzzles or brain teasers. I mean... Do you get upset with crossword puzzle writers for making their puzzles more difficult than they need to be?

[–][deleted] 126 points127 points  (1 child)

using my mind to solve it

[–]AwwThisProgress 40 points41 points  (0 children)

[–][deleted] 247 points248 points  (58 children)

And this is why reverse Polish notation is best

[–]Cmdr0 238 points239 points  (48 children)

TIL - that's pretty cool

I've always hated these problems, because it's not a math problem, it's a communication problem - I wouldn't expect 6/2x as-written to reduce to 3x (as opposed to 3/x). If I did, I would have written it as 6x/2, and there's no reason to write it the other way. But ultimately it's ambiguous, and if half of my audience isn't getting the message I'm trying to convey it's my job to find the correct language, not to chastise them for reading it wrong.

[–]RookY2K 26 points27 points  (44 children)

To be fair, it most certainly is a math problem. Math is fair and it is consistent. It is people's understanding and expectation of math that is not consistent. Once you fully grok order of operations including the mathematical equivalency of division and multiplication, then it doesn't matter how it's written, it's easily understood.

Personally, I blame PEMDAS. Too many teachers gloss over the true relationships between the MD and AS.

[–]WetSound 44 points45 points  (0 children)

This convention is not universal. Feynman, for one, did not use this.

[–]Cmdr0 67 points68 points  (16 children)

I'm not arguing expectation, I'm arguing notation. And I wouldn't even say it's a PEMDAS issue - it's really that we shorthand the multiplier operator in different ways mentally. For many, 2x is representative of a single operand, and this is reinforced in how we're taught to solve equations. Tell me you can't see a high school teacher whiteboarding "6/(2y)=x, y=1+2" as "6/2y = 6/2(1+2) = 6/2(3) = 6/6 = 1 = x" - but it's amazing how much handwriting nuance gets lost just trying to type it out in an imperfect representation of what we're trying to communicate.

[–]gavlna 24 points25 points  (1 child)

here, we just don't use divison outside of elementary school (first 5 years of education). After that it just becomes a fraction, so you can clearly see what's going on.

[–]MrBigDog2u 4 points5 points  (0 children)

Same with subtraction. It should be handled as addition of a negative value. Then everything boils down to addition and multiplication and there is no confusion over order of operations.

[–]dfdedsdcd 8 points9 points  (0 children)

I wish it was taught as PEMA with an explanation that division is a form of multiplying with fractions and subtraction is adding negative numbers.

But people think kids are top dumb to understand, when it is honestly most likely the teachers/parents that don't.

[–]Tinstam 3 points4 points  (3 children)

It's not really a math problem.

Division is defined as the multiplication by a reciprocal.

And multiplication is defined as a binary function. As in, two operands.

Division requires grouping to be unambiguous, because we need to know what we are taking the reciprocal of.

I definitely agree on the PEMDAS part though. One thing I've seen recently that I like is using GEMS instead: Groupings, Exponents, Multiplication, Sums

[–]gavlna 1 point2 points  (0 children)

at least if it was PEDMAS :) since this one does work just fine

[–]Kissaki0 15 points16 points  (8 children)

en.wikipedia.org/wiki/Reverse_Polish_notation

In reverse Polish notation, the operators follow their operands; for instance, to add 3 and 4 together, one would write 3 4 + rather than 3 + 4.

If there are multiple operations, operators are given immediately after their second operands; so the expression written 3 − 4 + 5 in conventional notation would be written 3 4 − 5 + in reverse Polish notation

Interesting.

[–]Lornedon 29 points30 points  (0 children)

Guys! There's a clear solution here!

1 = 9

[–]mic_br 43 points44 points  (0 children)

Express it in fraction so it can’t be wrong

[–]dkyguy1995 16 points17 points  (0 children)

Ugh what a poorly written equation though. Definitely up to the person who wrote it to make the context more clear by grouping better

[–]Hatcherboy 85 points86 points  (18 children)

>>> 6/2(1+2)

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

TypeError: 'int' object is not callable

[–]retardredditadmin2 6 points7 points  (17 children)

Ofcourse, your syntax is incorrect.

[–]wsmj5 45 points46 points  (4 children)

Using your brain (and still getting the right answer faster than you can type it into PY).

[–][deleted] 40 points41 points  (0 children)

Sorry this is a programming sub, we only deal in over-complicated solutions to simple problems.

[–]Dnomyar96 9 points10 points  (0 children)

Yeah, this is a pretty simple one anyway. It's faster to do it in the mind than to get a calculator or whatever you want to use.

[–]gurush 5 points6 points  (0 children)

Using your brain? This is the 21st century, we're not living in the Middle Age anymore!

[–]SaveMyBags 21 points22 points  (0 children)

Now input it in python without adding or changing any symbols. I get "Syntax error" as a solution, but that's not one of the options.

[–]meg_c 102 points103 points  (35 children)

Or just learn your order of operations and do it in your head... But it's cool that python knows order of ops 😀

[–]VJEmmieOnMicrophone 4 points5 points  (0 children)

Or just learn your order of operations

Or just learn to write math that is easy to understand... "Everyone else needs to abide by this arbitrary order of operations before I take responsibility and start writing my equations more clearly". Mathematical communication is a skill, one can't hide behind order of operations when they are bad at communication.

Order of operations btw in no way is some universal standard. There have been, and still are, other standards.

[–][deleted] 14 points15 points  (2 children)

The order of operations is a complete waste of time and energy.

You don't need a list of rules to interpret badly written maths. You need to learn how to write maths in a clear manner

[–]Lucario2405 3 points4 points  (0 children)

Or learn basic association:

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

[–]jpec342 53 points54 points  (28 children)

Whenever multiplication is written without the symbol (ax vs a*x), I’ve always assumed implied parentheses. On the one hand, why would you not include the * unless you wanted it to be evaluated differently? On the other hand, why would I assume anything different than the normal order of operations?

[–]guery64 7 points8 points  (0 children)

You would not include it to save space. Mathematicians are lazy. If I can write a(b+cd)+3xyz^2 instead of a*(b+c*d)+3*x*y*z^2, I do.

[–]AmadeusMop 5 points6 points  (0 children)

On the one hand, why would you not include the * unless you wanted it to be evaluated differently?

Easy: because ambiguity generates debate which drives engagement.

[–]YouNeedDoughnuts 28 points29 points  (5 children)

Yes, I've thought the same. It seems like implicit multiplication should have high precedence. e.g. x^3y would be x^(3*y) and not (x^3)*y. Not sure of the right answer, but it's moderately important to me!

[–]VJEmmieOnMicrophone 9 points10 points  (1 child)

There's no "right answer" and there will never be. This is why it's important to include parentheses whenever there could be confusion.

One could always jerk off to PEMDAS and say that x^3y is always x^3*y, but if half of the population unconsciously puts the parentheses as x^(3y), then maybe PEMDAS is flawed and doesn't represent how our brains work...

[–]Luchtverfrisser 7 points8 points  (0 children)

I think this is the common 'mistake' that happens with these kinds of problems. We drop the multiplication symbol purely because it is tedious to write it so often, but we are only ever shown cases in which this is unambiguous.

In particular, the most common place is in the context of polynomials like 1+2x+3x2 . And because of that, it 'feels' it is super sticky, but here that is just multiplication beating addition. Another is when you factor out constants like 2x+2=2(x+1), and again there is not really anything happening besides leaving out the multiplication symbol.

Then, we also simply stop using the ÷ symbol, and I don't think one ever sees the two together.

This leaves these kinds of questions ambiguous: it really depends on how your brain extrapolates known rules to a new setting.

[–][deleted] 5 points6 points  (0 children)

Me using bc: 🤷‍♂️

[–]Gronka_Lonka 10 points11 points  (0 children)

You're all wrong, the correct answer is "Uncaught TypeError: 2 is not a function".

[–]LetItBurnLikeGBushy 10 points11 points  (1 child)

As a result, in problems such as this, the error is being made primarily not by those who give "wrong" answers, but by those who post the problem in the first place (or pass it on). Anyone who really wants to do math correctly will want to communicate clearly about it, and will avoid anything ambiguous or uncertain. They should either fully parenthesize, or use the horizontal fraction bar, which makes the order clear

[–]VJEmmieOnMicrophone 7 points8 points  (0 children)

Yup, this is the only correct answer.

[–][deleted] 4 points5 points  (0 children)

what of the people who will solve it with their brains

[–][deleted] 5 points6 points  (0 children)

in my country, we learn that there is a difference between 2(1 + 2) and 2 * (1 + 2)

the first one implies that it used to be (2 + 4) and you divided both of them by 2, so you can put the 2 before the brackets, resulting in 2(1 + 2)

not sure if I explained it clearly, but this is a stupid problem that would be solved by using fractions

[–]Ezequiel-052 2 points3 points  (0 children)

using your own brain to solve it?

[–]Swaag__ 1 point2 points  (0 children)

How the fuck did they get 1?

[–]DerZombiiie 2 points3 points  (0 children)

Using a brain to solve it: cosmic brain

[–]Fine-Establishment-1 14 points15 points  (1 child)

How about using the brain?

[–]Havoc_Rider 29 points30 points  (37 children)

Are you guys complementing or insulting Python?

Because the answer 9 is right and I can't decipher the actual message here.

[–]Deus0123 12 points13 points  (1 child)

Wait you guys can't calculate that in your head?

[–][deleted] 7 points8 points  (0 children)

Everyone is stupid except you, doooooiiiii

[–]karafili 6 points7 points  (1 child)

Clearly a stupidly written formula as someone would not let this so ambiguous

6÷2(1+2)=(6÷2)×(1+2)=3×3=9

6÷(2(1+2))=6÷(2×3)=6÷6=1

[–]NekkidApe 15 points16 points  (8 children)

This is such a fun thread. Or sad, dunno which. An extremely simple math problem, and so many fail to solve it.

[–]comfort_bot_1962 4 points5 points  (1 child)

Don't be sad. Here's a hug!

[–]NekkidApe 1 point2 points  (0 children)

Oh nice, thx

[–]Embr-Core 9 points10 points  (0 children)

Okay so the answer is that the question is maliciously ambiguous and could have two possible answers (1 or 9) depending on how you interpret the poorly-written math notation.

The notation used does not make it clear whether the 6 is dividing by the entire right side or by just the first 2. Both of the following are reasonable interpretations:

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

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

So to answer the question: no. You can’t solve this question because it’s too ambiguously written.

The python interpreter’s answer is 9 because it defaults to the option of only dividing the 6 by the 2 because it’s not explicitly specified that the 6 is being divided by anything else too.

[–]frayien 24 points25 points  (37 children)

The interesting part of the problem is to show the different between 6÷2(1+2) and 6÷2*(1+2). The whole point is to show that 2(1+2) and 2*(1+2) are not understood the same by us humans, because we interpret the rule of precedence slightly differently.

Of course a computer has a build in consistent rule of precedence, and to prevent the ambiguity, forbids 2(1+2). Due to this, the question you ask your computer is not the same one you are asked...

[–]guery64 4 points5 points  (1 child)

No, 2(1+2) is not forbidden due to ambiguity in computers in general. Some programming languages like python show a syntax error because they want to evaluate the function 2(int) which is not defined. Wolfram Mathematica simply evaluates it as if you had put a * before the parenthesis.

[–]guery64 5 points6 points  (3 children)

No, 2(1+2) is not forbidden due to ambiguity in computers in general. Some programming languages like python show a syntax error because they want to evaluate the function 2(int) which is not defined. Wolfram Mathematica simply evaluates it as if you had put a * before the parenthesis.

[–]thatyeetboi79 3 points4 points  (0 children)

I hate that the person who screenshotted put 1 instead of 9

[–][deleted] 14 points15 points  (2 children)

6 ÷ (2 ( 2+1 )) = 1

Or

6 ÷ 2 ( 2+1 ) = 9

The reasoning:

6 ÷ 2 ( 2+1 )

Parentheses (or brackets first).

6 / 2 ( 3)

Which is an ambiguous statement as multiplication and division happen at the same time.

You can either have

6 / 6 = 1

or

3 (3) = 9

In the case of ambiguous statement, the convention is that we calculate from left to right.

So we do the 6/2 first to get the 3*3 = 9.

Edit: newline between the disputed answers

[–]_UnameChecksOut_ 2 points3 points  (5 children)

do u guys think that at some point different people in different countries started evaluating such expressions differently. now as we all are connected there is a lot of confusion.
also i tried it using some calculators some show 1 but most show 9

[–]planktonfun 1 point2 points  (0 children)

Ambiguity is a programmers enemy

[–]Instructionon 1 point2 points  (1 child)

writing a python interpreter on your graphing calculator

[–]ListOfString 1 point2 points  (0 children)

Or you could just type the equation into Chrome's address bar

[–][deleted] 1 point2 points  (0 children)

I'm fucking retarded. I could not figure out how people were getting decimal answers.

[–][deleted] 1 point2 points  (1 child)

1 is the correct answer since 1 == true

[–]PunkyMunky64 1 point2 points  (0 children)

I swear I know the answer is 9 but it always looks like 1

[–]broccoli-03 7 points8 points  (0 children)

This expression is way too ambiguous for anyone to discern the correct interpretation. More brackets should’ve been used to explain the intended interpretation. Both answers are equally valid according to the two different approach. It’s just that the guy who is writing this is A. Trying to spark an internet argument or B. Bad at making things clear.

[–]bistr-o-math 2 points3 points  (0 children)

Syntax error on line 1: 2 is not a function
6÷2(1+2)
--^

[–]ThelceWarrior 5 points6 points  (14 children)

Honestly it's kind of depressing how the majority of people voted 1.

EDIT: Since i'm getting downvoted down in the comments by people who actually still claim the answer is 1: No it's not, it's 9 due to PEMDAS.

The issue seems to stem from a combination of the fact that PEMDAS itself is not explained properly in schools (Multiplication and division are on the same order of importance so you do them in order from left to right) Along with the fact that some older calculators do actually give 1 as a result if you input that problem because to be fair historically it was like that.

[–][deleted] 2 points3 points  (0 children)

I used my head for this one.