Showing posts with label 48S. Show all posts
Showing posts with label 48S. Show all posts

Sunday, February 26, 2012

Bézier Curves - Programs for TI nSpire, HP 50g

Introduction

A short definition: a Bézier Curve is a set of parametric equations involving n points:

x(t)=Σ( nCr(n,k) * (1-t)^(n-k) * t^k * x_k) from k=0 to n

y(t)=Σ( nCr(n,k) * (1-t)^(n-k) * t^k * y_k) from k=0 to n

For 0 ≤ t ≤ 1

The curve fits points (x_0, y_0) (when t=0) and (x_n, y_n) (when t=1). The curve approximates the other points.

The degree of the polynomial is n-1.

Bézier curves are used heavily in computer graphics, animation, and font making.

Mike "Pomax" Kamermans provides an awesome primer on Bézier curves.


Béizer Curve Generator - TI nSpire CX
(I am sure this would work with the TI-89 too)

Define LibPub bezier(list)=
Func
© coordinates; Define x (or y)#(t)=bezier(...)
Local n,k
dim(list) - 1 → n
Return Σ( nCr(n,k) * (1-t)^(n-k) * t^k * list[k+1]) from k=0 to n
EndFunc


Save the file, the file name can only be one word. The file must belong to the MyLib folder under the My Documents folder. Please do not forget to refresh the libraries after saving. To refresh, press the doc button, select option 6.

One way to graph a Bézier Curve:

1. Go to, or create a graph screen, or in Scratchpad Graph screen
2. Set to Parametric Mode:

x#(t)=filename\bezier({x coordinates})

y#(t)=filename\bezier({y coordinates})

Set 0 ≤ t ≤ 1

Where # is 1 to 99 and filename is the file that contains the Bezier function.

Bézier Curve for the HP 50g (should work on the 48G and 49G families)

There are two programs in this section. Both are programmed using User RPL.

BEZIER: a curve generator
BEZGRPH: graphs a single Bézier Curve given a list of y coordinates and a list of corresponding x coordinates. BEZIER is required.

Bézier Curve Generator

Level 1: list of coordinates

Program Name: BEZIER
'L' STO
0 'F' STO
'T' PURGE
0 N FOR K
N K COMB
1 'T' - N K - ^ *
'T' K ^ *
L K 1 + GET *
'F' STO+
NEXT F SIMPLIFY FDISTRIB
{N L} PURGE >>


Graphing a Single Bézier Curve:

Level 2: list of y coordinates
Level 1: list of x coordinates

Program Name: BEZGRPH
BEZIER SWAP BEZIER
+ STEQ
PARAMETRIC
{T 0 1} INDEP
AUTO ERASE
DRAW LABEL DRAX PICTURE >>


Notes:
1. The program BEZIER is required.
2. Standard mode (STD) set is used to make labels less obtrusive
3. {T 0 1} INDEP sets T to be the independent variable with the range (0, 1)
Parametric Equations on the HP 50g: XY#(T)=X(T)+i*Y(T)

Example:
Draw a Bézier curve about the points (0,3), (1,2), (0,0), (-1,-1), and (4,-4)
List of y coordinates: {3, 2, 0, -1, -4}
List of x coordinates: {0, 1, 0, -1, 4}

Equations:
x(t) = 4t^4 + 8t^3 - 12t^2 + 4t
y(t) = -5t^4 + 8t^3 - 6t^2 - 4t + 3

TI nSpire CAS CX:

HP 50g:

Hope you enjoyed this blog. Take care as always, Eddie





This tutorial is property of Edward Shore. © 2012

Tuesday, October 11, 2011

RPL Programming Tutorial - Part 7 - HP 49g+/50g: Solver

How Do You Solve This Thing Again?

Welcome to Part 7 of the RPL Tutorials for the HP 49g+ and 50g calculators. Today, we are going to call the calculator's solver in a program. It is a fairly simple process:

1. The first step is setup the equation. We can set up the equation either as an Algebraic object or an RPN program.
2. We follow the equation by the commands STEQ 30 MENU. STEQ (Store Equation) stores the equation for solving purposes. The commands 30 MENU brings up a soft-key menu solver. The soft-key menu solver is a classic solver that was used in the HP 48S and HP 48G series.

