# Discrete Distributions

Discrete distributions

We start our discussion with the discrete distributions available in AIMMS. They are

Discrete distributions describing successes

The Binomial, HyperGeometric and Poisson distributions describe the number of times that a particular outcome (referred to as “success”) occurs. In the Binomial distribution, the underlying assumption is a fixed number of trials and a constant likelihood of success. In the HyperGeometric distribution, the underlying assumption is “sampling without replacement”: A fixed number of trials are taken from a population. Each element of this population denotes a success or failure and cannot occur more than once. In the Poisson distribution the number of trials is not fixed. Instead we assume that successes occur independently of each other and with equal chance for all intervals with the same duration.

Distributions describing trials

The NegativeBinomial distribution describes the number of failures before a specified number of successes have occurred. It assumes a constant chance of success for each trial, so it is linked to the Binomial distribution. Similarly, the distribution linked to Poisson distribution that describes the amount of time until a certain number of successes have occurred is known as the Gamma distribution and is discussed in Continuous Distributions. The NegativeBinomial distribution is a special case of the Geometric distribution and describes the number of failures before the first success occurs. Similarly, the Exponential distribution is a special case of the Gamma distribution and describes the amount of time until the first occurrence.

Discrete distributions overview

this table shows the relation between the discrete distributions. The continuous Exponential and Gamma distribution naturally fit in this table as they represent the distribution of the time it takes before the first/$$n$$-th occurrence (given the average time between two consecutive occurrences).

Table 94 Overview of discrete distributions in AIMMS

with replacement

without replacement

independent occurrences at random moments

example

throwing dice

drawing cards

serving customers

# trials until first success / time until first occurrence

Geometric

not supported in AIMMS

Exponential (continuous)

# trials until $$n$$-th success / time until $$n$$-th occurrence

NegativeBinomial

not supported in AIMMS

Gamma (continuous)

# successes in fixed # trials / # successes in fixed time

Binomial

HyperGeometric

Poisson

Binomial distribution

The Binomial$$(p,n)$$ distribution:

 Input parameters Probability of success $$p$$ and number of trials $$n$$ Input check $$\mbox{integer} \; n > 0 \; \mbox{and} \; 0 < p < 1$$ Permitted values $$\{i \; | \; i = 0, 1, \ldots, n \}$$ Formula $$P(X=i) = \binom{n}{i} p^i (1-p)^{n-i}$$ Mean $$np$$ Variance $$np(1-p)$$ Remarks Binomial$$(p,n)$$ = HyperGeometric$$(p,n,\infty)$$

A typical example for this distribution is the number of defectives in a batch of manufactured products where a fixed percentage was found to be defective in previously produced batches. Another example is the number of persons in a group voting yes instead of no, where the probability of yes has been determined on the basis of a sample.

HyperGeometric distribution

The HyperGeometric$$(p,n,N)$$ distribution:

 Input parameters Known initial probability of success $$p$$, number of trials $$n$$ and population size $$N$$ Input check $$\mbox{integer} \; n,N: 0 < n \leq N, \; \mbox{and p \in \frac{1}{N}, \frac{2}{N}, \ldots, \frac{N - 1}{N}}$$ Permitted values $$\{ i \; | \; i = 0, 1, \ldots, n \}$$ Formula $$P(X = i) = \frac{ \binom{N p}{i} \binom{N (1-p)}{n - i} }{ \binom{N}{n} }$$ Mean $$np$$ Variance $$np(1-p)\mbox{\frac{N-n}{N-1}}$$

As an example of this distribution, consider a set of 1000 books of which 30 are faulty When considering an order containing 50 books from this set, the HyperGeometric(0.03,50,1000) distribution shows the probability of observing $$i \; (i = 0, 1, \ldots,n)$$ faulty books in this subset.

Poisson distribution

The Poisson$$(\lambda)$$ distribution:

 Input parameters Average number of occurrences $$\lambda$$ Input check $$\lambda > 0$$ Permitted values $$\{ i \; | \; i = 0, 1, \ldots \}$$ Formula $$P(X = i) = \frac{\lambda^i}{i!} e^{-\lambda}$$ Mean $$\lambda$$ Variance $$\lambda$$ Remarks Poisson$$(\lambda)= \lim_{p \downarrow 0}$$Binomial$$(p,\lambda/p)$$

The Poisson distribution should be used when there is an constant chance of a ‘success’ over time or (as an approximation) when there are many occurrences with a very small individual chance of ‘success’. Typical examples are the number of visitors in a day, the number of errors in a document, the number of defects in a large batch, the number of telephone calls in a minute, etc.

NegativeBinomial distribution

The NegativeBinomial$$(p,r)$$ distribution:

 Input parameters Success probability $$p$$ and number of successes $$r$$ Input check $$0 < p < 1 \; \mbox{and} \; r = 1, 2, \ldots$$ Permitted values $$\{ i \; | \; i = 0, 1, \ldots \}$$ Formula $$P(X = i) = \binom{r + i - 1}{i} p^r (1-p)^i$$ Mean $$r/p-r$$ Variance $$r(1-p)/p^2$$

Whenever there is a repetition of the same activity, and you are interested in observing the $$r$$-th occurrence of a particular outcome, then the NegativeBinomial distribution might be applicable. A typical situation is going from door-to-door until you have made $$r$$ sales, where the probability of making a sale has been determined on the basis of previous experience. Note that the NegativeBinomial distribution describes the number of failures before the $$r$$-th success. The distribution of the number of trials $$i$$ before the $$r$$-th success is given by $$P_{\texttt{NegativeBinomial(p,r)}}(X=i-r)$$.

Geometric distribution

The Geometric$$(p)$$ distribution:

 Input parameters Probability of success $$p$$ Input check $$0 < p < 1$$ Permitted values $$\{i \; | \; i = 0, 1, \ldots \}$$ Formula $$P(X = i) = (1 - p)^i p$$ Mean $$1/p-1$$ Variance $$(1-p)/p^2$$ Remarks Geometric$$(p)$$ = NegativeBinomial$$(p,1)$$

The Geometric distribution is a special case of the NegativeBinomial distribution. So it can be used for the same type of problems (the number of visited doors before the first sale). Another example is an oil company drilling wells until a producing well is found, where the probability of success is based on measurements around the site and comparing them with measurements from other similar sites.