maximum likelihood estimation for bernoulli distribution