A Bayesian estimate of the bias of a coin Consider a coin with unknown probability $p$ of landing on head. I will toss the coin and stop as soon as I get a head. Say this is after $n$ tosses.  
If my prior belief for $p$ was uniform on (0,1), what would a Bayesian say $p$ is after this experiment?
 A: I'm going to call the uniformly distributed random variable capital $P$ and the use lower-case $p$ for the argument to the density function.
So $P$ is uniformly distributed on the interval $[0,1]$ and
$$(X_1,X_2,X_3,\ldots\mid P)\sim\mathrm{i.i.d.\ Bernoulli}(P).$$
Then let $N=\min\{n\in\{1,2,3,\ldots\}\,:\, X_n=1\}$.
We seek the conditional distribution of $P$ given that $N=10$.
The likelihood function is
$$
\begin{align}
p\mapsto L(p\mid N=10) & = \Pr(N=10\mid P=p) \\[8pt]
& = \Pr(\text{9 failures and then 1 success}\mid P=p) \\[8pt]
& = (1-p)^9 p.
\end{align}
$$
The posterior density is then
$$
f_{P\,\mid\, N=10} (p) = c \cdot 1\cdot (1-p)^9 p
$$
(the "$1$" is the prior density function evaluated at $p$) where $c$ is the normalizing constant given by
$$
\frac 1 c = \int_0^1 (1-p)^9 p\,dp.
$$
This is a Beta distribution.
In this case the quickest way to find the integral may be this
$$
\int_0^1 (1-p)^9 p\,dp = \int_1^0 q^9(1-q)(-dq) = \int_0^1 (q^9 - q^{10})\, dq = \frac 1 {10} - \frac 1 {11} = \frac 1 {110}.
$$
The density is therefore
$$
f_{P\,\mid\,N=10}(p) = 110(1-p)^9 p \quad\text{for } 0<p<1.
$$
It may be of interest to observe that this is the same as the conditional distribution of $P$ given the event that $X_1+\cdots+X_{10}=1$, despite the fact that that event has a much higher probability than $N=10$.
