The Museum of HP Calculators


Binomial probabilities for the HP-11C

This program is by Andrew Feist and is used here by permission.

This program is supplied without representation or warranty of any kind. Andrew Feist 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.

Overview

Purpose:
Computes binomial probabilities and cumulative probabilities (e.g., flipping a biased coin).

Usage:
Type n [enter] p [enter] x [B] to compute the probability of x successes in a binomial experiment with n trials, with probability of success p.
Type n [enter] p [enter] x [C] to compute the probability of x or fewer successes in a binomial experiment with n trials, with probability of success p.

Memory:
The program B uses three registers (4-6 in the given listing), and the program C uses four (3-6 in the given listing). The number in stack position T is lost.

Listing

001 f-LBL B
002 STO 6
003 R↓
004 STO 5
005 R↓
006 STO 4
006 RCL 6
008 f-LBL 1
009 g-Cy,x
010 RCL 5
011 RCL 6
012 yx
013 ×
014 1
015 RCL 5
016 -
017 RCL 4
018 RCL 6
019 -
020 yx
021 ×
022 g-RTN
023 f-LBL C
024 STO 6
025 R↓
026 STO 5
027 R↓
028 STO 4
029 RCL 6
030 GSB 1
031 STO 3
032 f-LBL 2
033 RCL 6
034 1
035 -
036 g-x<0
037 GTO 3
038 STO 6
039 RCL 4
040 x⇔y
041 GSB 1
042 STO + 3
043 GTO 2
044 f-LBL 3
045 RCL 3
046 g-RTN

Go back to the software library
Go back to the main exhibit hall