Why I Like the 50g
* The Controversy
If you google "TI v. HP" you can find dozens of discussions by partisans of both brands of
calculators arguing for the relative merits of the their favorite model. These days, the two models
under discussion are the TI-89 from Texas Instruments and the HP-50g from Hewlett-Packard. Almost
inevitably, the discussion goes straight into whether the Algebraic or RPN entry method is better.
I can summarize the argument pretty quickly: "RPN saves one or two keystrokes." "Maybe, but
Algebraic is easier to learn---it's just like the way you would write it." From there, someone might
mention the number of built in functions for each, 850 versus 820, or the speed of solving an
integral, 1.2 versus 1.1 seconds.
I find these arguments almost completely irrelevant to the things that draw me to a calculator, and
I tire at their repetition. I will put my cards on the table right now. I far prefer the HP50g for
reasons I will discuss in a second. I own a TI-89 and the really cooler TI-92 plus with the full
alphabetic keyboard, and they are both fantastic calculators. But the HP-50g is "fun" in a way
that's hard to explain in a post. It is *not* RPN, or at least not RPN in isolation from the whole
ecosystem of the HP-50g, that makes it fun.
* The Stack
I don't know why but the HP's stack hardly ever figures into these discussions, yet to me, it is the
indispensable facility of the HP-50g that gives it its elegance. You probably have some idea of what
a stack is, but if you don't the concept is easy, but powerful. The stack is a pile of numbers that
sit on the calculator that can be removed only from the "top" of the stack, which in the HP is
actually displayed at the bottom. Here, for example, is what the stack might look at somewhere in
the middle of a calculation:
7:
6:
5:
4:
3: 5
2: 3.5
1: 9
The number 9 is on the "top" of the stack, position "1", labeled at the left. Further up the stack
are 3.5 and 5, while the rest of the stack is empty. If I enter another number, say, 6.7, it gets
"pushed" onto the top of the stack and all the other numbers get bumped up into the next higher
position. Like this:
7:
6:
5:
4: 5
3: 3.5
2: 9
1: 6.7
The stack serves as a kind of universal input-output facility for the calculator. All of the
functions, and I mean *all* the functions, take arguments from the stack and---here's the important
part---they push their results back onto the stack, starting at position 1, the "top."
The '-' key, for example performs subtraction, a function that takes two arguments. Where does it
get its arguments from? The top two numbers on the stack, of course. And it applies the
subtraction to them in the same order that you see them, in this case it will compute '9 - 6.7'.
Where will it put the result, 2.3? On the top of the stack, of course. After pushing the '-' key,
the stack becomes:
7:
6:
5:
4:
3: 5
2: 3.5
1: 2.3
This regular, predictable behavior gives the HP50g an interactive feel that allows you to "play"
with the numbers more that CALCULATE. You're not Spock, after all, you probably want to fiddle with
a problem a bit. You can stop, contemplate, perform a side calculation, and when you're done, the
stack will return to where it was when you left off the main problem. Say you have 45 on the stack,
and are thinking of taking its sine. As you ponder the problem, you realize that you really want
that 45, which you've been regarding as degrees, converted to radians before you take its sine.
These sorts of mid-course corrections are just what the stack is made for. You remember that to get
this done, you have to divide by 180, then multiply by pi. Simple, just enter 180 / pi *, and you've
got your radians. Now you can get back to the problem of taking the sine (just press the [SIN] key,
and there it is on the stack for you to think about and operate on further.
The stack on the HP-50g (and the 49g and the 48g and the 28s, etc) has an unlimited depth, so you
can push numbers onto it to whatever depth the problem at hand requires up to the limit of available
memory, and I for one, have never found the end of memory on the 50g. This contrasts with earlier
HP's that had a stack that was limited to 4 numbers, usually with only two of them visible. On the
50g, up to seven elements are visible, and you can look at the rest by hitting the cursor key to go
up as far as your curiosity takes you. The TI calculators don't have a stack. They have a history,
which is nice, it allows you to go up and re-enter an expression, but it lacks that spontaneous
push-pop play of the stack.
* Now RPN
Don't get me wrong, RPN---Reverse Polish Notation---is a great way to think about numbers and
operating on them. But all by itself, it's just a bit more efficient in keystroke count (who cares,
already!) and strikes many people (as it did me) as a kind of backwards way of looking at a
problem. But, when combined with the stack, you really get to understand the power and
expressiveness of the RPN way of operating on numbers.
To get into the spirit of RPN, it helps to first understand PN, Polish Notation. Consider the
following nested expression:
SIN(3 * 8 - COS(4 / 7)) - 17
This is in normal, algebraic form, pretty much just like you would enter it into a TI calculator.
But the expression can be rewritten so that every operation is regarded as a function that is placed
in front of its operators in parentheses, just like we do already with functions like sin(x), where
the function name goes in front of its parenthesized argument. But in Polish Notation, even things
like '+' and '-' are regarded as functions, so that '3+2' would be written '+(3, 2)'. Now, if we
re-write the above expression this way, we get this:
-(SIN( -( *(3, 8), COS( /(4, 7)))), 17)
That's Polish Notation, or prefix notation. Each function is written at the front of the
parentheses that surround its arguments. The idea of Reverse Polish Notation is that the function
could go *after* the parentheses that surround its arguments just as well. So, '3+2' could be
written '(3,2)+'. Now, our complicated expression looks like this:
((((3, 8)*, ((4, 7)/)COS)-)SIN, 17)-
Now here, finally, is the punch line. Using this Reverse Polish, or postfix, notation, we can erase
all the commas and all the parentheses:
3 8 * 4 7 / COS - SIN 17 -
As long as we (and the calculator) know how many arguments each function takes, this expression is
completely unambiguous. With algebraic notation, we needed parentheses to specify the order of
operations. As it turns out, *any* expression can be written in RPN without parentheses to specify
the order of operations and without any ambiguity. Furthermore, we can enter the expression strictly
left-to-right.
But the real pay-off is that this notation is perfectly suited to working with the stack. See, we
push 3 and 8 onto the stack then press '*', which pops 3 and 8 from the stack and pushes 24 onto the
stack. Then we push 4 and 7 onto the stack, hit the divide key, and the 4 and 7 get popped from the
stack while 0.571428571429 gets pushed onto the stack. Hit COS, and 0.999950266956 goes onto the
stack (replacing the 0.57...), and our 24 gets pushed up. Then, '-' gives 23.000049733, SIN gives
0.390731927492, we push 17, then '-' and -16.6092680725 is sitting on the stack ready for any
further calculation.
Yes, yes, the RPN notation is only 11 keystrokes, while the algebraic is 15, saving a whopping 4
keystrokes, all parentheses and commas, but that's not the beauty of RPN. RPN shines because it
works with the stack, and the stack gives you a visible, interactive, and universal mechanism for
reading inputs and writing outputs. Only the HP calculators sport this combination of a stack and
RPN.
* Elegant Programming
Having a stack and a notation that takes advantage of it were enough to sell me on the HP-50g all by
themselves. But, since both the HP-50g and the TI-89 are *programmable* calculators, it is really
important to know what kind of programming environment each provides. Here is where the HP really
rockets ahead. I have owned both calculators for many years, and I've spent many hours programming
the HP, but almost none with the TI's. Why? Well, the HP provides a language and facilities that
make programming the thing a pleasure. It's language is called "User RPL," and the RPL stands for
"Reverse Polish Lisp," but it is really more reminiscent of FORTH than Lisp.
An RPL program, in its simplest form, consists of a series of commands enclosed in guillemots, those
funny foreign quote characters that look like this '<< >>'. With a single keystroke, I get
these delimiters placed in the command-line with the cursor conveniently placed between them, ready
to enter the program. The best thing about the HP-50g's programming language is that every program
by default works with the stack exactly as you do when doing regular arithmetic. Let's say for
example, that you want to work out the hypotenuse of a right triangle given the lengths of the two
short sides using the Pythagorean Theorem.
Read more ›