Posterior probability conditional on a set of events. I want to learn the probability $p$ that a coin heads conditional on abstract trial results. 
If conditional on a certain sequence of trials with $a$ head and $b$ tails the conditional expectation would be $\dfrac{\int_0^1p^{a+1}(1-p)^bf(p)\,dp}{\int_0^1p^a(1-p)^bf(p)\,dp}$ where $f(p)$ is the prior. 
In addition, if given the event that you have $N$ trials with more heads than tails, you do the similar computations as above, just count each possible states by the number of paths that lead to that state(for instance if $N=3$, there are $2$ leading to 2 heads and 1 tail and one path of 3 heads).
Now I'm wondering if there's no information about the total trail numbers $N$, is it still feasible to update the probability like above? I think the tricky thing is that the legitimate events are not independent, i.e., the states 2 successes with 1 failure, and 3 successes with 2 failure both satisfy the statement of "more heads than tails", yet the previous can lead to the latter. Should I just adjust the weight of each states by deleting the path that contains other states or this just cannot be done?
Thank you!
 A: Suppose $\wp$ is the limiting proportion of heads, and it has a probability distribution given by
$$
\Pr(\wp\in A) = \int_A f(p)\,dp \text{ for every measurable set } A\subseteq [0,1].
$$
You seem to be asking for the conditional expected value
$$
\operatorname{E}(\wp\mid \text{more heads than tails in the $N$ trials observed so far}),
$$
which is the same as the conditional probability
$$
\Pr(\text{the next trial yields a “head''} \mid \text{more heads than tails in the $N$ trials observed so far}).
$$
The likelihood function is
\begin{align}
L(p) & = \Pr( \text{at least $\lfloor N/2\rfloor$ heads in $N$ trials} \mid \wp = p) \\[10pt]
& = \sum_{k>\lfloor N/2\rfloor} \binom N k p^k (1-p)^{N-k}.
\end{align}
For every measurable set $A\subseteq[0,1]$ we then have
\begin{align}
\Pr( \wp \in A \mid \text{data}) & = c\cdot \int_A \sum_{k>\lfloor N/2\rfloor} \binom N k p^k (1-p)^{N-k} f(p) \, dp \\[10pt]
\text{where } \frac 1 c & = \int_{[0,1]} \sum_{k>\lfloor N/2\rfloor} \binom N k p^k (1-p)^{N-k} f(p) \, dp \\[10pt]
\text{and } & \text{“data'' means more heads than tails in the first $N$ trials.} \\[10pt]
\text{So we have:} \\
\Pr(\wp \in A \mid \text{data}) & = \frac{\int_A \sum_{k>\lfloor N/2\rfloor} \binom N k p^k (1-p)^{N-k} f(p) \, dp}{\int_{[0,1]} \sum_{k>\lfloor N/2\rfloor} \binom N k p^k (1-p)^{N-k} f(p) \, dp}.
\end{align}
Whether this admits any neat closed form would have to depend on what sort of functions $f$ is.
