Example on how to sample from a distribution (described as a histogram of values).
The histogram is a C++ map<int, int> mapping value -> frequency.
mkdir build;
cd build;
cmake ..
make
./sample_hist
Make the sample histogram not fixed. We can probably generate it by
drawing from std::uniform_int_distribution<int>.