Bernoulli probability distribution.
Bernoulli(g,p)
Generates a random variate following the Bernoulli probability distribution with probability p.
The pseudo-code algorithm used for this distribution is:
1. Generate u as U(0,1).
2. If u &le p, return x = 1. Otherwise, return x = 0.
(u,g) := Bernoulli(g,0.4);
function Bernoulli extends Var; end Bernoulli;