# A simple question about MAP and MLE

I recently got this simple question from a friend. But I am quite confused about it.

Suppose we toss a coin $N$ times, and got heads $m$ times. Assume the binomial distribution with $p$ which is the probability of head each toss, then the MLE of $p$ is just $\hat{p}=\frac{m}{N}$. Now if we consider this problem within Bayesian framework, and suppose we have a prior on $p$ that $p_0=0.5$ (or other value in $(0,1)$), then what is the MAP of $p$?

Many thanks!

$p_0$.

Your friend appears to have what is known as a dogmatic prior. The MAP is what maximizes the posterior, and the posterior is (proportional to) the product of likelihood and prior, and if the prior only takes a nonzero value at $p_0$, then so will the product of likelihood and prior.

If your friend expects $p$ to be 0.5, but is not sure, then there are many solutions. You could express that by having a prior mean of 0.5 for $p$. Consider the conjugate beta prior with prior mean $\alpha/(\alpha+\beta)$. You get a prior mean of 0.5 for a uniform prior with $\alpha=\beta=1$, but also for, say, $\alpha=\beta=10$, but the resulting MAPs will be very different: In the former case, we will simply have $MLE=MAP$, while in the second, we get a MAP of $$\frac{\alpha+m-1}{\alpha+\beta+N-2}.$$ For $N=27$ and $m=7$, this looks as follows:

• Thanks! Maybe I didn't say it clear.. so how do we express the prior that "we believe that the probability of head is 0.5"? Jun 19, 2015 at 16:42
• see my edit, is that what you meant? Jun 19, 2015 at 16:51