Exponential

Represents the time between events in a Poisson process, where events occur continuously and independently at a constant average rate.

circle-exclamation

Create a new Exponential distribution

Exponential X = Exponential(lambda); 

creates a continuous Exponential probability distribution.

Distribution properties:

Property
Type/Return type
Description

lambda (λ)

double

Events occur continuously and independently at a constant average rate.

E()

double

Returns the expected value of average time between two events.

D()

double

Represents variance, that measures the spread of dispersion of the random variable around its expected value E(X).

P(int k)

double

The cumulative distribution function: P(X < k)

circle-info

In continuous probability distributions, P(X = k) = 0.

Example

//Example: The average number of clients is 15 students per hour. What is the 
//probability that you will have to wait not more than 3 minutes for a client 
//to appear?
double lambda = 0.25; //15 students per hour -> 1 client per 4 minutes. 
Exponential X = Exponential(lambda);
std::cout << X.P(3) << std::endl; //0.527633
circle-info

Good to know: k cannot be negative.

Last updated