Premium problem118. Bernoulli Maximum Likelihood

Easy Locked

Given a list of 0/1 observations, return the maximum likelihood estimate of the Bernoulli parameter.

Differentiating the log-likelihood gives the answer everyone guesses anyway, the sample proportion. That it is the MLE is the point: the obvious estimator falls out of the likelihood rather than being assumed.

Input

[1, 0, 1, 1, 0]

Output

0.6

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)