In this program, we will use the classic solver to expand the capability of the UTPN (Upper Tail Probability Normal Distribution) function.

UTPN

The UTPN function returns the upper tail area (p) of the normal distribution given the mean (µ), variance (v), and point on the curve (x).

Mathematically,

p = (√2 π v) ^ -1 * ∫(x, ∞, e^( -(t - µ)^2 / (2v) ), t)

In a standard normal distribution, µ = 0 and v = 1, so the equation simplifies to:

p = (√2 π) ^ -1 * ∫(x, ∞, e^(-t^2/2), t)

where x = (z - µ)/v

A Note Using 30 MENU

The variables using 30 MENU are global. Therefore, it may be a wise idea to purge each of the variables after use. In this tutorial, we will create a second program to clean up the variables - this program is optional.

The Program NSLVR (Normal Distribution Solver)

Comments will be italicized, starting with an asterisk.

Variables used:
M = the mean
V = the variance
X = the point
P = the upper tail area, probability, -1 ≤ p ≤ 1

[RS] [ + ] (<< >>)
[RS] [ + ] (<< >>)

* To use an RPN string in enter an equation, a second set of program brackets is necessary.
[ALPHA] [ALPHA] [HIST] (M) [SPC] [EEX] (V) [SPC] [big X] [SPC] [ALPHA]
[LS] [SYMB] (MTH) [NXT] [F1] (PROB) [NXT] [F3] (UTPN)
[ALPHA] [SYMB] (P) [SPC] [ - ]

* Enter the equation UTPN(M,V,X) = P
[ &darr ] [RS] [SYMB] (CAT) [ALPHA] [SIN] (S) find STEQ
30 [LS] [EVAL] (PRG) [NXT] [F4] (MODES) [F5] (MENU) [F1] (MENU)

* Enter STEQ 30 MENU
[ENTER]
* Terminate program entry

