Class Geometric

Geometric distribution: A discrete probability distribution that models the number of Bernoulli trials needed to get the first success, with each trial having the same probability of success p.

Constructors

Properties

Methods

Constructors

Properties

mean: number

The mean of the distribution.

p: number

The probability of success.

stdev: number

The standard deviation of the distribution.

variance: number

The variance of the distribution.

Methods

  • Get the probability of a success on the xth trial.

    Parameters

    • x: number

      The number of trials. (x must be an integer and x>0)

    Returns number

    Return P(X=x).