20.4.13 Geometric distribution
The probability density function for the geometric distribution.
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.
-
geometric takes two arguments:
-
p, a probability (a number between 0 and 1).
- x, a real number.
geometric(p,x) returns the value of the geometric density
function with probability p, given in (10).
Example
The cumulative distribution function of the geometric distribution.
The geometric_cdf
command computes the cumulative distribution function for the geometric distribution.
-
geometric_cdf takes three mandatory arguments and one
optional argument:
-
p, a probability (a number between 0 and 1).
- n, a natural number.
- Optionally, k, a natural number.
- betad_cdf(p,n) returns
Prob(X ≤ n) for the geometric distribution with
probability p.
- beta_cdf(p,n,k) returns
Prob(n ≤ X ≤ k).
It turns out that geometric_cdf(p,n)=1−(1−p)n.
Examples
The inverse distribution function for the geometric distribution.
The geometric_icdf
command computes the inverse distribution for the geometric distribution.
-
geometric_icdf takes two arguments:
-
p, a probability (a number between 0 and 1).
- h, a real number between 0 and 1.
- geometric_icdf(a,b,h) returns the inverse
distribution for the geometric distribution with probability p;
namely, the smallest natural number n for which Prob(X ≤ n) ≥ h.
Example