HP 50g Graphing Calculator - Algebraic and RPN Operating ModesCalculation modesYou can type calculations on the HP 50g, in “textbook” mode, in “algebraic” mode, or “RPN” mode. When you want to use a formula or an expression, you can type it the way it looks in a textbook. This is neat and is called “textbook” mode. Then you can admire the formula, or plot it, or integrate it, or solve it for different unknown variables. Or you can just work out its value. Yet to work out the value of a formula it is easier to type it using algebraic mode or 'RPN' mode, and just get the answer. Here is a very simple example. There is no need to type it on your calculator yet, just read it. A simple example - the area of a piece of carpetYou want to know the total area of carpet for two rooms, one 6 yards long, one 8 yards long, both 5 yards wide. So you need to calculate (6 + 8) * 5. In algebraic mode you work out the total length first, that’s 6 yards + 8 yards. Then you multiply by the width, 5 yards. So you would type these keys:
You would you see the answer like this: Figure 1: Displaying the result ![]() In 'RPN' you work out the total length first too. You type 6, then type 8 and add it. Then you type 5 and multiply:
You would see the answer like this: Figure 2: Displaying the result ![]() Algebraic mode is simple if you know the formula, and it takes just 9 keys. Count them. RPN mode is simple too. You do not even use a formula, and you press only 6 keys.
In general, algebraic mode is better if you are using formulas you know, and if you just want to type them and get the results. 'RPN' mode is best if you want to go through calculations a step at a time, and sometimes even change your mind. The HP 50g lets you use either mode. This training aid will show some examples of using Algebraic and 'RPN' modes, and will explain their differences and the advantages of each one. Setting the modeFirst make sure you know how to switch between algebraic and 'RPN' modes. Press the
![]() Figure 3: Displaying the Operating Mode ![]() When you open the Modes Form, the cursor is on the top line, which selects the Operating Mode, 'Algebraic' or 'RPN', and this is
highlighted as in
Figure 3
above. To change modes, press the
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Tip! A shortcut for switching between the two modes is to press
![]() ![]() ![]() ![]() ![]() With the calculator is in Algebraic mode you see the letters 'ALG' at the top right of the display screen, as in Figure 1 . In 'RPN' mode this disappears, as in Figure 2 . For the examples below it will be helpful to
have “Fix 2” and “Approximate” modes set too. First choose “Approximate”
mode, so that
“exact” numbers such as 2/3 will be automatically converted to
approximate results such as 0.666666666667. Press
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Algebraic and RPN modes and the stackAs the example showed, both modes give the same answer. You just press keys in a different order. In Algebraic mode you type the
whole formula or expression, then press
![]() Whichever way the calculator is used, it provides some very helpful tools. The first one is the Stack, where formulas and numbers you have already used are kept for future use. If you now go through the carpet example, pressing the keys, you will see the difference between Algebraic mode doing a whole calculation all at once and RPN mode doing it a step at a time. First press
![]() ![]() ![]() Now you are ready to go through the example. Press these keys:
You typed in the whole expression (6+8)*5 and then you pressed
![]() ![]() Figure 4: Reusing an expression for further calculation ![]() If you want to use an earlier answer in another calculation, you can also use
![]() ![]() ![]() ![]() ![]() For example if the carpet you want costs $17.32 per square yard, you get the total price of the carpet you need by pressing
![]() ![]() Figure 5: Entering the values ![]() If you begin a new calculation by pressing
![]() ![]() ![]() ![]() Figure 6: Entering the cost of the carpet ![]() The HP 50g automatically put ANS(1) in front of the * when you pressed
![]() ![]() As you see, the HP 50g provides a range of ways to work in Algebraic mode. You will develop your own favorite ways to work as you gain experience with the calculator. Why “Algebraic”? You can see that the formula to calculate was typed and is displayed the way it looks when it is written down on paper in algebraic notation. That is why this calculation mode is called Algebraic Mode. Algebraic notation was invented for use with unknown variables, such as X, but over the centuries it has also developed as a shorthand way of writing things such as “add the number eight to the number six and multiply the result by the number five”. To compare the above to 'RPN' mode, switch to 'RPN', pressing
![]() ![]() ![]()
There is a clear pattern here. You type a number, then you do something with that number. Then you type another number, and do
something again. In this example, you add the 8 to the 6 that you entered before, then you multiply by 5, but RPN works the same
way for other actions too. Just for example, to calculate the square root of 30, you type 30 and then press the
![]() At each step, RPN takes one or more numbers it needs, then puts the answer on the stack. Why “RPN?”
You might have noticed that calculating the carpet area in RPN did not
use brackets, and indeed RPN is designed to
work without brackets. This makes it somewhat quicker to type than
Algebraic mode; the carpet example took 6 keystrokes in RPN
and 9 in Algebraic mode. Polish Notation, a mathematical notation
without brackets, was introduced by the Polish mathematician Jan
Lukasiewicz in the 1920s. In RPN, the operations such as
![]() ![]() ![]() The
![]() ![]() As in Algebraic mode, the stack works to help
you, but in a different way, suited to RPN calculations. The RPN stack
is made up of
numbered levels, with a value in each level. The values are the results
of earlier calculations, or numbers you put on the stack with
the
![]() ![]() ![]() The numbers on the stack are ready for you to
use in further calculations. As with Algebraic mode, the HP 50g has
commands to let
you pick numbers off the stack, and there are also commands to move
numbers around the stack. In fact RPN uses the stack as a
central tool, and there is a whole set of stack commands. You can find
them by pressing
![]()
Tip! The most important stack commands in RPN are DUP, which copies the number in level 1 to level 2, and SWAP, which swaps
the numbers in levels 1 and 2. DUP is done by pressing the
![]() ![]() ![]() The command lineAs you typed the example in Algebraic and in RPN modes, what you typed went into a special line, below the stack, but above the menu keys. If you are still in 'RPN' mode, try calculating the price of the carpet again. First type the number 17.32, and the display will look like this: Figure 7: Entering the number 17.32 ![]() The previous result, 70, is on level 1 of the
stack. The new number is between the stack and the menu keys, on a
special line called
the Command Line. Both Algebraic mode and RPN mode use this for numbers and text you are typing or editing. When you press
![]() In RPN you do not need to press
![]() ![]() ![]() ![]() ![]() ![]() Example – a more complicated expressionHere is a more complicated expression to compare Algebraic and RPN modes further. ![]() In Algebraic mode it is possible to type the expression almost as it stands. The only difference is that the x-squared key
![]() ![]() Figure 8: Entering the values ![]() The square root comes before the number it works on, the multiplication sign comes between the numbers it uses, and the factorial sign comes after the number it works with. The x-squared symbol was written after the number to be squared, but on the calculator it had to come before. There are three sets of nested brackets, which have to be treated correctly.
NOTE: When you press
![]() To enter the factorial sign you have to use ALPHA mode
to type the exclamation mark. Even though the calculator makes things easy for you, you still need to take care when typing the
expression. Now press
![]() Figure 9: Displaying the result ![]() The calculator has figured out what to do and in what order, and has given the result. The calculator knows the “rules of operator precedence” when it calculates a result, for example that addition and subtraction should be done after multiplication and division, so it has simplified the expression, taking out the unnecessary brackets in (3.2*SQ(5)). Whenever you type an expression with any possible ambiguity in it, the HP 50g applies the rules of operator precedence in evaluating the expression. One important consequence of the rules of precedence can cause confusion. This is that an expression such as –5^2 works out as –25.00, not 25.00. Raising a number to a power has higher precedence than changing a sign, so it is done first, and the expression is worked out as –(5^2). Switch to 'RPN' mode and try doing the same example calculation. ![]() As you went through the calculation, you saw intermediate results at each step, so you could notice any obvious errors, but when you are finished you only see the final result. Figure 10: Displaying the result ![]() The RPN calculation takes 6 fewer keys, and you see what is happening step by step, but you have to work out for yourself what to do and in what order. Even if you did not put in the extra brackets in the Algebraic example above, RPN would take 3 less keystrokes. If you are willing to work out how to do the calculation, RPN saves you any confusion about brackets, and works with fewer keystrokes. If you are new to HP calculators, try using both modes and see if you prefer one or the other, or if you want to switch between them as you use the HP 50g. Example – which stepladder?Many people would prefer to type the example above as a formula in Algebraic mode, rather than use RPN mode and do it a step at a time. Now here is an example to show how RPN mode is useful for solving step-by-step problems. You need to fix a tile that has fallen off your roof. The roof is 28 feet up, and you have a stepladder that is 29 feet long. You could also borrow your neighbor’s 38 foot ladder. Is either ladder good for the job? You could try leaning each one in turn against the roof and seeing which one is better, but it’s raining, so why not work it out first on your HP 50g by seeing what angle each ladder will make with the vertical when you lean it against the roof? First try it for your own ladder. Switch to 'RPN' mode if it is not set. Enter the ladder length.
![]() Then enter the height and divide so you can get the angle,
![]() ![]() ![]() ![]() Actually, pressing
![]() ![]() ![]() ![]() ![]() Type
![]() ![]() ![]() ![]() ![]() Neither ladder is really suitable. Maybe you
should ask some other neighbors if they would lend you a ladder with a
better length.
What would be a good length? 30 degrees would probably still be too
much, about 20 degrees would be about right. So type the
height again and divide by the cosine of 20 degrees. Type
![]() The same calculations could be done in
Algebraic mode with no difficulty. Nevertheless, many users find that
Algebraic mode is less
well suited to such step-by-step calculations, especially because
![]() Once all the examples have been completed it
may be worth returning the calculator to its normal modes. It can also
be helpful to
clear the stack by pressing
![]() The operating modeThe examples and explanations in this training aid have used only real numbers, but the same principles apply with complex numbers, vectors, matrices, lists of numbers, and other objects. Whether you use Algebraic mode or RPN mode, the stack is a basic tool. The combination of stack and Algebraic or RPN mode is so important in the use of the HP 50g that Algebraic or RPN is called the calculator’s Operating Mode – it is the way in which the calculator operates. These examples have shown how the user can
switch between the two modes as necessary, but the modes can be combined
further. Results on the stack from RPN mode calculations can be put in
Algebraic calculations with the ANS command, and results
from Algebraic calculations are on the stack ready for use if the
calculator is switched to RPN mode. RPN mode works with all kinds
of objects on the stack, even programs and algebraic expressions. To put
an algebraic expression on the stack in RPN, press the
![]() ![]() |