[Boost] How to generate a Bernuolli number under probablity p

Hi, I want to randomly generate a Bernuolli number [0, 1],with probability p ~[0 1]. How to do that with boost? Thanks! -- ------------------------------- Enjoy life! Barco You

Hi, I think you've misunderstood the Bernoulli distribution. It just says that there is a probability p for an event to happen an the probability 1 - p for its complementary. In Boost.Random you can give the generator a probability and it generates these events. Internally I think it just uses another random number generator. So if you want number in the interval [0,1] you have to use the appropriate generator for your use case. Henning Barco You schrieb:
Hi,
I want to randomly generate a Bernuolli number [0, 1],with probability p ~[0 1]. How to do that with boost?
Thanks!
participants (2)
-
Barco You
-
Henning Basold