Skip to main content

Geometric

Base class: Distribution

Returns the average number of failures before success when the chance of success is p (with default value 0.5).

The probability mass function is given by,

P(x∣p)=p(1−p)x.P(x | p) = p (1-p)^x.

Constructors​

Geometric(const Geometric distribution) -> Geometric​

Copy constructor for Geometric distribution.

Parameters​

  • distribution: Geometric distribution to be copied

Symbols​

NameDescription
=Copy assignment operator for Geometric distribution.

Members​

NameDescription
maxReturns the maximum possible value from the distribution
minReturns the minimum possible value from the distribution
pProbability of success.
sampleSample from distribution.