Excel Math Bug

J

JE McGimpsey

Dave Seaman said:
By the definition of unary minus, -x^2 is the number such that
x^2 + (-x^2) = 0.

Without a citation to "the definition" you're using, this is not
persuasive.

Your statement begs the question of operator precedence, and using it to
argue for a particular order of precedence is therefore a tautology.
 
J

JE McGimpsey

"Harlan Grove" <[email protected]> said:
PITA to use if you cling to any preconceived notions of left-to-right
evaluation, but NEVER ambiguous.

Yup - had to learn APL for my high school math classes. To be
successful, it was hard to avoid learning the math, rather than just the
formulae.
 
N

Nameless

in message
Do any of you SCI.MATH whizes want to weigh in on this?

MS Excel calculates "=-5^2" as 25, not as -25.
This is because 'negation' is handled first in Excel. (!?)
If you put a zero in the equation,
as in "=0-5^2", your answer changes to -25.

Is this in line with standard math rules?
Is negation different than subtraction?

I'm getting a lot of comments in the Excel NG
basically saying that "it's in the help section, so too bad".

I've had lots of math and as far as I know
negation and subtraction are the same thing.

Hmm, judging by the other posts, I seem to be the odd man
out! When I went to (primary) school,

-5 to the power of two = -5 * -5 = 25
-5 to the power of three = -5 * -5 * -5 = -125
...and so on.

The minus in "=0-5^2" is an operator, so zero less 5 to the
power of two = -25.
 
D

Dave Seaman

Without a citation to "the definition" you're using, this is not
persuasive.
Your statement begs the question of operator precedence, and using it to
argue for a particular order of precedence is therefore a tautology.

Let A be a commutative ring with unity. Then A[X] is the ring of
polynomials in X over A. It consists of all linear combinations of the
primitive monomials, which have the form

a * X^k

for a in A and k in N. Thus, -X^2 is the primitive monomial (-1) * X^2,
where -1 is the inverse of the identity 1 in A.

Here I have followed the treatment in Lang, simplified by considering
only the case of polynomials in a single symbol X rather than a set of
symbols S.
 
D

David Ames

fred said:
Do any of you SCI.MATH whizes want to weigh in on this?

MS Excel calculates "=-5^2" as 25, not as -25.
This is because 'negation' is handled first in Excel. (!?)
If you put a zero in the equation,
as in "=0-5^2", your answer changes to -25.

Is this in line with standard math rules?
Is negation different than subtraction?

I'm getting a lot of comments in the Excel NG
basically saying that "it's in the help section, so too bad".

I've had lots of math and as far as I know
negation and subtraction are the same thing.

Negation and subtraction are not the same thing. Subtraction has TWO
operands. As I learned in second-grade math, minuend minus subtrahend
equals difference.
Perhaps that's not in the grade-school math books anymore.

David Ames
 
J

JE McGimpsey

Dave Seaman said:
Let A be a commutative ring with unity. Then A[X] is the ring of
polynomials in X over A. It consists of all linear combinations of the
primitive monomials, which have the form

a * X^k

for a in A and k in N. Thus, -X^2 is the primitive monomial (-1) * X^2,
where -1 is the inverse of the identity 1 in A.

Here I have followed the treatment in Lang, simplified by considering
only the case of polynomials in a single symbol X rather than a set of
symbols S.

Still a tautology...<g>
 
K

Kevin O'Neill

=================================================

"Negation" should be regarded as multiplication in the order-of-operation
rules of arithmetic because, for all real x

- x = (-1)x .

Kevin O'Neill

=================================================
 
K

Kevin O'Neill

=================================================


No break is needed if the reason for the existence of order-of-operation
rules is understood.


Kevin O'Neill

=================================================
 
S

Stephen J. Herschkorn

Plot the curve y = -x^2.

Solve the equation -x^2 -18x + 5 = 0.

The standard normal density is f(x) = 1/sqrt(2 pi) exp(-x^2 / 2).

What is the value of -16^(1/4)?

The standard is not peculiar to those of us who are bemoaning the bug
here. It is as universal as spelling rules. The only individuals
claiming this to be an ambiguity appear to be computer professionals
exclusively. There are thousands of end users of this product who are
not programmers, nor should one need to be to use a spreadsheet. Nor
should they be expected to comb the documentation to discover this
peculiar "feature." This is a very flawed design.
 
D

Dave Seaman

Let A be a commutative ring with unity. Then A[X] is the ring of
polynomials in X over A. It consists of all linear combinations of the
primitive monomials, which have the form

a * X^k

for a in A and k in N. Thus, -X^2 is the primitive monomial (-1) * X^2,
where -1 is the inverse of the identity 1 in A.

Here I have followed the treatment in Lang, simplified by considering
only the case of polynomials in a single symbol X rather than a set of
symbols S.
Still a tautology...<g>

You don't know what a tautology is.

You asked for a citation. I provided one[1]. Moreover, the definition
shows why polynomials are defined the way they are. They are linear
combinations of the primitive monomials X^k.

[1] Lang, _Algebra_, 1965. I haven't checked the later editions.
 
J

JE McGimpsey

Stephen J. Herschkorn said:
The standard is not peculiar to those of us who are bemoaning the bug
here. It is as universal as spelling rules.

Repetition doesn't make it so...

Nor is what you'd write by hand fundamentally relevant to using a
spreadsheet, either. You didn't learn to add numbers using =SUM(A1:A10)
in grade school.
The only individuals claiming this to be an ambiguity appear to be
computer professionals exclusively.

Not me. I was trained as a chemist.
There are thousands of end users of this product who are not
programmers, nor should one need to be to use a spreadsheet.

