Changed the routine that generates a Bernoulli random variable to return optional values for success vs failure.