• Take 30 seconds to register your free account to access deals, post topics, and view exclusive content!

    Register Today

    Join the largest Oakley Forum on the web!

This Is Always A Fun One, 6÷2(1+2) = ?

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

Think of it that way

You're adding operators. My initial answer was 1, but now I can't recall if multiplication and division are the same precedence. This is why I still keep my graphing calculator around.

And the more I look at it the more I think it's 6/(2(1+2)) = 1
 
You're adding operators. My initial answer was 1, but now I can't recall if multiplication and division are the same precedence. This is why I still keep my graphing calculator around.

And the more I look at it the more I think it's 6/(2(1+2)) = 1

They are indeed the same precedence.

You added parenthesis that weren't there to begin with.

Speaking of graphing calculators I actually just read an article from TI that said they had made the mistake of treating precedence differently based on basically the notation used and they just fixed it.
 
Funny TI-83+ story...

Heading to school to take my Statics final, and wouldn't you know it, I can't find my graphing calculator, Ol' Reliable. So I have to go to the school store to get one before the test, paid $140, Staples had them for $80, but what can you do at 7:30 AM? So I go to take the test, walk in a few minutes late, get a test and a Blue book, sit down, settle in. I open the Blue book to find writing already inside; the questions had already been filled out. I go to the professor, ask to exchange the full Blue book for a blank one, and to his shock and disbelief, he had handed me the answer key and now I couldn't take that test. I take another test a few hours later. While waiting for the replacement test, I get a call from the Computer Lab, they found my other calculator. BTW, no returns in a school book store. So now I have a TI-166++ (two TI-83+'s).
 
Having majored in math and also written compilers, I can verify that the correct answer is 9.
Expressions inside parentheses are evaluated first (inner to outer), and then operators from left to right by precedence.

the original expression written in C code would look like this
int a = 6 / 2 * (1 + 2);
which would result in a value of 9 being assigned to the variable a.

Additional parentheses would override the left to right evaluation forcing the multiplication to be performed before the division
int b = 6 /(2 * (1 + 2));
resulting in b being assigned a value of 1.

Removing the parentheses altogether would be:
int c = 6 / 2 * 1 + 2;
giving the variable c a value of 5.

Bored yet? :laugh:
 

Latest Posts

Back
Top