# Coin with unknown bias flipped N times with N heads, what is p(h)?

Given a coin with an unknown bias and the observation of $N$ heads and $0$ tails, what is expected probability that the next flip is a head?

-
What are your feelings about Bayesian priors? – Gerry Myerson Apr 11 '12 at 0:25
I think that is what I'm looking for, but don't know where to start. I tried using EM, but I think the equation is unsolvable with 0 observations of tails. – Mark Apr 11 '12 at 0:33
I came across this: en.wikipedia.org/wiki/… But I'm not too sure what to put in for $r$ – Mark Apr 11 '12 at 1:01

This is the same as taking some unknown $p$ from $[0,1]$ and then saying that all $X_i$ uniformly independently distributed over $[0,1]$ ended up smaller than $p$ (or that $p$ was the largest of $X_i$). If all biases are equally probable (i.e. $p$ is also uniformly distributed over $[0,1]$) then the probability in question equals

$$P(X_{N+1} < p\ |\ X_1 < p, \ldots, X_N < p) = \frac{P(\bigcap_i^{N+1} X_i < p)}{P(\bigcap_i^{N} X_i < p)}$$

but $\{X_1, X_2, \ldots, X_{N+1}, p\}$ are independent, so the result is

$$\frac{\int_0^1 p^{N+1} \, dp}{\int_0^1 p^N \, dp} = \frac{N+1}{N+2}$$

Maybe that will help ;-)

-
That's rather surprising, since it says that if I flip the coin once and get a head, the result is 2/3. But experience says that if I do that, the result should actually be 1/2. – MJD Apr 11 '12 at 5:21
@MJD: That's because most coins you've flipped have probably been more or less fair, so your experience has a strong prior bias towards $p \approx \frac12$. Thus, the implicit flat prior assumed by the Rule of Succession doesn't really match your experience well. – Ilmari Karonen Jul 16 '15 at 19:21

This question does not have a well-defined mathematical answer unless you have a prior probability distribution on the coin's bias. In the 18th century, Laplace considered the probability that the sun will rise tomorrow, given that it's risen every day during the 6000 years the universe has existed. He started with a probability distribution on the "bias", saying there is an unknown number $p$ between $0$ and $1$ such that the probability that the sun will rise on any given day, given that one knows with certainty the value of $p$, is $p$. He said $p$ is uniformly distributed between $0$ and $1$. And then he derived Laplace's rule of succession. I wrote a derivation of that rule in one of my answers here; I'll see if I can find it.

Later note: I found it: Estimating a probability of head of a biased coin

-
Note that it is currently widely accepted that the estimate given above for the number of days on which the sun has risen is off by about 6 orders of magnitude. – Gerry Myerson Apr 11 '12 at 4:35
@GerryMyerson : Indeed, Augustine of Hippo, around the year 400, wrote that the book of Genesis is not to be construed literally. – Michael Hardy Apr 11 '12 at 15:50

I think this is answered in http://stats.stackexchange.com/a/23003 in the more generally section.

-
I don't think that helps as I need to solve for p. Though thanks for pointing out that site, I should probably ask the question over there – Mark Apr 11 '12 at 0:51