Poisson
Create a new Poisson distribution
Poisson X = Poisson(lambda); Distribution properties:
Property
Type/Return type
Description
Example
//Example: A bookstore expects 3 visitors per hour. What's the probability
//of encountering 5 visitors in an hour?
double lambda = 3; //3 visitors per hour
Poisson X = Poisson(lambda);
std::cout << X.P(5) << std::endl; //0.100819Poisson X = Poisson(5);
std::cout << X.P(-1) << std::endl; //Error: Random variable cannot be less than 0. Last updated