Added Bernoulli random trials.