Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

RPN Basics

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10
At a glance
Powered by AI
The key takeaways are that RPN calculators use a stack system and remove the need for parentheses in calculations. RPN allows for immediate feedback during calculations.

The main components of an RPN calculator are a four-register stack (X, Y, Z, T) and a display that typically only shows the contents of the X register.

For one-argument functions, you simply execute the desired operation. For two-argument functions, you enter the first number, press ENTER, enter the second number, and then execute the function.

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

Share

Report Abuse

Next Blog

Eddie's Math and Calculator Blog


Blog regarding calculators and mathematics. Wednesday, September 21, 2011 Followers

RPN Basics
RPN Basics
(updated 9/25/2011)

Join this site Members

with Google Friend Co

This is a basic tutorial of reverse polish notation (RPN). RPN is an operating system that some calculators use, primarily those manufactured by Hewlett Packard. RPN removes the need to enter parenthesis during long calculations and allows for immediate feedback during calculations; you will not need to enter a long operation before getting feedback - thus eliminating errors. A lot of times, the number of keystrokes required to make a calculation is reduced using RPN compared to algebraic systems. Typically, a RPN calculator uses a stack with four registers, named X, Y, Z, and T. Each register is stacked on top of another. A four-register stack diagram looks like this:

Already a member?

Blog Archive
T --Z --Y --X [DISPLAY]

! 2012 " 2011 ! December ! November ! October " September

Most displays will only show the contents of the X register. What is required of the user to execute a desired operation depends on the number of arguments (for our purpose, numbers) the function requires. Most scientific calculator functions require one or two arguments. One-argument functions operate on whatever is in the display, or the X register. For one-argument functions, simply execute the desired operation. One-argument functions include all the trigonometric functions (sine, cosine, tangent), logarithms, exponential (e^), reciprocal, square root, and factorial (x!). The change sign operation fits under the category of one-number operations because it simply multiplies the number by -1. The change sign

Common

RPL Basics RPN Basics

Pictures of th

1 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

