Question: What is the probability of flipping a head on a coin where the coin's probability of flipping a head is drawn uniformly from $[0,1]$. 

I think this question is easy, however I am getting a result that makes no sense. Please don't directly give me the answer. I can look that up in a book. 

Let $H$ be the binary event that the a head is flipped. Let $Q$ be Uniform($0,1$). 

**Informal attempt:** Firstly, it's easy to see that given that we know $Q=q$, the probability of flipping heads is simply $1/q$. Since the distribution of $Q$ is uniform, we just need the average value of the function $1/q$. In particular, the probability must be $\frac{1}{1-0} \int\_0^1 \frac{1}{q} \, dq$, which does not converge!

**Formal attempt:** We wish to compute $P(H= \text{True})$. By the total law of probability, we have:
$$P(H=\text{True}) = \int\_0^1 P(H=\text{True}\mid Q=q)f\_Q(q) \, dq = \int\_0^1 \frac{1}{q} (1) \,dq$$ Again, this does not converge!? What am I doing wrong? I have a strong feeling my mistake lies in the fact that I am mixing continuous and discrete distributions. That is, I am conditioning on an event that actually cannot exist, i.e. $P(Q=q)=0$.

Answer: 
I believe the issue is that you are using $1/q$ when you should be using $q$ for the probability. If $q$ is what you get by drawing from $0$ to $1$, then it is already the probability and you can simply integrate over $q$ from $0$ to $1$.
$$P(H = \text{true}\mid Q =q ) = q$$

$$f\_Q(q) = 1$$

Hence you are suppose to evaluate $$\int\_0^1 q \,dq$$