Order of Operations

[math]2(3)^2 = 2 \cdot (3)^2[/math] vs. [math](2(3))^2[/math]. Do you see why the second expression can't be what the problem is talking about?

Do the parenthesis first: [math]3^2 = 9[/math]
So
[math]2(3)^2 = 2 \cdot 9 = 18[/math]
-Dan
 
I agree with Otis that you should cancel out the 2s but if you don't...

You need to know that 2(3)2 means 2*(3)2. Now obviously before you multiply you need to know what you are multiplying. The quantities which you are multiplying are to the left and right of the multiplication symbol. To the left of the multiplication symbol is 2 which of course equals 2. What is the right of the multiplication symbol is (3)2 which is 9. Now armed with the two numbers you can multiply and get 2*9=18
 
You all know why this sort of question is nothing more than a joke.
WHY: well there is absolutely no way to force: authors of computer languages, makers of calculators, members of the MathEd hierarchy and/or publishers of mathematics textbooks to agree on any one standard. For the last fifty years I have been in that mix.
I see no way to declare one correct answer.
For what it is worth I vote for 9 as a final answer.
 
The "PEMDAS" mnemonic is helpful in most situations, including this one. Evaluating the expression [MATH]2(3)^2[/MATH] performs the exponentiation first, followed by the multiplication. To put it another way, it is evaluated as [MATH]2(3^2)[/MATH]. Careful positioning of parentheses, and even use of redundant parentheses that are not strictly necessary, can help to eliminate ambiguity and promote correct interpretation in other readers.

PEMDAS does not cover every operation, however. My favorite example is [MATH]-3^2[/MATH]. Is this interpreted as [MATH](-3)^2 = 9[/MATH], or [MATH]-(3^2) = -9[/MATH]? It can be reasoned that it should be interpreted as [MATH]0 - 3^2 = -9[/MATH], as there is an implicit leading zero. However, in applied fields such as computer programming, it can instead be reasoned that the [MATH]-[/MATH] symbol denotes negation, not subtraction, which is a unary operation and therefore has a higher priority than the binary operation of exponentiation.

Wikipedia uses the same example and suggests that there is no universal rule in this situation--the context determines its meaning. Once again, parentheses help to circumvent the possibility of misinterpretation in the event the reader doesn't happen to know the intent of the [MATH]-[/MATH] symbol.



As an aside...

In computer lingo, the order of operations is called operator precedence, which has its foundations in mathematics and is unambiguously defined for all operations (in before someone brings up compound assignments). In most (all?) programming languages, the negation operation has higher priority than multiplication, even in languages (such as C in the link above) that don't have an operator for exponentiation.

Because operator precedence is completely unambiguous, parentheses are only needed when the order of operations needs to be modified. My go-to example (pun intended) for this is the expression a & b >> c, which shares the same precedence relationship as the expression a + b * c. People have adamantly argued with me about how they believe it should be written as a & (b >> c) to avoid confusion, "in case the reader doesn't know the precedence rules", yet they take no issue with a + b * c being written without parentheses, "since the reader should already know that". The way I see it, if you know that multiplication happens before addition, you should also know that right shift happens before bitwise AND. If you don't know that, you need to review your operator precedence!

Ultimately, those people get the last laugh: gcc has a warning for those cases "whose precedence people often get confused about". If I want my code to compile without warnings in all cases (enabling all warnings is considered good form), I have to use those redundant, unnecessary, condescending, space-wasting parentheses. *grumble*
 
… 2(3)2 means 2*(3)2 … before you multiply you need to know what you are multiplying …
Agree. When we teach order of operations and grouping symbols, we ought to include how to parse factors.

\(\;\)
 
My favorite example is [MATH]-3^2[/MATH]. Is this interpreted as [MATH](-3)^2 = 9[/MATH], or [MATH]-(3^2) = -9[/MATH]? It can be reasoned that it should be interpreted as [MATH]0 - 3^2 = -9[/MATH][MATH][/MATH], as there is an implicit leading zero.
That is just how I think of it.
 
solve parenthesis first. so, you will get 18 as the numerator.

Actually, "parentheses first" doesn't help here; all that says is that you evaluate (not "solve") the 3 before doing anything else. What matters here is "exponents first" (before multiplication).
 
Top