unexpected output from std::exponential_distribution
I am trying to use std::exponential_distribution ( https://cplusplus.com/reference/random/exponential_distribution/ )
My code
#include
#include
main()
{
std::cout << "35\n";
std::default_random_engine gen(345);
std::exponential_distribution distribution35(35.);
for (int i = 0; i < 10; ++i)
{
std::cout << distribution35(gen) << " ";
}
std::cout << "\n100\n";
std::exponential_distribution distribution100(100.);
for (int i = 0; i < 10; ++i)
{
std::cout << distribution100(gen) << " ";
}
}
Which outputs
35
0.0136829 0.0076274 0.0222437 0.00667449 0.0180882 0.0063273 0.0749283 0.0392187 0.0304785 0.00178526
100
0.0275807 5.90855e-06 0.0156269 0.00921409 0.0241637 0.0317782 0.00470415 0.00275501 0.0326016 0.00042742
Questions:
- Why are the generated numbers so small?
2 Why does constructing with a larger lambda parameter still produce numbers that seem too small.