Difference between -3² and (-3)² ?

AI Thread Summary
The discussion centers on the mathematical distinction between -3² and (-3)², with the consensus that -3² equals -9 while (-3)² equals 9. This difference arises from the order of operations, where exponentiation takes precedence over negation, leading to -3² being interpreted as -(3²). Several participants emphasize that calculators may interpret these expressions differently based on input sequence, which can lead to confusion. The thread highlights the importance of understanding mathematical conventions and the order of operations to avoid miscalculations. Ultimately, clarity in notation and calculator usage is essential for accurate results in mathematics.
  • #51
DeBangis21 said:
Thanks. I am getting something in here. I use to wonder and always asked myself, and others, why -n^2 in my calculator gives -n instead of n.
I think I understand what you think you meant, but that's different from what you actually wrote. No calculator will display either -n or n if the input is -n^2. IOW, squaring a number won't produce that number except if the number is 1.

DaveC426913 said:
*sigh* Because of PEMDAS.

Parentheses
Exponents
Multiplication and Division
Addition and Subtraction
PEMDAS doesn't really cover it, as the minus sign is really the (unary) negation operator rather than the (binary) subtraction operator.

DaveC426913 said:
The minus sign ( - ) in front is an operator, just like addition, multiplication or exponentiation. It operates on what is immediately to its right (i.e. 32 AKA +9 ) to turn it into its operative inverse. That is what that minus sign means. And so, it gets processed in PEMDAS order - i.e. last.
Programming languages generally do a much better job of specifying the order of operator precedence than does mathematics. In addition, many languages also specify the associativity; i.e., how operators at the same precedence level are evaluated, whether left-to-right or right-to-left.

For example, in Python, exponentiation (denoted as **) is of higher precedence than negation (see https://www.geeksforgeeks.org/precedence-and-associativity-of-operators-in-python/). For an expression such as -3**2, 3 is squared before the result is negated. Because of the precedence of the two operators, -3**2 has exactly the same value as -(3**2).
 
Physics news on Phys.org
  • #52
Mark44 said:
PEMDAS doesn't really cover it, as the minus sign is really the (unary) negation operator rather than the (binary) subtraction operator.
I think PEMDAS covers it implicitly, if not explicitly.
IOW, if one were to find a concise description of PEMDAS it might cover negation operators under subtraction operators.

Mark44 said:
Programming languages generally do a much better job of specifying the order of operator precedence than does mathematics.
Mathematics manages with its convention. You gotta know how to math.
 
  • #53
gary350 said:
I want to learn why -3²=9 ???

-x-=+

Square means a number times itself.

-3² should be -3 x-3= +9

I need to understand why the correct answer is -9 ???
This was answered in posts 4, 14, 19, 41, plus a couple more that I might have missed. Please go back and reread them.

DaveC426913 said:
I think PEMDAS covers it implicitly, if not explicitly.
IOW, if one were to find a concise description of PEMDAS it might cover negation operators under subtraction operators.
Not good enough if it isn't explicit. That's why I said that programming language do a much better job of explaining how expressions are evaluated. All of the descriptions of PEMDAS (or BIDMAS) I've ever seen were concise, which is the problem. And none of the letters in either acronym covers negation.

DaveC426913 said:
Mathematics manages with its convention. You gotta know how to math.
Yeah, I think I know "how to math."
 
  • Like
Likes chwala
  • #54
Mark44 said:
This was answered in posts 4, 14, 19, 41, plus a couple more that I might have missed. Please go back and reread them.
One last time: ##-3^2## means "take the negative of the result of 3 squared".

There is nothing more to say, so this thread will now be closed.
 
  • Like
  • Love
Likes hutchphd, Math100, gmax137 and 3 others
Back
Top