I pick a random number between 0 and 1. (My pick is uniformly distributed.) This number determines how weighted a coin is towards heads. If it's 1, there's a 100% chance that the coin will land on heads. If it's a 0, there's a 0% chance that the coin will land on heads. If it's 0.75, there's a 75% chance the coin will land on heads.
You don't know what number I picked.
I flip the coin, and it lands on heads.
What's the probability that the coin was weighted towards heads?
(Another way of phrasing this is: given that the coin landed heads, what's the probability that I picked a number greater than 0.5?)
What I've done so far:
Let $W$ (W for "Win") be a discrete indicator variable that is 1 if the coin lands heads and 0 if the coin lands tails, and let $T \sim Unif(0, 1)$ ("T" for "True probability") be a continuous random variable that represents the number that I pick.
We want to know $P(T > 0.5 \mid W=1)$. We're also given that $P(W=1 \mid T=t) = t$.
So, using Bayes' Theorem we have
$$P(T > 0.5 \mid W=1) = \frac{P(W=1 \mid T > 0.5) * P(T > 0.5)}{P(W=1)}$$.
We know $P(T > 0.5) = 0.5$ because $T \sim Unif(0, 1)$. We also know that $P(W=1) = 0.5$ due to symmetry.
So this reduces the problem down to
$$P(T > 0.5 \mid W=1) = P(W=1 \mid T > 0.5)$$.
And this is where I'm stuck.
I really want to integrate as follows, but I'm not sure if this is valid or what rule would allow me to do this.
$$ \begin{equation} \begin{split} P(W=1 \mid T > {t^*}) &= \int_{t^*}^1{P(W=1 \mid T=t)}dt \\ &= \int_{t^*}^1{t}\,dt \; \text{(by the definition of $W$)} \\ &= \frac{1-{t^*}^2}{2} \; \text{(via integration)}\\ \end{split} \end{equation} $$
But this doesn't feel quite right. I think there should be a scaling factor in there, but I'm not sure.
If we continue with this, we get the solution
$$P(T > 0.5 \mid W=1) = P(W=1 \mid T > 0.5) = \frac{1-{0.5}^2}{2} = 0.375$$.
This strikes me as intuitively wrong. It seems like it should be more likely than not that the coin is weighted towards heads, given that it landed on heads.
So I'm not quite sure how to solve this.