Google Answers Logo
View Question
 
Q: What is 1+1? What is -2^2? I bet Google doesn't know. =D ( Answered,   5 Comments )
Question  
Subject: What is 1+1? What is -2^2? I bet Google doesn't know. =D
Category: Science > Math
Asked by: raccoon-ga
List Price: $2.42
Posted: 26 Feb 2005 21:45 PST
Expires: 28 Mar 2005 21:45 PST
Question ID: 481638
Ok. So 1+1 is 2.  But -2^2 is 4?  That's what Google Says.  But is it so?

[ ://www.google.com/search?q=-2^2 ]

For the sake of fun (and my $2.42) I would like to hear what you
(Google Researcher) might like to say about this before I elaborate
with my own findings.  It has been a heavily argued topic today, so
I'm looking for a fresh opinion.  Thanks.

I would like an answer from someone taking a Math major or who has a
degree in Math, please.
Answer  
Subject: Re: What is 1+1? What is -2^2? I bet Google doesn't know. =D
Answered By: maniac-ga on 27 Feb 2005 16:17 PST
 
Hello Raccoon,

Well, depending on the rules of precedence you use, the result for
  -2^2
is either
  -4  [-(2^2)]
or
   4  [(-2)^2]

The first is the "proper" result according to Dr. Math at
  http://mathforum.org/library/drmath/view/53194.html
and is backed up by a couple different derivations - very interesting
reading by the way. If you want an explanation of who "Dr. Math" is,
check out
  http://mathforum.org/dr.math/
and the several links on this page. (its a math Q&A service sponsored
by Drexel University)

Of course, not every application or programming language follows the
"proper" result. Dr Math points out that Microsoft Excel does it the
other way as described at
  http://support.microsoft.com/support/kb/articles/q132/6/86.asp
or more concisely at
  http://support.microsoft.com/kb/q132686/
which notes the "unexpected result", and states it has been
implemented this way in all versions of Excel [and perhaps Multiplan
before that]. I also thought it was a little humorous that it admits
that Lotus 1-2-3 does not have this problem....

So - If you really care about the result - add the parenthenses. I
certainly do whenever there is ANY uncertainty in the interpretation
or result.

Search phrase used for this answer:
  operator precedence math
or
  operator precedence math unary minus exponent
for more specific references for a variety of programming languages.

Thank you for such a thoughtful question.
  --Maniac

PS: If you instead feed
  (-2)^2
into Google, it states...
  -2^2 = 4
and if you use
  -(2^2)
with Google, it states...
  -(2^2) = -4

The right hand side of both are the "correct result" and it
illustrates the precedence model used by Google.
Comments  
Subject: Re: What is 1+1? What is -2^2? I bet Google doesn't know. =D
From: justaskscott-ga on 27 Feb 2005 11:53 PST
 
I don't see a problem.  A negative times a negative (a negative
squared) is always a positive.

It would be a problem if Google said -2^3=8.  But it gets that right
too -- the answer is -8.

-2^3
Google
://www.google.com/search?hl=en&lr=&q=-2%5E3&btnG=Search

(I would answer the question, with citations to reputable web sites,
except that I don't have the credentials you mention.)
Subject: Re: What is 1+1? What is -2^2? I bet Google doesn't know. =D
From: windoffire-ga on 27 Feb 2005 15:12 PST
 
Clever Clever, raccoon.

Please Excuse My Dear Aunt Sally.

That phrase is an acronym to the Order of Operations in Mathematics:
(), exponents, multiplication, division, addition, subtraction. (Yes,
multiplication and division are equal, as are addition and
subtraction, but lets be kind to the acronym.)

Example:

2+2*3 doesn't equal 12, but rather equals 8, since the 2 and 3 are
multiplied first. It would equal 12 if the problem was given thusly:
2+(2*3).

Therefore, going back to the original problem we can see that -2^2
means -(2^2), which goes to -(4), or -4.

Therefore Google does have a bit of code correction to do. (Sorry Justaskscott)
Subject: Re: What is 1+1? What is -2^2? I bet Google doesn't know. =D
From: xcarlx-ga on 27 Feb 2005 17:55 PST
 
I am not the credentialed person you requested either, but I put out
the following for discussion:

First, order of operations says to do multiplication before
subtraction.  The application in this case could be argued if someone
thinks the exponent is a special case, or if they think a negative
superscript is a special case.  But consider this...

The negative must not be permanantly attached to the number because
that would invalidate the simplification method of swapping/canceling
negatives.  Pretend the plus/minus signs that are directly next to the
numbers are superscript and the ones seperated with a space are
regular operations:
1 - -1  is equal to 1 + +1

But what about "1 - -2^2" ?

...simplified to:
1 + 2^2
we get 5.  This MUST be correct, or else we can no longer do a lot of
math that we have been doing for many years.

But if we keep 1 - -2^2 and follow the rule of Google, we get 1 - 4 = -3

We could make a rule that we can't cancel/swap +/- to simplify
exponents in addition to the rule that says we can in other cases. 
But it would be the only time a multiplication unit was "weaker" than
the surrounding add/subtract operations, and it would make life more
complicated to have two rules rather than one just because our first
impression of the number was a particular (and wrong) way.

It is far more logical to say that if you want to square the whole
thing you must say (-2)^2 than to make exceptions for the order of
operations and positive/negative simplification.
Subject: Re: What is 1+1? What is -2^2? I bet Google doesn't know. =D
From: volterwd-ga on 08 Mar 2005 07:40 PST
 
Forget googles rule... -2^2 is -4... didnt you pay attention in grade school?

power takes precedene
Subject: Re: What is 1+1? What is -2^2? I bet Google doesn't know. =D
From: raeyin-ga on 16 Jun 2005 16:01 PDT
 
Maniac's right.  The statement is ambiguous.  Like Dr. Math,
sophisticated treatments of the subject would probably say that the
exponent comes first, then the negative.  However, this is *not* the
same as the rules you learned in grade school.  They didn't cover this
issue because it's not a big deal when you're writing exponents as a
superscript.  Introducing the carat, or the term exp, creates a whole
new issue in matters of precedence.  In other words, I think you're
assuming that the ^ (or the term exp) should be treated the same way
as a superscript.

Don't get me wrong, I really think that an in-depth analysis would
show that it is best to do exponential functions first.  However,
computer programmers, and hence computer programs, do not all agree
with me.  Just use parentheses.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy