Jump to content

What is the answer to 6/2(1+2)


Ryaja
 Share

Answer to 6/2(1+2)  

21 members have voted

  1. 1. Answer to 6/2(1+2)

    • 1
      13
    • 9
      7
    • Other post what you think if it is this
      1


Recommended Posts

Then it is simply a mistake. One can read it this or that way. Both answers are right or wrong depending how one reads the expression. That makes no sense. It is an invalid expression. If an engineer constructs a building or an aircraft based on such an expression (choosing an outcome based on demography) building or plane have a good chance to crumble or crash.

Example programming: A C or C++ compiler has no order of evaluation. It can even do it differently when evaluating the expression multiple times during execution of a program. This is called undefined behaviour and it is a mistake. The programmer must make clear what they mean, with the use of brackets.

Example simple operations in math: they follow rules like commutativity, associativity etc. These rules demand grouping an evaluation so that it is unambiguous, otherwise it is a mistake. One must make the expression clear with putting brackets.

Edited by Pixophir
Link to comment
Share on other sites

in programming i think the mantra is "when in doubt, use brackets". 

math expects you to know order of operations, but for programmers they can be arbitrarily different from language to language. mathematics could learn a thing or two from computer science, in that readability is often more important than elegance.

Link to comment
Share on other sites

 

35 minutes ago, Nuke said:

in programming i think the mantra is "when in doubt, use brackets". 

math expects you to know order of operations, but for programmers they can be arbitrarily different from language to language. mathematics could learn a thing or two from computer science, in that readability is often more important than elegance.

Without the brackets what does your method come out with I just want to see the most popular method.

Link to comment
Share on other sites

4 minutes ago, Ryaja said:

 

Without the brackets what does your method come out with I just want to see the most popular method.

with or without brackets it evaluates as 1 since division is the lowest priority operation. if you really want to confuse people, put an exponent in there. 

Link to comment
Share on other sites

I plugged it into https://pemdas.info/ and for me it says 9. I typed in 6/2*3 because of the parentheses around 1+2.

There is the problem with such things: it says multiplication before division and from left to right and mult and div have the same "power", whatever that is. These rules are contradictory, and over-simplification for pupils in some countries (obviously English speaking because it is an English mnemonic), they are not taught around the world. I have never heard of pemdas before, and I have several books on advanced algebra and calculus on the shelf.

Mind you, I don't say 9 is correct, it is not, other devices may show other results, maybe simply because of different language/browser/plugin versions. The result is undefined without parentheses.

 

Edit: Here's an article on exactly that example, and the inconsistency of pemdas (and other such allow me to say opinionated simplifications):

https://plus.maths.org/content/pemdas-paradox

Quote

In practice, many mathematicians and scientists respond to the problem by saying "unclear syntax, needs more parentheses", and explain why it's ambiguous, which is essentially the correct answer.

The link leads to another article pointing to *sigh* facebook.

 

tl, dr: Everybody can argue over the order of operation when it is as undefined as in the above example, or defined ambiguously as in pemdas. But it doesn't help to solve the problem, which is "put parentheses there" and the discussion is ended.

:-)

 

Edited by Pixophir
Link to comment
Share on other sites

While it's a bad style of notation, as there are no additional brackets, replace the contstants with variables.

6/2(1+2)

a/b(c+d)

As the multiplicative operations (division and multiplication) have same priority,, this is equal to 

(a/b)*(c+d)

So, 6/2(1+2) = (6/2) *(1+2) = 3 * 3 = 9.

Link to comment
Share on other sites

The step from a/b(c+d) to (a/b)*(c+d) put the necessary brackets and thus steered the result. But that may still not be what the original author, coming from another culture, intended (*).

Imagine b(c+d) omitting the operator was meant in a planned manner, as in a function-like notation. Then a/b(c+d) has quite a different meaning. Or if in the original writing the dash spans all that is on its right hand side, like one would write a fraction on paper, then the mess is just an outcome of typing it horizontally on a pc, lost in transcription.

Again, I don't argue the result 1 or 9, both are right or wrong without brackets and putting brackets make it clear as shown. But the brackets may be put this or that way.

 

(*) Edit: the intention may be to deliberately create an invalid expression as a riddle. Just want to say that it looks like math but isn't because of missing operators and symbols. Reminds me of

Quote

Sita us wilate inis et abernet

which "looks like Latin but isn't".

Edited by Pixophir
Link to comment
Share on other sites

