Statistics Toolbox
  Go to function:
    Search    Help Desk 
geoinv    Examples

Inverse of the geometric cumulative distribution function (cdf).

Syntax

Description

geoinv(Y,P) returns the smallest integer X such that the geometric cdf evaluated at X is equal to or exceeds Y. You can think of Y as the probability of observing X successes in a row in independent trials where P is the probability of success in each trial.

The arguments P and Y must lie on the interval [0 1]. Each X is a positive integer.

Examples

The probability of correctly guessing the result of 10 coin tosses in a row is less than 0.001 (unless the coin is not fair.)

The example below shows the inverse method for generating random numbers from the geometric distribution.



[ Previous | Help Desk | Next ]