I am attempting to answer the following question from my actuarial exams:
We are asked to find $P(p=0.5|X=7)$.
Using Bayes Rule, I believe this is
$$P(p=0.5|X=7) = \frac{P(X=7|p=0.5)P(p=0.5)}{P(X=7|p=0.5)P(p=0.5) + P(X=7|p \sim Unif[0.5,1])P(p \sim Unif[0.5,1])}$$
Straightforwardly, using $X \sim Bin(8,p)$:
$$P(X=7|p=0.5)P(p=0.5) = {8 \choose 7}0.5^70.5 \times 0.8$$
I am less sure of $P(X=7|p \sim Unif[0.5,1])P(p \sim Unif[0.5,1])$, if even this is the right expression. Given it's continuous, I thought it might be:
$$P(X=7|p \sim Unif[0.5,1])P(p \sim Unif[0.5,1]) = \int^1_{0.5}{P(x|p)f(p) dp}$$
where $P(x|p) = {8 \choose 7}p^7(1-p)$ and $f(p) = 2$ (being the pdf of $Unif[0.5,1]$). But this doesn't account for the probability of p being uniformly distributed, $P(p \sim Unif[0.5,1]) = 0.2$.
What is the correct way to think about this?
Many thanks
Steven