The Museum of HP Calculators

Permutation and Combination for the HP-95C

This program is Copyright © 1977 by Hewlett-Packard Company and is used here by permission. It was originally printed in the HP-95C Applications book. This program was entered by André Wilhelmus and the curator added comments from the HP manual.

This program is supplied without representation or warranty of any kind. André Wilhelmus, Hewlett-Packard and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Program Listing

CODE KEYS
A-000    lbl A f LBL A m ↑ n → mPn
A-001    61 41 f x=y
A-002    63  5 GTO 5
A-003    61 44 f x>y
A-004    63  2 GTO 2
A-005    62 41 g x=0
A-006    63  3 GTO 3
A-007        1 1
A-008    61 41 f x=y
A-009    63  4 GTO 4
A-010       49
A-011    35 52 STO I
A-012       12 R↓
A-013    35  9 STO 9 - - - - - - - - - - - - - - -
A-014 61 63  1 f LBL 1 m(m-1) ... (m - n + 1)
A-015    45  9 RCL 9
A-016        1 1
A-017       49
A-018    35  9 STO 9
A-019       39 ×
A-020    62 52 g DSZ
A-021    63  1 GTO 1
A-022    61 53 f RTN - - - - - - - - - - - - - - -
A-023 61 63  2 f LBL 2 n > m: error
A-024        0 0
A-025       24 ÷ - - - - - - - - - - - - - - -
A-026 61 63  3 f LBL 3 mPo = 1
A-027        1 1
A-028    61 53 f RTN - - - - - - - - - - - - - - -
A-029 61 63  4 f LBL 4 mP1 = m
A-030       12 R↓
A-031       12 R↓
A-032    61 53 f RTN - - - - - - - - - - - - - - -
A-033 61 63  5 f LBL 5 mPm = m!
A-034    62  2 g N! - - - - - - - - - - - - - - -
b-000    lbl b f LBL B m ↑ n → mCn
b-001    61 44 f x>y
b-002    63  2 GTO 2
b-003       49
b-004    61  0 f LAST x
b-005    61 43 f x≤y
b-006       11 x⇔y Store max (n, m-n)
b-007    35  9 STO 9
b-008        1 1 Let m - n > n
b-009    35  8 STO 8
b-010       59 + m - n + 1 → R7
b-011    35  7 STO 7
b-012       12 R↓
b-013    62 41 g x=0
b-014    63  3 GTO 3
b-015 61 63  5 f LBL 5
b-016        1 1
b-017    45  8 RCL 8
b-018       59 +
b-019    35  8 STO 8
b-020    61 44 f x>y If j > n, exit
b-021    63  6 GTO 6
b-022    45  9 RCL 9
b-023       59 +
b-024    45  8 RCL 8
b-025       24 ÷ ( m - n + j ) / j
b-026 35 39  7 STO × 7
b-027       12 R↓
b-028    63  5 GTO 5
b-029 61 63  6 f LBL 6
b-030    45  7 RCL 7
b-031    61 53 f RTN
b-032 61 63  2 f LBL 2
b-033        0 0
b-034       24 ÷
b-035 61 63  3 f LBL 3
b-036        1 1

Go back to the HP-95C software library
Go back to the general software library
Go back to the main exhibit hall