Coin Toss Probabilities: Integrating over all $p$ vs. using $E(p)$ Toss a coin with unknown $P(H) := p$ a total of eight times.  What's the probability of 5H and 3T?  For a given $p$, of course we get
$$
P(5H, 3T) = {8 \choose 5} p^5 (1-p)^3.
$$
Now, assume $p$ has the uniform distribution on $(0,1)$ so that $E(p) = \frac{1}{2}$.  Using this expected value, I get
$$
P(5H, 3T) = {8 \choose 5} \left(\frac{1}{2}\right)^8 = \frac{7}{32} \approx 0.22
$$
On the other hand, using the law of total probability to integrate over all values of $p$ I get (using the pdf $f(p) = 1$ on $(0,1)$)
$$
P(5H, 3T) = \int_0^1 f(p) P(5H, 3T \mid p) dp = \int_0^1 {8 \choose 5} p^5 (1-p)^3 dp = {8 \choose 5} \frac{\Gamma(6) \Gamma(4)}{\Gamma(10)} = \frac{1}{9} \approx 0.11.
$$
If integration is supposed to be an "average over all values," why is the integral result so different than using the expected value?
Even more strange, the law of total probability gives the same probability regardless of the outcomes!  Indeed,
$$
P(iH, jT) = \int_0^1 {8 \choose i} p^i (1-p)^j dp = {8 \choose i}\frac{\Gamma(i+1) \Gamma(j+1)}{\Gamma(10)} = \frac{8!}{i!j!}\frac{i!j!}{9!} = \frac{1}{9}.
$$
The calculations seem valid, but what's the intuition here?
 A: Interesting result, isn't it?   Look at what it is saying.
The result is that: $\mathsf E(P(X=k\mid p)) = \frac 1 {n+1}$ for $k\in\{0,1,\ldots n\}, p\sim\mathcal U(0;1), (X\mid p)\sim\mathcal{Bin}(n, p)$
That is, that: $X\sim\mathcal U\{0;n\}$

When we have a discrete-valued random variable that is binomially distributed conditional on a success rate that is itself continuous uniform distributed, then the marginal distribution of the random variable is discretely uniform.

To get some intuition of why this is so, look at the shape of the conditional binomial distribution as the success rate ($p$) varies from $0$ to $1$.   It's always a bell shaped curve clustered around the mean, and the mean is proportional to the success rate.   So if the success rate is continuous uniformly distributed, its not unexpected that the marginal probability will be a discrete uniform distribution.

Why is this distribution so different from that of a fair coin toss?    Well, clearly we don't model a fair coin as having a uniformly distributed success rate.   We model it as having a deterministic success rate; the constant $\tfrac 1 2$.
Or as John Barber puts it: "You get different results because the average of a function is different than the function of the average."   That is: $\mathsf E({f}(X))\not\equiv{f}(\mathsf E(X))$ 
$$\mathsf E(\mathsf P(X=k;p)) \not\equiv \mathsf P(X=k;\mathsf E(p))$$
