This program is Copyright © 1975 by HewlettPackard and is used here by permission. This program was originally published in "HP25 Applications Programs".
This program is supplied without representation or warranty of any kind. HewlettPackard Company 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.
A combination is a selection of one or more of a set of distinct objects without regard to order. The number of possible combinations, each containing n objects, that can be formed from a collection of m distinct objects is given by
m! m(m1) ... (mn+1) _{m}C_{n} =  =  (mn)!n! 1 * 2 * ... * n
where m, n are integers and 0 <= n <= m.
This program computes _{m}C_{n }using the following algorithm:
1. If n <= mn
mn+1 mn+2 m _{m}C_{n} =  *  * ... *  1 2 n
2. If n > m  n, program computes _{m}C_{mn}.
Notes:
1. _{m}C_{n}, which is also called the binomial coefficient,
can be denoted by C^{m}_{n}, C(m,n), or
(^{m}_{n})
2. _{m}C_{n} = _{m}C_{mn}
3. _{m}C_{0} = _{m}C_{m} = 1
4. _{m}C_{1 }= _{m}C_{m1 }= m
Step 
Instructions 
Input Data/Units 
Keys 
Output Data/Units 
1 
Enter program 

2 
Enter m and n and 
m 
ENTER 

3 
Compute combinations 
n 
f PRGM R/S 
_{m}C_{n} 
4 
For new case, go to step 2 


1. _{73}C_{4} = 1088430.00
2. _{43}C_{3} = 12341.00
LINE CODE KEYS 00 01 41  02 14 73 f LASTx 03 14 41 f x<y 04 21 x<>y 05 23 00 STO 0 06 01 1 07 23 01 STO 1 08 51 + 09 23 02 STO 2 10 22 roll dn 11 15 71 g x=0 12 13 30 GTO 30 13 01 1 14 24 01 RCL 1 15 51 + 16 23 01 STO 1 17 21 x<>y 18 14 51 f x>=y 19 13 22 GTO 22 20 24 02 RCL 2 21 13 00 GTO 00 22 21 x<>y 23 24 00 RCL 0 24 51 + 25 24 01 RCL 1 26 71 ÷ 27 23 61 02 STO x 2 28 22 roll dn 29 13 13 GTO 13 30 01 1 31 13 00 GTO 00
R0 max(n, mn) R1 used R2 used
Go back to the
software library
Go back to
the main exhibit hall