Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math

Topic: Is this an exceptionally hard set of questions to answer?
Replies: 68   Last Post: Nov 11, 2002 7:54 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kevin Foltinek

Posts: 680
Registered: 12/8/04
Re: Is this an exceptionally hard set of questions to answer?
Posted: Nov 4, 2002 7:09 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Alberto Moreira <junkmail@moreira.mv.com> writes:

> [snip]
> What you're left with is the sequence in which you must compute your
> operations. So, for example,
>
> (3+4)*(5*(6+7))
> [snip]
> So, what we have to do is to compute in precedence order,
>
> 6+7=13 because the rightmost + has precedence 22
> 5*13=65 because the rightmost * has precedence 12
> 3+4=7 because the leftmost + has precedence 11
> 7 * 65 = 455 because the leftmost * has precedence 2.
>
> The point that these rules of precedence get operations [to] behave as
> if a distributive law holds is of second importance here,


Nowhere in the above does the distribute law make an appearance. Your
rules of precedence will not imply the distributive law.

The rules of precendence are equivalent to an algorithm to translate
infix notation into either prefix or postfix notation (the two being
obviously equivalent) and back again.

> parsing the
> expression using the distributive property


Distributivity is not a property of an expression.

> is a waste of time for both men and machines.

On the contrary, it is invaluable for computational purposes. (Look
up Horner's rule, for example.)

> Now, change the precedences, and guess what ? The meaning of the
> expression may change. That's why something like
> a + b*c + d
> is ambiguous, notationwise, unless we apply operator precedence rules
> to it.


That's why we have operator precedence rules.

> These precedence rules can be contrived to satisfy the
> arithmetic distributive property;


Again, distributivity has nothing to do with notation or precedence
rules.

Distributivity, in your favourite postfix notation, is
a b c + * = a b * a c * + .
It is a property of the + and * functions.

> And in modern computing, we are entitled to
> overload the meanings of scribbles such as "+" and "*" to mean things
> other than numeric addition and multiplication,


Yes, and the parser will still work, because it does not have anything
to do with distributivity. The optimizer won't work, though (so the
compiler won't call it to optimize expressions involving overloaded
operators [unless there is a way to tell it how to optimize them]).

> so in a way the
> traditional math track is a bit stifling here, we need to have rules
> to parse expressions that work at syntatic level only and pay no
> attention to the semantics of the underlying operations. I said it
> before, the advent of computers has put a different spice into this
> brew.


The order of operations in use today predates computers by at least
hundreds of years.

Kevin.



Date Subject Author
9/28/02
Read Is this an exceptionally hard set of questions to answer?
Karl M. Bunday
9/30/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
9/30/02
Read Re: Is this an exceptionally hard set of questions to answer?
Shmuel (Seymour J.) Metz
10/5/02
Read Re: Is this an exceptionally hard set of questions to answer?
Moufang Loop
10/7/02
Read Re: Is this an exceptionally hard set of questions to answer?
Shmuel (Seymour J.) Metz
9/30/02
Read Re: Is this an exceptionally hard set of questions to answer?
Stephen Herschkorn
9/30/02
Read Re: Is this an exceptionally hard set of questions to answer?
Magi D. Shepley
10/1/02
Read Re: Is this an exceptionally hard set of questions to answer?
Karl M. Bunday
10/2/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/2/02
Read Re: Is this an exceptionally hard set of questions to answer?
Karl M. Bunday
10/3/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/3/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/3/02
Read Re: Is this an exceptionally hard set of questions to answer?
Jim Hunter
10/4/02
Read Re: Is this an exceptionally hard set of questions to answer?
Herman Rubin
10/4/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/5/02
Read Re: Is this an exceptionally hard set of questions to answer?
Herman Rubin
10/4/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/4/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/5/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/6/02
Read Re: Is this an exceptionally hard set of questions to answer?
Virgil
10/6/02
Read Re: Is this an exceptionally hard set of questions to answer?
Herman Rubin
10/6/02
Read Re: Is this an exceptionally hard set of questions to answer?
Jim Hunter
10/6/02
Read Re: Is this an exceptionally hard set of questions to answer?
Virgil
10/7/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/8/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/8/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/9/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/10/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/11/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/14/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/15/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/15/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/16/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/16/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/14/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/16/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/16/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/12/02
Read Re: Is this an exceptionally hard set of questions to answer?
Shmuel (Seymour J.) Metz
10/14/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/25/02
Read Re: Is this an exceptionally hard set of questions to answer?
Van Bagnol
10/25/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/26/02
Read Re: Is this an exceptionally hard set of questions to answer?
Van Bagnol
10/27/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/27/02
Read Re: Is this an exceptionally hard set of questions to answer?
Herman Rubin
10/28/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/29/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/24/02
Read Re: Is this an exceptionally hard set of questions to answer?
Van Bagnol
10/25/02
Read Re: Is this an exceptionally hard set of questions to answer?
Van Bagnol
10/26/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/28/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/29/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/29/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/31/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
10/31/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
11/2/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
11/2/02
Read Re: Is this an exceptionally hard set of questions to answer?
David Redmond
11/3/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
11/3/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
11/4/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
11/2/02
Read Re: Is this an exceptionally hard set of questions to answer?
Virgil
11/4/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
11/5/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
11/5/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
11/6/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
11/7/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
11/9/02
Read Re: Is this an exceptionally hard set of questions to answer?
Alberto C Moreira
11/11/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/3/02
Read Re: Is this an exceptionally hard set of questions to answer?
Kevin Foltinek
10/5/02
Read Re: Is this an exceptionally hard set of questions to answer?
Magi D. Shepley

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.