Re: RPN (was Re: TI-83 )


[Prev][Next][Index][Thread]

Re: RPN (was Re: TI-83 )



As long as we are talking about what happened back in the 70's, it would be
helpful to remember that this was an extremely creative time with regard to
thinking about mathematical notations, both in the context of the first
electronic calculators (then appearing on the market) and in formal
communication of mathematical expressions to computers (then just becoming
powerful enough to be significant).  Nowadays when an under-$200 calculator is
in some ways as powerful as (or more powerful than) a $100,000 computer used
to be, we should be looking at both developments to help understand how we
should be marching into the future.

The discussion that has appeared here pits familiarity against logic as the
two criteria to be used in selecting an appropriate mathematical notation, and
suggests "algebraic" notation and RPN as the two prime opposing contenders.
Actually, there was yet a third major contender very much in play in the 70's,
and still favored today in some circles as obviously superior in terms of
efficiency and clarity (though not necessarily familiarity).
There has always been a dream that a calculator would come on the market
including at least a partial implementation of this notation.

I am talking, of course, about APL, the notation Ken Iverson created in the
60's by rigorously re-thinking the question of mathematical notations from the
ground up. APL made both a good computer programming language (for the time)
and a good way to express and genearalize mathematical results in writing (and
a good way to access a computer in "calculator mode"). There was  a lot of
(and still is some) interest in "doing mathematics in APL", and many people
dabbled with it. Very mind-expanding!

One of the "ground-up" principles on which APL is based is that there should
be no precedence between operations (there are just too darn many operations
in APL to try to keep a table of precedence, anyway). This is implemented by
the simple rule that a monadic operation (an operation taking one argument)
operates on everything to its right, and the right argument of a dyadic (or
infixed) operation consists of everything to _its_ right. Parentheses can be
used to modify this, but often are not needed.

Thus  15 - 2 * 7 evaluates as 1, since the right argument of the subtract
operation is 2*7 (BTW, another feature of APL is a special, non-ASCII
character set, which includes more traditional multiplication and division
signs, though I am not going to try to suggest that in what I type here). So
far so good. But, by this logic, 2 * 7 - 15 evaluates to -16, as the right
argument of the multiplication operation  is 7-15. This is, of course,
visually jarring to individuals used to working with traditional "order of
operation rules", and takes a while to get used to. Pays big dividends,
though!  Alternate values that can be obtained by inserting parentheses in one
or the other of these expressions are 91, from (15 - 2) * 7 , and -1 (how?).

Of course you don't normally want to carry out extensive calculations with
constants, like this (as -- arguably -- you don't really want to do this in
the TI calculator environment either) but instead use the power of variables,
talking about  A - B * C and so forth. A great advantage here is that in APL a
variable is allowed to equally well represent an _array_ of arbitrary
dimension (1 dimension for vectors, 2 dimensions for matrices, etc.) and all
compatible calculations are allowed in a highly natural fashion. Special
operations allowing reductions and inner products of various sorts or
generating higher-dimensional arrays by generalized outer products provide the
real power in APL. Some of the ways thinking about arrays built into  APL have
been implemented by TI in creating the TI-92 and TI-89 (as well as the TI-83
and TI-86), but the real power is not there yet. We all have our dreams about
what we would like to see happen in the future. This is certainly one of mine.

RWW Taylor
National Technical Institute for the Deaf
Rochester Institute of Technology
Rochester NY 14623

>>>> The plural of mongoose begins with p. <<<<

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************