The (discrete) cumulative distribution function of the geometric distribution

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.




stats::geometricCDF(p) returns a procedure representing the (discrete) cumulative distribution function

of the geometric distribution with 'probability parameter' p.

The procedure f:=stats::geometricCDF(p) can be called in the form f(x) with an arithmetical expression x. The return value of f(x) is either a number or a symbolic expression:

If x < 1 can be decided, then f(x) returns 0. If x ≥ 1 can be decided, then f(x) returns the value .

If x is a floating-point number and p can be converted to a floating-point number, then these values are returned as floating-point numbers. Otherwise, symbolic expressions are returned.

The function f reacts to properties of identifiers set via assume. If x is a symbolic expression with the property x < 1 or x ≥ 1, the corresponding values are returned.

f(x) returns the symbolic call stats::geometricCDF(p)(x) if neither x < 1 nor x ≥ 1 can be decided.

If p = 0 or p = 0.0, then f(x) returns 0 or 0.0, respectively, for any value of x.

Numerical values for p are only accepted if they satisfy 0 ≤ p ≤ 1.

If x is a real floating-point number, f(x) produces a floating number provided p is a numerical value. If x is an exact numerical value, no internal floating-point conversion of the parameter p is attempted.

Environment Interactions

The function is sensitive to the environment variable DIGITS which determines the numerical working precision.


Example 1

We evaluate the distribution function with at various points:

f := stats::geometricCDF(1/3):
f(-PI) = f(float(-PI)), f(1) = f(1.0), f(103/10) = f(10.3)

delete f:

Example 2

If x is a symbolic object without properties, then it cannot be decided whether x ≥ 1 holds. A symbolic function call is returned:

f := stats::geometricCDF(p): f(x)

With suitable properties, it can be decided whether x ≥ 1 holds. An explicit expression is returned:

assume(1 <= x): f(x)

unassume(x): delete f:

Example 3

We use symbolic arguments:

f := stats::geometricCDF(p): f(x)

If x is a numerical value, symbolic expressions in p are returned:

f(-1), f(1), f(5/2), f(PI)

When numerical values are assigned to p, the function f starts to produce numbers if the argument is numerical:

p := 1/3: f(-1), f(1), f(5/2), f(PI)

delete f, p:



The 'probability parameter': an arithmetical expression representing a real number 0 ≤ p ≤ 1.

Return Values



The geometric distribution describes the number of Bernoulli trials with success probability p up to and including the first success.

Was this topic helpful?