# How do I approach this Bayesian question?

I am auditing a Bayesian Statistics course and I am facing problem in understanding the following question.

Suppose you are given a coin and told that the coin is either biased towards heads (p = 0.6) or biased towards tails (p = 0.4). Since you have no prior knowledge about the bias of the coin, you place a prior probability of 0.5 on the outcome that the coin is biased towards heads. You flip the coin twice and it comes up tails both times. What is the posterior probability that your next two flips will be heads?

My approach is as follows:

Assuming we have two hypothesis,

$${H_H}$$ = Hypothesis that Heads are biased $$\Rightarrow p(0.6)$$

$${H_T}$$ = Hypothesis that Tails are biased $$\Rightarrow p(0.4)$$

My first doubt is that should p($$H_H$$) +p($$H_T$$) = 1 ?

So we first calculate the probability of getting two tails in a row:

That should be : $${2 \choose 0} (0.6)^0 (0.4)^2 = 0.16$$

Now we have to calculate our posterior that will act as our prior for next round and tell us which hypothesis is more likely on basis of our outcomes.

$$P(H_T | Data) = \frac{0.16 \times 0.5}{P(Data)}$$

What should be in the denominator here ? How do I proceed from here?

I am a software developer with limited Statistics knowledge so please pardon the mistakes in my explanation.

We are asked to find $$P(HH|\text{Data})$$, which is (via Total Probability Law): \begin{align}P(HH|\text{Data})&=P(HH|\text{Data},H_T)P(H_T|\text{Data})+P(HH|\text{Data},H_H)P(H_H|\text{Data})\\&=P(HH|H_T)P(H_T|\text{Data})+P(HH|H_H)P(H_H|\text{Data})\end{align}
We directly have (when we know the bias): $$P(HH|H_T)=0.4^2, P(HH|H_H)=0.6^2$$
And, you'll find $$P(H_H|\text{Data}),P(H_T|\text{Data})$$ via Bayes Rule as you've suggested. The denominator is calculated as follows: $$P(\text{Data})=P(\text{Data}|H_H)P(H_H)+P(\text{Data}|H_T)P(H_T)$$
For your doubt about bias probabilities, $$p(H_H), p(H_T)$$ doesn't need to add up to $$1$$.