Bayesian Hypothesis Testing Example Questions 
I've been really struggling with these 2 questions and was wondering if anyone could give me any help/ advice?
For the first one I've tried some calculations using the law of total probability but don't seem to be getting anywhere.
For the second one, if the prior is uniformly distributed, does that mean the prior odds is 1:1?
Similarly, I am unsure of how to calculate the posterior odds and the rest of the question.
Any advice or tips would be greatly appreciated.
Thank you so much!
 A: Let $p=\Pr(H_0)$ and $q = 1-p = \Pr(H_1)$ be the prior probabilities.  The likelihood function is
\begin{align}
L(H_0\mid X=x) & = \binom n x \frac 1 {2^n} \\[12pt]
L(H_1\mid X=x) & = \binom n x \left(\frac 3 4\right)^x \left(\frac 1 4 \right)^{n-x}
\end{align}
$$
\frac{\Pr(H_0\mid X=x)}{\Pr(H_1\mid X=x)} = \frac{\Pr(H_0)}{\Pr(H_1)} \cdot \frac{L(H_0\mid X=x)}{L(H_1\mid X=x)} = \frac p q \cdot \frac{\dbinom n x \dfrac 1{2^n}}{\dbinom n x \left(\dfrac 3 4 \right)^x \left( \dfrac 1 4 \right)^{n-x}}
= \frac p q \cdot \frac{2^n}{3^x}.
$$
Then we have $\Pr(H_0\mid X=x)>\Pr(H_1\mid X=x)$ precisely if $\dfrac{2^n p}{3^x q} > 1$.
(The above is all done using odds rather than probablity.  It's a bit simpler that way.  With probabilities, we would need $\Pr(H_0\mid X=x)+\Pr(H_1\mid X=x)=1$, so we'd need the normalizing constant $c$ for which $c(2^n p + 3^x q) = 1$.)
If $\theta$ is uniformly distributed on $(0,1)$, then $\Pr(H_0) = \Pr(\theta \le 1/2) = 1/2$. 
The prior probability distribution of $\theta$ let us denote by saying $\displaystyle \Pr(\theta\in A) = \int_A 1\,dt$ for $A\subseteq (0,1)$; thus the measure is $1\,dt$ on $(0,1)$.  The likelihood is
$$
L(t\mid X=x) = \binom n x t^x (1-t)^{n-x}.
$$
Hence the posterior probability distribution of $\theta$ is
$$
c t^x (1-t)^{n-x}\cdot 1\,dt
$$
where the normalizing constant $c$ is chosen so that $\displaystyle\int_0^1 c t^x (1-t)^{n-x}\cdot 1\,dt = 1$.  Integrating, we get
$$
\int_0^1 t^x(1-t)^{n-x}\cdot 1\,dt = \frac 1 {(n+1)\dbinom n x}.
$$
For probabilistic method of evaluating this integral, see this answer.
So we have
$$
\Pr(H_0\mid X=x) = (n+1)\binom n x \int_0^{1/2} t^x(1-t)^{n-x}\, dt
$$
and the posterior odds is
$$
\frac{\Pr(H_0\mid X=x)}{\Pr(H_1\mid X=x)} = \frac{(n+1)\binom n x \int_0^{1/2} t^x(1-t)^{n-x}\, dt}{(n+1)\binom n x \int_{1/2}^1 t^x(1-t)^{n-x}\, dt} = \frac{\int_0^{1/2} t^x(1-t)^{n-x}\, dt}{\int_{1/2}^1 t^x(1-t)^{n-x}\, dt}.
$$
