# How can I calculate Posterior Distribution, analytically with given information?

The image below shows that the posterior distribution is as follows with given information:

I wonder how the posterior has been calculated, analytically.

• You should explain why you cannot compute $p(\theta|x)$ from $p(\theta)$ and $p(x|\theta)$. May 13 at 6:57
• I am new to Bayesain Statistics and trying to understand how the above question is derived from the given information. May 13 at 7:07
• You should at least know how to move from the pair prior x likelihood to the posterior May 13 at 7:15
• I gave it a go and solved the question. When I uploaded the question, I didn't have a clue how to calculate it but now I can. Thank you for your comment. May 13 at 7:17

For $$x=1$$
$$\dfrac{p(\theta)p(x=1 | \theta)}{p(\theta_1)p(x=1 | \theta) + p(\theta_2)p(x=0 | \theta_2)} = \dfrac{p(0)p(x=1 | 0)}{p(0)p(x=1|0)+p(1)p(x=1|1)} = \dfrac{0.1665}{0.417} = 0.399280576 \approx 0.4$$
So, when $$x=0$$, the probability of $$x=0$$ is $$0.6$$
• The use of slightly incorrect decimal approximations, written out in excessive precision, makes this calculation somewhat confusing: the answer $3/5$ is exact, not approximate.