operation is often labeled either CHS (HP 12C, HP 15C) or +/- (HP 35S). Two-argument functions operate on the contents on the Y and X registers. Common two-argument functions include the arithmetic operators (+, -, x, ), powers (y^x), combination and permutations, percent and percent change (#%). To use a two-argument function, enter the first number (y), then press ENTER. ENTER terminates the entry and gets the calculator ready to receive another number. Next, enter the second number (x). A second ENTER is not required because executing the operation terminates the second entry. In summary, to operate a two-argument function: 1. 2. 3. 4. Enter the first (y) argument, Press ENTER to terminate the first entry. Enter the second (x) argument, Execute the desired function.

New Finds

Sharp EL-W5

Ready for sc ! June ! May ! April

When you link more than one operation, it is known as a chain calculation. A simple example is adding a list four numbers. Another example is adding two groups of numbers and then multiplying the two sums together. In chain calculations, whatever in the display becomes the first argument of the operation. All that is needed is to enter the second argument (number), and then the required function. For chain calculations: 1. Enter the next required argument 2. Execute the desired function, no ENTER is required A more detailed explanation of the stack can be found in manuals of the HP 12C, 15C, and 35S calculators. HP Website The scope of this blog is just to give a very basic tutorial of RPN. A lot of examples are provided to illustrate how to use the functions on an RPN calculator. Calculators with RPN Hewlett Packard: Scientific: 15C (including Limited Edition), 35S, 48 Series, 32Sii, 41C, 50g+, and many others Financial: 12C (all editions), 30b iPod Apps: GO-Sci 25, GO-Sci 21, just to name a couple. You can look for RPN calculators online, many are available for the iPod, iPad, and Android operating mobile devices. This tutorial is going to be a "do by example" tutorial. Keystrokes are shown in blue. All calculations on this blog are rounded to 4 decimal places.

About Me

Science - Applied - Cal Poly Pomona Degree - Accounti Pomona

View my complete

2 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

* Note: This works for most models. In these examples, you may need to press a shift key to access an operation depending on the calculator. Since this tutorial covers a variety of calculators, the shift keys are omitted. Please check your manual. Examples: Calculating with RPN

#1: 5 + 8 Keystrokes: 5 [ENTER] 8[+]

Display: 5.0000 Display: 13.0000

Result: 13

#2: 10 - 6 As in any calculation involving subtraction, the order is important. Keystrokes: 10 [ENTER] 6[-]

Display: 10.0000 Display: 4.0000

Result: 4 # 3: 6 x 2.95 + 2 x 1.28

Keystrokes: 6 [ENTER] 2.95 [ x ] 2 [ENTER] 1.28 [ x ] [+]

Display: 6.0000 Display: 17.7000 Display: 2.0000 Display: 2.5600 Display: 20.2600

Result: 20.26

# 4: 200 (3^2.5 - 1)

3 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

Keystrokes: 200 [ENTER] 3 [ENTER] 2.5 [y^x] 1[-]

Display: 200.0000 Display: 3.0000 Display: 15.5885 Display: 14.5885

[] Result: 13.7095

Display: 13.7095

# 5: 1/2 + 3/7 - $(25/64)

$ is the symbol for square root Keystrokes (or one possible set of keystrokes): 2 [1/x] Display: 0.5000 3 [ENTER] Display: 3.0000 7[] [+] 25 [ENTER] 64 [ ] [!] [-] Result: 0.3036 # 6: e^-3 Display: 0.4286 Display: 0.9286 Display: 25.0000 Display: 0.3906 Display: 0.6250 Display: 0.3036

Keystrokes: 3 [CHS] (or [+/-]) [e^x]

Display: -3 Display: 0.0498

Result: 0.0498 # 7: $(3^2 + 4^2)

4 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

Keystrokes: If a square operation [x^2] is available: 3 [x^2] Display: 9.0000 4 [x^2] [+] [!] Display: 16.0000 Display: 25.0000 Display: 5.0000

If a [x^2] is not available: 3 [ENTER] 2 [y^x] Display: 9.0000 4 [ENTER] 2 [y^x] [+] [!] Result: 5 # 8: Find the percent change between 19.99 (old) and 34.99 (new) %CHG = #% = [new - old] old x 100% Keystrokes: If a percent change function ["%] is available: 19.99 [ENTER] Display: 19.9900 34.99 ["%] Display: 75.0375 Display: 16.0000 Display: 25.0000 Display: 5.0000

If ["%] is not available: 34.99 [ENTER] 19.99 [-] 19.99 [] 100 [x]

Display: 15.0000 Display: 0.7504 Display: 75.0375

Result: The percent change is an increase of 75.0375% Register Operations Two common register operations are Swap and Roll Down. Swap: This operation swaps the contents on the X and Y registers. The key is typically labeled [x<>y]. The swap function is useful when arguments need to be switched before

5 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

performing subtraction, division, and taking powers. #9: 2 - (-5 x 3) Keystrokes: 5 [CHS] (or [+/-]) [ENTER] 3 [ x ] 2 [x<>y] [-] Result: 17 Roll Down: This operation pushes down the contents of the register one level. In a four stack scheme: Whatever was in the T register goes to the Z register Whatever was in the Z register goes to the Y register Whatever was in the Y register goes to the X register Whatever was in the X register goes to the T register The key often labeled R with a down arrow next to it. [R%] The Constant Pi (#) The Pi key (or keystroke sequence) puts & on the X register (display) and lifts everything else one level. On a four-register stack, whatever was held in the T register is lost. #10: Find the area of a circle with a radius of 2.35 inches. Area = & *radius^2 Keystrokes: [#] 2.35 [x^2] [x]

Display: -5 Display: -15.0000 Display: 2 Display: -15.0000 Display: 17.0000

Display: 3.1416 Display: 17.3494

Result: 17.3494 square inches Alternatively: [ # ] 2.35 [ENTER] 2 [y^x] [ x ] Additional Examples: #11: How many 5-card hands can be dealt out of a standard deck of 52 playing cards? Combination = n! (k! x (n - k)!)

6 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

This function has several labels: Cy,x (HP 15C), COMB (HP 42S, HP 50g+), or nCr (most calculators) The factorial function has several labels, typically x! or n!. Keystrokes: If a combination function is available: 52 [ENTER] 5 [nCr] If a combination function is not available: 5 [x!] Display: 120.0000 52 [ENTER] 5[-] [x!] [ x ] [1/x] 52 [x!] [x] Display: 52.0000 Display: 47.0000 Display: 2.5862 Display: 3.2222 Display: 8.0658 59 (2.5682 x 10^59) -62 (3.2222 x 10^-62) 67 (8.0658 x 10^67)

Display: 2,598,960.000

Result: 2,598,960 possible 5-card hands #12: Find the sine of 30 Keystrokes: If necessary, set the calculator to degrees mode 30 [SIN] Result: 0.5000 #13: You have purchased a calculator for $99.99 and present a coupon for 15% for the purchase price. Assume sales tax is 8.75%. What is the final amount due? In RPN calculators, the percent function [ % ] returns Y * X%. The contents of the Y stack remain unchanged. Keystrokes: 99.99 [ENTER] 15 [ % ] [-] 8.75 [ % ] [+]

Display: 14.9985 (99.99 x 15%) Display: 84.9915 Display: 7.4368 (84.9915 x 8.75%) Display: 92.4283

Result: 92.4283 (The final bill is $92.43)

7 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

#14: You deposit $1,000 in a bank account earning 3.5% interest for 5 years. How much money will you have after 5 years? FV = PV x (1 + i%)^n Where FV is the future value, PV is the present value, i is the periodic interest rate, and n is the number of periods. We are looking for FV with PV = 1,000, i = 3.5, and n = 5. Keystrokes: 1000 [ENTER] 1 [ENTER] 3.5 [ % ] [+] 5 [ y^x ] [x] Result: 1,187.6863 ($1,187.68)

Display: 0.0350 Display: 1.0350 Display: 1.1877 Display: 1,187.6863

#15: On a right triangle, find the angle x in degrees:

/| / | / | 15 / | / | /x | -------10 (my attempt at a right triangle, hopefully you get the picture) x = arccos (10/15) = cos^-1 (10/15) Keystrokes: Set the calculator in Degrees mode if necessary. 10 [ENTER] 15 [ ] Display: 0.6667 [COS^-1] Display: 48.1897 Result: The angle is 48.1897

I hope you find this tutorial on RPN helpful. Eddie

8 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

Many thanks to Xavier A. and Dieter on the MoHPC (The Museum of HP Calculators) Forum.

Posted by Eddie at 7:44 AM


Recommend this on Google

Labels: 12C, 15C, 35S, Hewlett, HP, Packard, RPN, tutorial

No comments: Post a Comment


Enter your comment...

Comment as:

Select prole... Preview

Publish

Newer Post

Home
Subscribe to: Post Comments (Atom)

Older Post

9 of 10

8/1/12 11:04 PM

Eddie's Math and Calculator Blog: RPN Basics

http://edspi31415.blogspot.com/2011/09/rpn-basics.html

Awesome Inc. template. Powered by Blogger.

10 of 10

8/1/12 11:04 PM

You might also like