Absolutely correct. OTOH, they should be able to verify that they know
how to use *any* tool before they rely on it.
Nor should they be expected to comb the documentation to discover
this peculiar "feature."

What documentation does one need to enter =-5^2 into a cell to verify
(or in this case, refute) one's assumption?!?
This is a very flawed design.

Perhaps (I could use it either way, but then I do check the
documentation before I rely on the result), but it's been in existence
for 20 years now. That makes it a *standard* for spreadsheets. It's not
going to change.
 
J

John Morriss

fred said:
Thank you sir!

As another poster noted, M.P.E.P is a programming forum, but told that it
violates math convention, they still argue. They probably just didn't
believe me.

Another said "much ado about nothing", but I think this is a horrible bug
too. Excel should at least follow regular math conventions. What other
surprizes await?!

Wel, try this... Start up the Calculator that comes with WindowsXP.
Enter the keystrokes: 2 + 3 * 5 =

Try it in BOTH standard and scientific "Views"

Compare, and reconcile, the answers.

And don't forget, the programmers for Lotus 123 thought that 1900 was
a leap-year
 
K

Kevin O'Neill

=================================================

I've seen some high-level arguments including reference to algebraic structures
(rings, groups, etc.) and "unary operations" in this and nearby threads that yield
the correct result for the evaluation of an expression such as -3^2 (which is -9).

The issue is far simpler than most other posts/responses seem to indicate: it
comes from the order-of-operation rules of arithmetic, and "negation" should
be regarded as multiplication under these rules because, for any real number x

- x = (-1)x .
Consequently,

-3^2 = (-1)*3^2 = (-1)*9 = -9.

The order-of-operation rules are sometimes seen as something cooked up
by pedants. Anyone should consider reason for the existence of the rules
by considering what values the following might assume when "simplified" if
there were no rules.

2 + 3*4 (24 or 14 ?)

9 - 5 - 3 (1 or 7 ?)

-3^2 (9 or -9 ?)

Having the rules is better than needing to say, "Well . . . ya' know what I mean,"
frequently, and are far more important than most people realize -- they are how
expressions (and consequently, equations) are read (and understood) even
when the expressions contain variables.

It is mildly interesting that some exceptions to the rules (specific cases in which
the rules don't matter, e.g., a + b + c ) are listed among the field properties of
the real numbers.

It is truly unfortunate that ANY computer languages or programs would not
conform to the order-of-operation rules.


Kevin O'Neill

=================================================
 
A

Alan Beban

Stephen said:
Plot the curve y = -x^2.

I can't until someone gives me the convention to determine whether it is
to be interpreted as y=-(x)^2 or y=(-x)^2
Solve the equation -x^2 -18x + 5 = 0.

I can't until someone gives me the convention to determine whether it is
to be interpreted as -(x)^2 -18 + 5 = 0 or (-x)^2 -18x + 5 = 0
. . .

What is the value of -16^(1/4)?

I don't know until someone gives me the convention to determine whether
it is to be interpreted as -(16)^(1/4)) or ((-16)^(1/4))
The standard is not peculiar to those of us who are bemoaning the bug
here. It is as universal as spelling rules.

Unless the inquiry gets sufficiantly sophisticated, I can usually
resolve "spelling rules" by resort to a decent unabridged dictionary,
like to resolve the correct spelling of "balderdash". If the order of
precedence is so universal, please cite a "universal" authority (i.e.,
the analog of the unabridged dictionary for spelling).
The only individuals
claiming this to be an ambiguity appear to be computer professionals
exclusively.

I'm not a computer professional; in the absence of some persuasive
authority, I find it ambiguous.

Alan Beban
 
D

Daniel Grubb

Without a citation to "the definition" you're using, this is not
persuasive.
Your statement begs the question of operator precedence, and using it to
argue for a particular order of precedence is therefore a tautology.

Pick *any* algebra text, calculus text, etc. The expression -x^2 means
the negative of x^2 throughout mathematics. If you want the negation
to have priority, you write (-x)^2. For example, if you see the expression
-x^2 +3x-2 in any math book, it means (-1)*x^2 +3*x -2 and is certainly
not the same as x^2 +3x-2 (unless you are in a field of characteristic 2).
This is absolutely standard notation.

--Dan Grubb
 
K

Kevin O'Neill

=================================================

See my previous post(s).


Kevin O'Neill

=================================================

Alan Beban said:
I can't until someone gives me the convention to determine whether it is
to be interpreted as y=-(x)^2 or y=(-x)^2

I can't until someone gives me the convention to determine whether it is
to be interpreted as -(x)^2 -18 + 5 = 0 or (-x)^2 -18x + 5 = 0

I don't know until someone gives me the convention to determine whether
it is to be interpreted as -(16)^(1/4)) or ((-16)^(1/4))

~~~~~~~ SNIP
 
D

David Kastrup

Pick *any* algebra text, calculus text, etc. The expression -x^2 means
the negative of x^2 throughout mathematics. If you want the negation
to have priority, you write (-x)^2. For example, if you see the expression
-x^2 +3x-2 in any math book, it means (-1)*x^2 +3*x -2 and is certainly
not the same as x^2 +3x-2 (unless you are in a field of characteristic 2).
This is absolutely standard notation.

Uh, no. -x² + 3x - 2 would be standard notation. Little ^ characters
have no standard notational meaning.

But the same argument would hold here as well.
 
A

Aristotle Polonium

==========================================

so that -5^2 has always been interpreted to equal 25.

Absolutely not!

==========================================
I've had lots of math and as far as I know
negation and subtraction are the same thing.

This statement is too vague to have meaning.


Check posts from Kevin O'Neil for a simple explanation


_______________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top