computer science doesnt seem to believe in implied operators. for example x(y), the parentheses imply a multiplication operation. you almost never see that in code. it would always be x * (y). as a result ive always had a problem converting formalized mathematics into code and vise versa.

then when you got it figured you learn about pointers and get even more confused. 

4 hours ago, Pixophir said:

Blanks aren't allowed in mail addresses.

interestingly you can use a decimal point in the address left of the @ symbol. that always confuses the hell out of people. ive even encountered a couple websites that don't believe its a real email address. 

Link to comment
Share on other sites

53 minutes ago, Nuke said:

for example x(y), the parentheses imply a multiplication operation. you almost never see that in code. it would always be x * (y).

Yeah that's impossible in code (here C/C++) because depending on semantics and other things like what's x and y, type designators  it is either a function declaration, a cast, an instance of an object with a variable or a function declaration with an object as parameter. If you don't believe me the latter search "most vexing parse" :-) Which, btw., was resolved by allowing different types of parentheses.

But here we're not that complicated, we simply have constant values, a missing operator(*), and missing pair of parentheses. That's all :-)

Edited by Pixophir
Link to comment
Share on other sites

OP asked for our individual methods.  I was trained in computer science and mathematics.  As a mathematician, I would follow PEMBAS, in which case I get the result of 9, as follows:

6/2(1+2) = 6/2*(1+2) [math notation] = 6/2*3 [Parentheses first] = 3*3 [Multiplication and Division have equal priority and are evaluated left to right] = 9

As a computer scientist, I would not leave this to chance (or to the programming language, or to the compiler/interpreter writer's discretion).  I would use additional parenthesis to implement the PEMBAS order of events, as follows:

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

Link to comment
Share on other sites

Computer agreed, but as a math aficionado and never having heard of pemdas (doesn't it also say m before d ?) before (I know associativity, distributivity, commutativity, parentheses, exponents, mult and div together and add and sub together) I'd rather turn everything into multiplication to get rid of the ambiguity. That is 6*(1/2)*3 and the truth is revealed without parentheses because that can have any order :-)

Tata ...

Might be though that that was not the expression the author had in mind.

You think that's cheating?

Edited by Pixophir
Forgot parentheses, derp that I am
Link to comment
Share on other sites

There's a thing called the Algebraic Order of Operations. It says you do calculations in the order of multiplication, then division, then addition, then subtraction. Parentheses over-ride that order and you do what's in the parentheses first. (That's a short version. The real rule is longer.) It's an arbitrary order but it's been specified so that everybody gets the same answer to the same problem. In this case 1+2 is within parentheses to it goes first. Then 2x3 makes six. So the final problem is 6/6, which is 1. This is the only correct answer to the problem as it is presented here. 

Link to comment
Share on other sites

The majority is of the same opinion, but at least two math related guys disagree, specifically with m before d part. This is trivial, because m and d are interchangeable by the reciprocal. There goes m before d ... neither comes first.

 

Edited by Pixophir
Link to comment
Share on other sites

1 minute ago, Pixophir said:

The majority is of the same opinion, but at least two math related guys disagree, specifically with m before d part.

Make that "three math related guys" (and I actually have a university degree in mathematics, for whatever that may be worth). And yes, division is just multiplication with the inverse element, and therefore has the same priority.

Link to comment
Share on other sites

13 hours ago, Pixophir said:

rom left to right and mult and div have the same "power", whatever that is

The maths guys are correct - and now I see why I got the wrong answer (1).

I wouldn't use the word 'power' but rather the phrase 'on the same level' or 'in the same step'.  The part I forgot is that you go left to right and also 

2 hours ago, Vanamonde said:

It says you do calculations in the order of multiplication, then division

...which is what I did - but you're supposed to remember left to right as well, and I think that actually takes priority within a level/step.

So - my self analysis of my mistake was that I did follow the Parentheses First rule (1+2)=3 which left the equation as 6/2*3.  In my head, I then performed the 2*3 before completing the final step, getting 6/6=1.  Wrong.  Because they are all 'on the same level' or 'in the same step' and written in sentence case like that... the proper way should have been to go 6/2 = 3, 3*3 =9... because of left to right priority.

Spoiler

Brought to you by the guy who's been going back through middle-school math at the kitchen table with a succession of intrepid kids.

 

Edited by JoeSchmuckatelli
Link to comment
Share on other sites

Are there differences in the way this is taught? The version I learned ordered the operations by strict priority and did not have a left-to-right rule, and at least some of the sources I checked also explain it this way. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...