[ ' ] [ALPHA] [ALPHA] [EVAL] (N) [SIN] (S) [NXT] (L) [EEX] (V) [ √ ] (R) [ENTER] [STO>]

The completed program:

<<
<< M V X UTPN - >>
STEQ 30 MENU >>


(Optional) The program NSCLR (Normal Distribution Solver Cleaner)

[RS] [ + ] (<< >>)
[LS] [ + ] ( { } )

* Start a list
[ALPHA] [ALPHA] [HIST] (M) [SPC] [EEX] (V) [SPC] [big X] [SPC] [SYMB] (P) [ALPHA] [ &rarr ] [LS] [EVAL] (PRG) [F2] (MEM) [F1] (PURGE)
* Enters the variables used in NSLVR and purges them
[SPC] [RS] [ x ] [ALPHA] [ALPHA] [F4] (D) [ ' ] (O) [EVAL] (N) [F5] (E) [ENTER]
* Inserts a "DONE" message and ends program entry.

[ ' ] [ALPHA] [ALPHA] [EVAL] (N) [SIN] (S) [F3] (C) [NXT] (L) [ √ ] (R) [ENTER] [STO>]

The completed program:

<< { M V X P } PURGE "DONE" >>

Instructions for NSLVR:

To solve for upper tail area (P):
1. Run NSLVR.
2. Enter M, press [F1]
3. Enter V, press [F2]
4. Enter X, press [F3]
5. Press [LS] [F4] (P)

Examples:

1. Find the upper tail area with M = 0, V = 1, and X = 1.

Keystrokes: 0 [F1] (M) 1 [F2] (V) 1 [F3] (X) [LS] [F4] (P)

Result: 0.158655253931

2. Find the area between X = 5 and X = 15, using M = 10 and V = 5.8.

Keystrokes: 10 [F1] (M) 5.8 [F2] (V) 15 [F3] (X) [LS] [F4] (P)
* Area to the right of X = 15 (15 to ∞)
5 [F3] (X) [LS] [F4] (P)
* Area to the right of X = 5 (5 to ∞)
[LS] [ &rarr ] [ - ]
* Subtract the area above X = 5

Result: 0.962118717684

3. Find the lower tail area with M = 0, V = 1, and X = 0.

Keystrokes: 0 [F1] (M) 1 [F2] (V) 0 [F3] (X) [LS] [F4] (P)

Result: 0.5

To solve for the point (X): [Inverse Normal Distribution Function]
1. Run NSLVR.
2. Enter M, press [F1]
3. Enter V, press [F2]
4. Enter P, press [F4]
5. Press [LS] [F3] (X)

Examples:

1. Find X when the lower tail probability is P = 0.95. Use M = 0 and V = 1.

Keystrokes: 0 [F1] (M) 1 [F2] (V) 1 [ENTER] .95 [ - ] [F4] (P) [LS] [F3] (X)

Result: 1.64485362695

Remember: P is the upper tail area.

2. With M = 44.2 and V = 1.7, find the point where the upper tail probability is 55% (P = 0.55).

Keystrokes: 44.2 [F1] (M) 1.7 [F2] (V) .55 [F4] (P) [LS] [F3] (X)

Result: 44.0361576491

To clean up: Run NSCLR

That wraps up Part 7 of our Tutorial. Please join us next time while we explore the WHILE-REPEAT-END structure. So long for now, Eddie.

This tutorial is property of Edward Shore. Mass reproduction and distribution requires express permission by the author.




Friday, September 30, 2011

Common Keyboard Commands for Hewlett Packard RPL Calculators (HP 48S/48G/50g)


(updated 10/1/2011)

This is a quick reference to common mathematical functions for the Hewlett Packard RPL calculators. In general, HP RPL calculators are classified into three families:

This table will focus on the HP 48S, 48G, and 50g - three of four models I actually own (I have a 49g+ which should be the same key mapping as the 50g. The 49G has a different mapping - and I do not own a 49G.)

Note: [LS] = left shift key (3rd key up from the ON button on the left side)
[RS] = right shift key (2nd key up from the ON button on the right side)

About Soft Keys

On the top row, there are six soft keys. The functions of these six keys change depending on what menu is currently active. The top row of the HP 49G, 49g+, and 50g are labeled as:

[F1] [F2] [F3] [F4] [F5] [F6]

On the HP 48S and 48G, these keys are not labeled - but I will still use the F# convention. So [F1] means first soft key from the left, [F2] means second soft key from the left, and so on.

Note: For the 50g, it is assumed that Soft Menus are turned on. (Flag -117 is set)

List of Functions

x^2
HP 48S/48G: [LS] [ √x ]
HP 50g: [LS] [ √X ]

x√y
HP 48S/48G: [RS] [√x]
HP 50g [RS] [√X]

10^x
HP 48S/48G: [LS] [y^x]
HP 50g: [LS] [EEX]

LOG
HP 48S/48G: [RS] [y^x]
HP 50g: [RS] [EEX]

e^x
HP 48S/48G: [LS] [1/x]
HP 50g: [LS] [Y^X]

LN
HP 48S/48G: [RS] [1/x]
HP 50g: [RS] [Y^X]

ABS
HP 48S: [MTH] [ F1 ] (PARTS) [ F1 ] (ABS)
HP 48G: [MTH] [F5] (REAL) [NXT] [F1] (ABS)
HP 50g: [LS] [ ÷ ]

ARG
HP 48S: [MTH] [ F1 ] (PARTS) [ F4 ] (ARG)
HP 48G: [MTH] [NXT] [F3] (CMPL) [F6] (ARG)
HP 50g: [RS] [ ÷ ]

ASIN
HP 48S/48G: [LS] [SIN]
HP 50g: [LS] [SIN]

ACOS
HP 48S/48G: [LS] [COS]
HP 50g: [LS] [COS]

ATAN
HP 48S/48G: [LS] [TAN]
HP 50g: [LS] [TAN]

->NUM
HP 48S: [RS] [EVAL]
HP 48G: [LS] [EVAL]
HP 50g: [RS] [ENTER]

->Q (Exact Answer)
HP 48S: [LS] [EVAL]
HP 48G: [LS] [ 9 ] (SYMBOLIC) [NXT] [F3]
HP 50g: [LS] [ 6 ] (CONVERT) [F4] (REWRI) [NXT] [F5] (->Q)

x!
HP 48S: [MTH] [F2] (PROB) [F3] (!)
HP 48G: [MTH] [NXT] [F1] (PROB) [F3] (!)
HP 50g: [LS] [SYMB] (MTH) [NXT] [F1] (PROB) [F3] (!)

COMB (Combination)
HP 48S: [MTH] [F2] (PROB) [F1] (COMB)
HP 48G: [MTH] [NXT] [F1] (PROB) [F1] (COMB)
HP 50g: [LS] [SYMB] (MTH) [NXT] [F1] (PROB) [F1] (COMB)

PERM (Permutation)
HP 48S: [MTH] [F2] (PROB) [F2] (PERM)
HP 48G: [MTH] [NXT] [F1] (PROB) [F2] (PERM)
HP 50g: [LS] [SYMB] (MTH) [NXT] [F1] (PROB) [F2] (PERM)

RAND (Random #)
HP 48S: [MTH] [F2] (PROB) [F4] (RAND)
HP 48G: [MTH] [NXT] [F1] (PROB) [F4] (RAND)
HP 50g: [LS] [SYMB] (MTH) [NXT] [F1] (PROB) [F4] (RAND)

% (Returns level 2 * level 1% on level 1)
HP 48S: [MTH] [F1] (PARTS) [NXT] [F4] (%)
HP 48G: [MTH] [F5] (REAL) [F1] (%)
HP 50g: [LS] [SYMB] (MTH) [F5] (REAL) [F1] (%)

%CHG (Percent Change from level 2 to level 1)
HP 48S: [MTH] [F1] (PARTS) [NXT] [F5] (%CH)
HP 48G: [MTH] [F5] (REAL) [F2] (%CH)
HP 50g: [LS] [SYMB] (MTH) [F5] (REAL) [F2] (%CH)

IP (Integer Part)
HP 48S: [MTH] [F1] (PARTS) [NXT] [NXT] [F3] (IP)
HP 48G: [MTH] [F5] (REAL) [NXT] [F5] (IP)
HP 50g: [LS] [SYMB] (MTH) [F5] (REAL) [NXT] [F5] (IP)

FP (Fraction Part)
HP 48S: [MTH] [F1] (PARTS) [NXT] [NXT] [F4] (FP)
HP 48G: [MTH] [F5] (REAL) [NXT] [F6] (FP)
HP 50g: [LS] [SYMB] (MTH) [F5] (REAL) [NXT] [F6] (FP)

To access the hyperbolic functions (SINH, COSH, etc..)
HP 48S: [MTH] [F3] (HYP)
HP 48G: [MTH] [F4] (HYP)
HP 50g: [LS] [SYMB] (MTH) [F4] (HYP)

Matrix Functions:

INV (Inverse)
HP 48S/48G: [1/x]
HP 50g: [1/X]

DET (Determinant)
HP 48S: [MTH] [F4] (MATR) [F5] (DET)
HP 48G: [MTH] [F2] (MATR) [F2] (NORM) [NXT] [F2] (DET)
HP 50g: [LS] [ 5 ] (MATRICES) [F2] (OPER) [F6] (DET)

M^T (Transpose)
HP 48S: [MTH] [F4] (MATR) [F3] (TRN)
HP 48G: [MTH] [F2] (MATR) [F1] (MAKE) [F3] (TRN)
HP 50g: [LS] [ 5 ] (MATRICES) [F2] (OPER) [NXT] [NXT] [F5] (TRN)

EGVL (Eigenvalues)
(not on the HP 48S)
HP 48G: [MTH] [F2] (MATR) [NXT] [F3] (EGVL)
HP 50g: [LS] [ 5 ] (MATRICES) [NXT] [F1] (EIGEN) [F3] (EGVL)

RREF
(not on the HP 48S)
HP 48G: [MTH] [F2] (MATR) [F3] (FACTR) [F1] (RREF)
HP 50g: [LS] [ 5 ] (MATRICES) [F5] (LIN S) [F4] (RREF)

Stack Functions:

Clear the Entire Stack
HP 48S: [RS] [backspace]
HP 48G: [LS] [DEL]
HP 50g: [RS] [Backspace]

Swap contents of levels 1 and 2
HP 48S: [LS] [right arrow] (SWAP)
HP 48G: [LS] [right arrow] (SWAP)
HP 50g: [LS] [right arrow] (unmarked)

Roll the entire stack down 1 level
(Move everything down one level and level 1 goes to stack n)
HP 48S: [PRG] [F1] (STK) [F6] (DEPTH) [F4] (ROLLD)
HP 48G: [LS] [up arrow] (STACK) [F6] (DEPTH) [F4] (ROLLD)
HP 50g: [LS] [EVAL] (PRG) [F1] [NXT] [F6] (DEPTH) [F2] (ROLLD)

Angle Conversions:

Degrees to Radians
HP 48S: [LS] [SPC] (π) [ x ] 180 [ ÷ ]
HP 48G: [MTH] [F5] (REAL) [NXT] [NXT] [F5] (D->R)
HP 50g: [LS] [SYMB] (MTH) [F5] (REAL] [NXT] [NXT] [F5] (D->R)

Radians to Degrees
HP 48S: 180 [ x ] [LS] [SPC] (π) [ ÷ ]
HP 48G: [MTH] [F5] (REAL) [NXT] [NXT] [F6] (R->D)
HP 50g: [LS] [SYMB] (MTH) [F5] (REAL] [NXT] [NXT] [F5] (R->D)

RPL Basics


RPL Basics
(updated 10/1/2011)





I dedicate this blog to Peter Murphy - thank you for the request!


This is a basic tutorial of reverse polish lisp (RPL). It is a combination of RPN (reverse polish notation), Lips, and Forth languages.


RPL 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 RPL compared to algebraic systems. RPL works like RPN, but there several differences.


All of the following calculators, manufactured by Hewlett Packard, operate on RPL: HP-28C, HP-48S, HP-48SX, HP-48G, HP-48G+, HP-48GX, HP-49G, HP 49g, HP 50g. Currently, only HP 50g is sold new. The rest can be found used (sometimes new) on other online vendors. There are also several emulators of RPL calculators (HP48+ for example) that can be used for the iPhone/iPod Touch/iPad and devices operating on Android.


There are two types of RPL: User and System. User RPL is for basic, everyday use. You can create programs with User RPL right on the calculator's keyboard. System RPL allows users to create faster and more efficient programs. However, System RPL programming is more difficult than User RPL - most of the time programs have to complied and then downloaded to the calculator. For our purposes of the tutorial, we will use User RPL ("Just use the keyboard"). You can find additional information on RPL on the HP Museum of Calculators' RPL Page.

The Stack

Typically, an RPL calculator uses a stack with an infinite amount of "levels" (or registers). Each level is stacked on top of another. The size of the stack is dynamic depending on the contents each level has. In my experience, I end up using 1 to 3 levels, but I can use as many levels as I want so long as I have memory. For example a four-level stack diagram looks like this:

4:
-------------------------------
3:
-------------------------------
2:
-------------------------------
1:
-------------------------------

The 28C displays 3 levels, the HP 48S and 48G series display 4 levels, and the HP 49G series, including the 49g+ and 50g can display any number depending on the screen's font setting. Typically, FONT 8 shows 7 levels.

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 calculator functions require one or two arguments.


One-argument functions operate on whatever is in level 1, sometimes referred to as 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 operation is labeled [ +/- ].


Two-argument functions operate on the contents of levels 2 and 1. Level 2 is like the Y register and level 1 the X register. 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. Enter the first (y) argument,

2. Press ENTER to terminate the first entry.

3. Enter the second (x) argument,

4. Execute the desired function.


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


The scope of this blog is just to give a very basic tutorial of RPL. It is a "do by example" tutorial. Keystrokes are shown in blue. All calculations on this blog are rounded to 4 decimal places.

This blog will demonstrate keystrokes on the 48S (works also on the 48SX), 48G (works also on the 48G+ and 48GX), and the 50g (works also on the 49g+).

==========================================================

To set the calculator to 4 decimal places:

HP 48S:

4 [ENTER] [LS] [CST] (MODES) [2nd soft key from left] (FIX)

HP 48G (via the Mode Selection Screen):

[LS] [MODES], choose Fix 4 on the menu

HP 50g (via the Mode Selection Screen):

[MODE], choose Fix 4 on the menu.

=========================================================

Examples: Calculating with RPL

Format of the display will be shown as follows:
[...]
[2: contents]
[1: contents]

Shift Keys

Left Shift [LS]: This key has an arrow going up and turning left. It is the third key up from the ON button on the left side. It is orange on the 48S, purple on the 48G, periwinkle on the 49G, green on the 49g+, and white on the 50g.

Right Shift [RS]: This key has an arrow going up and turning right. It is the second key up from the ON button on the right side. It is blue on the 48S, green on the 49G, light red on the 49G, red on the 49g+, and orange on the 50g.

The 28C has 1 shift key - in red.

Soft Keys: There are six soft keys on the top row of the keyboard. Their functions change depending on the current active menu. On the 48S and 48G series, these keys are not labeled. On the 49G, 49g+, and 50g, they are labeled F1 through F6, left to right. The soft keys are labeled as:

[F1] [F2] [F3] [F4] [F5] [F6]

In this tutorial I will put the label on the soft keys. [F1] mean the leftmost soft key, [F2] is the second leftmost key, and so on. Got it?

In this tutorial I will put the label of any shifted function or any function accessed by a soft key parenthesis after the key. For example, for the square function:

[LS] [ √ ] (x^2)

Press the left shift key, then the square root key. The square function is just labeled as the left-shifted function of that key.

Note: For the 50g, it is assumed that Soft Menus are turned on. (Flag -117 is set)

#1: 5 + 8

Keystrokes:

HP 48S/48G/50g: [ 5 ] [ENTER]

Display: [1: 5.0000]

HP 48S/48G/50g: [ 8 ] [ + ]

Display: [1: 13.0000]

Result: 13

#2: Chain Addition: 1000 + 1500+ 1750

Keystrokes:

HP 48S/48G/50g: 1000 [ENTER]

Display: [1: 1000.0000]

HP 48S/48G/50g: 1500 [ + ]

Display: [1: 2500.0000]

HP 48S/48G/50g: 1750 [ + ]

Display: [1: 4250.0000]

Result: 4,250

#3: To Clear the Stack

HP 48S: [LS] [backspace key]
HP 48G: [LS] [DEL]
HP 50g: [LS] [backspace key]

#4: 10 - 6

As in any calculation involving subtraction or division, the order of the arguments is important.

Keystrokes:

HP 48S/48G/50g: 10 [ENTER]

Display: [1: 10.0000]

HP 48S/48G/50g: 6 [ - ]

Display: [1: 4.0000]

Result: 4

#5: 6 x 2.95 + 2 x 1.28

Sometimes it is useful to leave previous results on the stack while working on parts of the problem. The order of operations tells us to do multiplication first, then addition.

HP 48S/48G/50g: 6 [ENTER] 2.95 [ x ]

Display:
[1: 17.7000]

Leave 17.7 on the stack for future use.

HP 48S/48G/50g: 2 [ENTER]

Display:
[2: 17.7000]
[1: 2.0000]

HP 48S/48G/50g: 1.28 [ x ]

Display:
[2: 17.7000]
[1: 2.5600]

Now complete the calculation.

HP 48S/48G/50g: [ + ]

Display:
[1: 20.2600]

Result: 20.26

# 6: 200 ÷ (3^2.5 - 1)

Keystrokes:

We'll start by entering 200 and leaving it on the stack for future use.

HP 48S/48G/50g: 200 [ENTER] 3 [ENTER]

Display:
[2: 200.0000]
[1: 3.0000]

HP 48S/48G/50g: 2.5 [y^x]

Display:
[2: 200.0000]
[1: 15.5885]

HP 48S/48G/50g: 1 [ - ]

Display:
[2: 200.0000]
[1: 14.5885]

We are ready for the division.

HP 48S/48G/50g: [ ÷ ]

Display:
[1: 13.7095]

Result: 13.7095

#7: 2 x (5 ^ 2.5 ÷ 2.5 ^ 5)

Take care of the fraction first, multiply it all by 2 in the end.

HP 48S/48G/50g: 2 [ENTER] 5 [ENTER]

Display:
[2: 2.0000]
[1: 5.0000]

HP 48S/48G/50g: 2.5 [y^x]

Display:
[2: 2.0000]
[1: 55.9017]

HP 48S/48G/50g: 2.5 [ENTER] 5 [y^x]

Display:
[3: 2.0000]
[2: 55.9017]
[1: 97.6563]

HP 48S/48G/50g: [ ÷ ]

Display:
[2: 2.0000]
[1: 0.5724]

Finish it off.

HP 48S/48G/50g: [ x ]

Display:
[1: 1.1449]

Result: 1.1449

# 8: 1/2 + 3/7 - √(25/64)

√ is the symbol for square root

Keystrokes (or one possible set of keystrokes):

HP 48S/48G/50g: 2 [1/x]

Display:
[1: 0.5000]

HP 48S/48G/50g: 3 [ENTER] 7 [ ÷ ]

Display:
[2: 0.5000]
[1: 0.4286]

HP 48S/48G/50g: [ + ] 25 [ENTER] 64 [ ÷ ]

Display:
[2: 0.9286]
[1: 0.3906]

HP 48S/48G/50g: [ √ ]

Display:
[2: 0.9286]
[1: 0.6250]

HP 48S/48G/50g: [ - ]

Display:
[1: 0.3036]

Result: 0.3036

#9: Find a decimal approximation, to four decimal places, of e^-3.

Keystrokes:

HP 48S: [ 3 ] [+/-] [LS] [1/x] (e^x)
HP 48G: [ 3 ] [+/-] [LS] [1/x] (e^x)
HP 50g: [ 3] [+/-] [LS] [y^x] (e^x) [RS] [ENTER] (->NUM)

Result: 0.0498


# 10: √(3^2 + 4^2)

Keystrokes:

HP 48S/48G/50g:
3 [LS] [ √ ] (x^2) 4 [LS] [ √ ] (x^2)

Display:
[2: 9.0000]
[1: 16.0000]

HP 48S/48G/50g:
[ + ] [√ ]

Display:
[1: 5.0000]

Result: 5

# 11: Find the percent change between 19.99 (old) and 34.99 (new)

%CHG = Δ% = [new - old] ÷ old x 100%

Keystrokes:

HP 48S:
19.99 [ENTER] 34.99 [MTH] [F1] (PARTS) [NXT] [F5] (%CH)

HP 48G:
19.99 [ENTER] 34.99 [MTH] [F5] (REAL) [F2] (%CH)

HP 50g:
19.99 [ENTER] 34.99 [LS] [SYMB] (MTH) [F5] (REAL) [F2] (%CH)

Result: 75.0375% change

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 performing subtraction, division, and taking powers.

# 12: 2 - (-5 x 3)

In order to demonstrate the Swap function, let's enter the multiplication first.

Keystrokes:

HP 48S/48G/50g:
5 [+/-] [ENTER] 3 [ x ]

Display:
[1: -15.000]

HP 48S/48G/50g:
2 [ENTER]

Display:
[2: -15.0000]
[1: 2.0000]

We need 2 on the top because we need to calculate 2 - (-5 x 3), not (-5 x 3) - 2. This is where the Swap operation comes in.

HP 48S/48G/50g:
[LS] [right arrow] (SWAP - not marked on the 50g+)

Display:
[2: 2.0000]
[1: -15.0000]

Now with the arguments in the proper order, we can execute the subtraction.

HP 48S/48G/50g:
[ - ]

Display:
[1: 17.0000]

Result: 17

# 13: Calculate 200 ÷ 40, but enter 40 first, then 200.

Here we can use the Swap operation to correct the order of dividend and divisor.

HP 48S/48G/50g:
40 [ENTER] 200

Display:
[1: 40.0000]
[ 200]

We need to swap the arguments.

HP 48S/48G/50g:
[ENTER] [LS] [left arrow]

Display:
[2: 200.0000]
[1: 40.0000]

Now we got it!

HP 48S/48G/50g:
[ ÷ ]

Display:
[1: 5.0000]

Result: 5

Roll Down: This operation pushes down the contents of the register one level. You choose how many of the levels "roll" down.


# 14 Roll down a three level stack.

A simple example: Say we have entered 4, 1, and 9 on to the stack and the stack is like this:

3: 4
2: 1
1: 9

((Clear Stack) 4 [ENTER] 1 [ENTER] 9 [ENTER])

I want to rotate the entire stack. The keystrokes for this is:

HP 48S:
[PRG] [F1] (STK) [F6] (DEPTH) [F4] (ROLLD)

HP 48G:
[LS] [up arrow] [F6] (DEPTH) [F4] (ROLLD)

HP 50g:
[LS] [EVAL] (PRG) [F1] (STACK) [NXT] [F6] (DEPTH) [F2] (ROLLD)

The stack looks like this:

3: 9
2: 4
1: 1


The Constant Pi (π)

The Pi key (or keystroke sequence) puts π on level 1 and lifts everything else one level.

# 15: Find the area of a circle with a radius of 2.35 inches.

Area = π *radius^2

Keystrokes:

HP 48S/48G/50g:
[LS] [SPC] (π) 2.35 [LS] [ √ ] (x^2) [ x ]

Display:
[1: 'π*5.5225']

HP 48S: [RS] [EVAL] (->NUM)
HP 48G: [LS] [EVAL] (->NUM)
HP 50g: [RS] [ENTER] (->NUM)

Display:
[1: 17.3494]

Result: 17.3494 square inches

Additional Examples

# 16: How many 5-card hands can be dealt out of a standard deck of 52 playing cards?

Combination = COMB = n! ÷ (k! x (n - k)!)

It is found in the Math-Probability Menu, labeled COMB

Keystrokes:

HP 48S:
52 [ENTER] 5 [MTH] [F2] (PROB) [F1] (COMB)

HP 48G:
52 [ENTER] 5 [MTH] [NXT] [F1] (PROB) [F1] (COMB)

HP 50g:
52 [ENTER] 5 [LS] [SYMB] (MTH) [NXT] [F1] (PROB) [F1] (COMB)

Result: 2,598,960 possible hands

# 17: 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?

The percent function returns level 2 * level 1 ÷ 100 on level 1.

Keystrokes:

HP 48S:
99.99 [ENTER] [ENTER] 15 [MTH] [F1] (PARTS) [NXT] [F4] (%) [ - ] [ENTER] 8.75 [F4] (%) [ + ]

HP 48G:
99.99 [ENTER] [ENTER] 15 [MTH] [ F5 ] (REAL) [F1] (%) [- ] [ENTER] 8.75 [F1] (%) [ + ]

HP 50g:
99.99 [ENTER] [ENTER] 15 [LS] [SYMB] (MTH) [F5] (REAL) [F1] (%) [ -] [RS] [ENTER] (->NUM) [ENTER] 8.75 [F1] (%) [ + ]

Result: 92.4283 (The final bill is $92.43)

# 18: How to set the Angle Mode

HP 48S:
[LS] [CST] (MODES) [NXT] [NXT]
Select [F1] for Degrees, [F2] for Radians, [F3] for Gradients


HP 48G (via menu):
[RS] [CST] (MODES) [down arrow]
Use [F2] to choose the angle, press [F6] (OK) to accept the settings


HP 50g (via menu):
[MODE] [down arrow] [down arrow]
Use [F2] to choose the angle, press [F6] (OK) to accept the settings



# 19: While the calculator is in Radians mode, find sin^-1 (.5). Then convert the result to degrees.

See # 18 on how to set the calculator to Radians mode. Your calculator is in Radians mode if the display has a RAD indicator on the upper left corner of the screen.

HP 48S/48G/50g: .5 [LS] [SIN] (ASIN)

Display:
[1: 0.5236]

HP 48S: 180 [ x ] [LS] [SPC] (π) [ ÷ ] [RS] [EVAL]
HP 48G: [MTH] [F5] (REAL) [NXT] [NXT] [F6] (R->D)
HP 50g: [LS] [SYMB] (MTH) [F5] [NXT] [NXT] [F6] (R->D)

Display:
[1: 30.0000]

So sin^-1 (.5) ≈ .5236 radians = 30º

Note:
R->D is the Radians to Degrees function
D->R is the Degrees to Radians function

I hope you find this tutorial on RPL helpful.


Eddie

Python – Earth’s Radius and Gravity in US Units

Python – Earth’s Radius and Gravity in US Units Introduction The following script, gravus2.py, estimates the Earth’s gravity i...