Evaluating -3^2

I think that you really think of the minus sign as a very high-precedence operator. Almost, but not really the same as a decimal point. Does the following expression mean anything to you?

-(3 + 2)

No, I meant what I wrote. I don’t see why that’s hard to understand.

ZenBeam, that is a particularly beautiful quote from the math site. Obviously this is a thorny problem…

Its interesting to note that as long as you don’t have exponentiation involved, whether the unary minus is an operator or ‘feels like part of a number’ may not matter. This has already been addressed:

-3 + -5
3 + -5
3 - 5
3 - -5

-3 * -5
3 * -5
3 * 5
3 * -5

All of these are easy to interpret, regardless of how you look at them, based on the ‘look and feel’ of the unary minus. If you don’t use exponentials that often, it would never come up. In arbitrary expressions, though, we have to be more rigorous, and define exactly when the unary minus applies, which appears to be at the same level as multiplication, as if multiplied on the left by -1, but only by convention.

It could be done with unary negation being very high precedence, so high that only parentheses override it, and we’d just do all our math that way. :slight_smile:

ZenBeam, in my lengthy paragraph, I note something… that if you consider the negative sign to be a ‘part of the number’, this is absolutely analagous to it being an operator that has extremely high precedence.

This is, in the end, just an operator precedence problem, however you word it or think about it.

Well, ZenBeam, my point is this: Exactly what number is the negative sign a part of in the expression -(3 + 2)?

My question regarding x[sup]2[/sup] where x=-3 was somewhat facetious. Why is it that x[sup]2[/sup]=9 when -3[sup]2[/sup]=-9? Because there is an implicit parenthesis around the x, such that x[sup]2[/sup]=(x)[sup]2[/sup]. Where is the implicit parenthesis in -3[sup]2[/sup]? Does it mean “the square of minus 3” (-3)[sup]2[/sup] or “minus 3, squared” -(3[sup]2[/sup])? It appears that the convention is the latter, which strikes some (including me) as counter-intuitive.

Whoops, that last one should be “minus 3-squared” -(3[sup]2[/sup]).

Implicit parentheses? Implicit?? We’re talking math here, no? Or at least computer programming.

I think the previous comments about the meaning of -x^2 as in the equation -x^2 + 2x - 4 = 0 is instructive.

I’ll just add that -3^2 is -9 in Mathematica.

Oh, right, that’s why I hate math so much.

Okay, I think I see what ZenBeam was saying. Some people probably think of the negative sign in -3 as different from that in -x. The first is part of the number, and the second is an operator. This strikes me as, well, confusing, which is what made it hard for me to understand. I suppose that it’s a reasonable convention, though, if not the one that’s most commonly used.

I’m saving this thread for the next time somone proposes a society led by the people that would score highest on an IQ test. :smiley:

It’s not part of a number at all, it’s the unary negation operator.

I feel I better be clear here: I’m not saying the minus sign in -3 is part of the number, since by convention it apparently isn’t (based on the various links posted). It would be possible for convention to distinguish between binary nagation operators, unary negation operators, and negative signs that are part of a number, but the negative sign in the quote would still be the unary negation operator. In fact, I think this would be the most precise convention if you were talking about programming languages, where you have unary and binary negation operators, but also sign bits for each number as they are stored.

That makes sense. I suppose it would be convenient if we had a way of expressing negative numbers that did not look so similar to unary negation.

We don’t, sadly… so we’re stuck with the symbology of (-3) to represent it. All in all, though, two extra symbols aren’t really going to kill our typing or writing fingers. :confused: :smiley:

*astro
I’m saving this thread for the next time somone proposes a society led by the people that would score highest on an IQ test. *

Maybe. But the only confusion I can see here is from non-mathematicians disputing a straight answer from people who actually use mathematics. By long-standing convention “-3^2” is parsed as “-(3^2)”, that is, -9. There should no reason for question this, except to ask for citations to show that it is the convention, which have been provided (for instance, BODMAS, and also that the major math packages Mathcad, Mathematica and Maple all parse it this way). There may be grounds for philosophical debate about whether it was the most logical convention to adopt. But that doesn’t alter the fact that it was adopted, and is the one universally used by mathematicians and those who implement systems based on math.

Yep, I’m still reading, and thanks again for all of the responses.

Well, I am a mathematician. And I say that - is an operator (both unary and binary) and it has, by standard convention, lower precedence than either multiplication or exponentiation. Someone above wrote 3 + -5. No mathematician would write that. It is 3 + (-5), which is -2. No mathematician would write 3 * -5 either. Although it is not ambiguous exactly, just poor form. Write 3 * (-5) instead. Anyway, -3^2 = -9 and that is all there is to it. And if you want to substitute x = -3 in x^2, you get (-3)^2 and if you don’t like that, too bad. Actually, when you get very careful you realize that you should write (x)^2, but almost no one does.

If you aren’t taught these conventions explicitly (and I wasn’t and was quite surprised when my children learned some rule called BOMDAS, which is a mnemonic whose meaning I don’t quite recall), then you pick them up in the same way you learn the grammar of your native language. It is quite a revelation to read this thread and see how much confusion there is out there.

At the beginning of the year in eighth grade algebra, the teacher wrote out something along the lines of

2 - 3 * 4 + 5 = ?

and had us all write what we thought the answer was as a way of introducing operator precedence. Around half of us got it wrong. (I think I was in the wrong half, but I’m not really sure.) This class was full of the people who tested well enough to get into the class (algebra for everyone else didn’t start until high school) so this was already the “top” students, in some sense.

In that case, you should sign up to volunteer at Dr. Math and you’ll be further . . . um, revelated. There are some pretty amazing questions that come through there (of both the elegant and the inane variety – kind of like the SDMB really).

This is a great thread. Way to fight syntactical ignorance!

Hari Seldon
just poor form

That, perhaps, is the problem. There is a subtlety to form that’s not taught explicitly. Personally, I’d consider as poor form most textbook examples - including this contentious “-3^2” - that can only be unravelled by operator precedence. Mathematicians just wouldn’t write expressions such as “2 - 3 * 4 + 5” but use grouping and spacing to make the precedence clear: “2 - 3*4 + 5”