Added simulation for the Bernoulli trial.