Let $\Theta$ be a Bernoulli random variable that indicates which one of two hypotheses is true, and let $P(\Theta=1)=p$. Under the hypothesis $\Theta=0$, the random variable $X$ is uniformly distributed over the interval $[0,1]$. Under the alternative hypothesis $\Theta=1$, the PDF of $X$ is given by $fX∣\Theta(x∣1)=2x $ if $ 0\leq x \leq 1 $ and $0$ otherwise. Consider the MAP rule for deciding between the two hypotheses, given that $X=x$. Find the probability of error associated with the MAP rule as a function of p.
When $p\geq 1/3$, $P(error)$?
I tried using total probability theorem, but I'm not clear how to connect $p \geq 1/3$, to the $P(error)$. I assumed that MAP chooses $\Theta=1$ in that case, but I think that assumption is wrong. Any clues appreciated.
From Bayes rule, we know
$P_{\Theta|X}(\theta=1|x) = \frac{P(\theta=1)f_{X|\Theta}(x|\theta=1)}{f_X(x)} = \frac{1}{f_X(x)}(p*2x)$ and
$P_{\Theta|X}(\theta=0|x) = \frac{P(\theta=0)f_{X|\Theta}(x|\theta=0)}{f_X(x)} = \frac{1}{f_X(x)}((1-p)*1)$,
When $p*2x > (1-p) * 1$, i.e., $x>\frac{1-p}{2p}$, $\Theta=1$ will be favored, and when $p \geq 1/3$, $\frac{1-p}{2p} \leq 1$, so two hypothesis are both possible. The probability of error = (select $\Theta=1$) and ($x < \frac{1-p}{2p}$) + (select $\Theta=0$) and ($x > \frac{1-p}{2p}$), i.e.,
\begin{eqnarray} P(error) &=& P(\Theta=1)f_{X|\Theta}(x < \frac{1-p}{2p}|\theta=1) + P(\Theta=0)f_{X|\Theta}(x > \frac{1-p}{2p}|\theta=0) \\ &=& p*(\frac{1-p}{2p})^2 (\textrm{triangle area}) + (1-p) * (1-\frac{1-p}{2p}) \\ &=& \frac{(1-p)(5p-1)}{4p} \end{eqnarray}