Engineered Software

Poisson Distribution


Binomial Distribution

Hypergeometric Distribution

Geometric Distribution

Exam

Engineered Software Home Page

The poisson distribution is used to model rates, such as rabbits per acre, defects per unit, or arrivals per hour.  The poisson distribution is closely related to the exponential distribution. If x is a poisson distributed random variable, the 1/x is an exponential random variable. If x is an exponential random variable, then 1/x is a poisson random variable. For a random variable to be poisson distributed, the probability of an occurrence in an interval must be proportional to the length of the interval, and the number of occurrences per interval must be independent.

The poisson probability density function is

Microsoft Excel contains the poisson probability distribution function.  The format is

=POISSON(x, m,0)

The term p(x,m) represents the probability of exactly x occurrences in an interval having an average of m occurrences. The mean and variance of the poisson distribution are both equal to m. The poisson cumulative distribution function is simply the sum of the poisson probability density function from 0 to x.

The cumulative poisson distribution has been computed in many text books to eliminate the need for tedious calculations, but most people prefer to use the Excel formula

=POISSON(x, m,1)

Example
A complex software system averages 7 errors per 5,000 lines of code. What is the probability of exactly 2 errors in 5,000 lines of randomly selected lines of code?

Solution
The probability of exactly 2 errors in 5,000 lines of randomly selected lines of code is

Click here to download this solution and the remaining examples on this page in Microsoft Excel.

Example
A complex software system averages 7 errors per 5,000 lines of code. What is the probability of exactly 3 errors in 15,000 lines of randomly selected lines of code?

Solution
The average number of errors in 15,000 lines of code is

The probability of exactly 3 errors in 15,000 lines of randomly selected lines of code is

Example
A complex software system averages 6 errors per 5,000 lines of code. What is the probability of less than 3 errors in 2,500 lines of randomly selected lines of code? What is the probability of more than 2 errors in 2,500 lines of randomly selected lines of code?

Solution
The average number of errors in 2,500 lines of code is m = 3. The probability of less than 3 defects is equal to the probability of exactly 0 defects plus the probability of exactly 1 defect plus the probability of exactly 2 defects.  Entering a cumulative poisson table in the with r = 2 and m = 3 gives the probability of 2 or fewer defect which is 0.4232. This value can also be computed manually. The same solution is found using the Excel formula

=POISSON(2,3,1)

The "1" at the end of this formula gives the cumulative poisson.

The probability of more than 2 errors is equal to the probability of exactly 3 plus the probability of exactly 4 plus the probability of exactly 5, etc. A simpler approach is to consider that the probability of more than 2 errors is equal to one minus the probability of 2 or fewer errors. Thus, the probability of more than 2 errors is 1 - 0.4232 = 0.5768.

BackHomeNext