I'm going through Bertsekas' and Tsitsiklis' "Introduction to Probability" and I'm stuck understanding a problem. This is not homework, and I have the solution. But I don't understand it, and I wonder if I am missing something or if there is an error.

A coin minting machine produces coins whose probability of heads is a random variable with density $f_P(p) = pe^p$ for $0 < p < 1$. Given that the first toss resulted in heads, find the conditional probability that of heads on the next one.

I am summarizing the solution a bit. Let $A$ be the event that the first flip is heads. Let $B$ be the event that the second flip is heads.

We use the continuous law of total probability to calculate $Pr(A) = e - 2$.

Using Bayes theorem:

\begin{align} f_{P|A}(p) &= \frac{P(A|P=p)f_P(p)}{Pr(A)} \\ &= \frac{p^2 e^p}{e - 2} \end{align}

Finally, we use continuous total probability to compute

\begin{align} Pr(B|A) &= \int_0^1 Pr(B|P=p, A) f_{P|A}(p) \mathrm{d}p \\ &= \int_0^1 Pr(B|P=p) f_{P|A}(p) \mathrm{d}p \\ &= \frac{1}{e-2} \int_0^1 p^3 e^p \mathrm{d}p \end{align}

I am confused about these integrals. In particular, it seems to me that either the first or second ones are wrong. If the first one is right, how are we justified in dropping the dependence on $A$ in the second integral?

• There are two $P$-s here. One as a probability measure and one as a random variable. Confusing. You could change the firs in $Pr$. Aug 14, 2014 at 7:48
• It's tedious to type, but $\operatorname P[\cdot]$ is the best-looking notation for probability. Aug 14, 2014 at 8:10

The first integral is basically the Law of Total Probability, applied to continuous RV.

If you were talking about discrete partitions $\{C_k\}$, you would have the recognisable form: $$\Pr(B) = \sum_{k} \Pr(B\mid C_k)\Pr(C_k)$$ Which when conditioned over event A the LoTP would be: $$\Pr(B\mid A) = \sum_{k} \Pr(B\mid A, C_k)\Pr(C_k\mid A)$$ And the analogous form for a continuous case is: $$\Pr(B\mid A) = \int_{\bf C} \Pr(B\mid A, C=x)f_{C\mid A}(x)\operatorname{d}x$$ And specifically: $$\Pr(B\mid A) = \int_0^1 \Pr(B\mid A, P=p)f_{P\mid A}(p)\operatorname{d}p$$

The next step is simply that events A and B refer to different tosses of the same coin; so they are independent.

$$\Pr(B\mid A, P=p) = \Pr(B\mid P=p)$$

$$Pr\left(B\mid P=p\wedge A\right)=\frac{Pr\left(B\wedge P=p\wedge A\right)}{Pr\left(P=p\wedge A\right)}=\frac{Pr\left(B\wedge A\mid P=p\right)Pr\left(P=p\right)}{Pr\left(P=p\wedge A\right)}=\frac{Pr\left(B\mid P=p\right)Pr\left(A\mid P=p\right)Pr\left(P=p\right)}{Pr\left(P=p\wedge A\right)}=Pr( B\mid P=p)$$

The third equation by independence.

The existence of a more simple solution would not surprise me.