Exponential
Represents the time between events in a Poisson process, where events occur continuously and independently at a constant average rate.
Don't get confused with Poisson distribution! One measures how many events happen in a given time frame, and the other measures the time between two independed events.
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)
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
Last updated