Mean and variance of Bernoulli distribution example