The following is taken from here:
You have a coin that when flipped ends up head with probability $p$ and ends up tail with probability $1−p$. (The value of p is unknown.)
Trying to estimate $p$, you flip the coin $14$ times. It ends up head $10$ times.
Then you have to decide on the following event: "In the next two tosses we will get two heads in a row."
What is the probability the event will happen?
In attempting to solve this via a bayesian approach, the author first derives a distribution for $p$, whose plot is below:
He then states that to find the probability of two heads, the following needs to be computed:
$$Pr\left(HH|\text{data}\right) = \int_0^1 Pr\left(HH|p\right) \cdot Pr\left(p|\text{data}\right) dp$$
I'm unclear on how the integrand was arrived at though.
I understand that you need to need to sum up $Pr(HH|p)$ across all $p$ from 0 to 1, but why do you multiply this by the other terms?
