Saturday, June 3, 2017

HP 20S and HP 21S: Minimum and Maximum of a Data Set

HP 20S and HP 21S: Minimum and Maximum of a Data Set

The input/output format is the same for both minimum and maximum:

1. Enter the initial data point, press XEQ A.
2. Enter subsequent points, press XEQ B.
3. To find the minimum or maximum, depending on which program you use, press XEQ C.

The key codes for both the HP 20S and HP 21S for these programs are the same.  Caution: this won’t always be the case.  The HP 20S has a row dedicated to conversions while the HP 21S has a row dedicated to statistics.

HP 20S and HP 21S: Minimum

STEP
CODE
KEY
01
61, 41, A
LBL A
02
21, 1
STO 1
03
61, 26
RTN
04
61, 41, B
LBL B
05
21, 0
STO 0
06
31
INPUT
07
22, 1
RCL 1
08
61, 42
X≤Y?
09
51, 41, 1
GTO 1
10
71
Clear [ C ]
11
61, 26
RTN
12
61, 41, 1
LBL 1
13
51, 31
SWAP
14
21, 1
STO 1
15
71
Clear [ C ]
16
61, 26
RTN
17
61, 41, C
LBL C
18
22, 1
RCL 1
19
61, 26
RTN

Example: 
Data Set:  9, 3, 6, 5, 7, 2, 4
Minimum:  2 (stored in R1)

HP 20S and HP 21S: Maximum

STEP
CODE
KEY
01
61, 41, A
LBL A
02
21, 1
STO 1
03
61, 26
RTN
04
61, 41, B
LBL B
05
21, 0
STO 0
06
31
INPUT
07
22, 2
RCL 2
08
51, 31
SWAP
09
61, 41
X≤Y?
10
51, 41, 2
GTO 2
11
71
Clear [ C ]
12
61, 26
RTN
13
61, 41, 2
LBL 2
14
21, 2
STO 2
15
71
Clear [ C ]
16
61, 26
RTN
17
61, 41, C
LBL C
18
22, 2
RCL 2
19
61, 26
RTN

Example: 
Data Set:  9, 3, 6, 5, 7, 2, 4
Maximum:  9 (stored in R2)

This is two of my favorite programs I posted this year.  I plan to make a version for the HP 12C soon.  They are simple and versatile. 

Until next time, can you believe it’s June?

Eddie


This blog is property of Edward Shore, 2017.

Fun with the HP 30b

Fun with the HP 30 b Introduction The following programs are for the HP 30b Business Professional. Did you know that the 30b...