Previous Up Next

9.4.13  The geometric distribution

The probability density function for the geometric distribution: geometric

If an experiment with probability of success p is iterated, the probability that the first success occurs on the kth trial is (1−p)k−1p. This gives the geometric distribution (with parameter p) on the natural numbers. Given such a p, the geometric density function at n is given by

geometric(p,n) = (1−p)n−1p     (10)

The geometric command computes this density function.


Example.
Input:

geometric(0.2,3)

Output:

0.128

The cumulative distribution function of the geometric distribution: geometric_cdf

The geometric_cdf command computes the cumulative distribution function for the geometric distribution.

It turns out that geometric_cdf(p,n) = 1 − (1−p)n.


Examples.

The inverse distribution function for the geometric distribution: geometric_icdf

The geometric_icdf command computes the inverse distribution for the geometric distribution.


Example.
Input:

geometric_icdf(0.2,0.5)

Output:

4

Previous Up Next