Conditional Expected value of the number of coin tosses until two heads are landed.

857 Views Asked by At

Question: We toss a coin until we get 2 consecutive heads, but the probability, $p$, of the coin landing heads is beta distributed with parameters $p \sim \beta(6, 8)$. What is the expected number of flips until two heads show consecutively?

So, previously I have done a very similar problem that is essentially the same problem except that the probability of the coin showing heads is simply $\frac{1}{2}$, not beta distributed. In this simple case, the way that we can find the expected number of flips until 2 consecutive heads is the following:

Let $X$ be the number of coin flips until 2 consecutive heads land. Let $H_{i}$ be the event of landing heads on the $i^{th}$ toss, and same for $T_{i}$ being tails. Then $E(X)$ may be conditioned on the first and second tosses.

$$ E(X) = E(X | H_1) P(H_1) + E(X|T_1)P(T_1)$$

by law of total expectation. Now, the probabilities in this equation are easy, both are $\frac{1}{2}$. Then, we can write $E(X | T_1) = 1 + E(X)$ because landing tails on the first toss is essentially like wasting that toss and starting over. Then,

$$ E(X | H_1) = E(X|H_1, H_2)P(H_2) + E(X|H_1, T_2)P(T_2) $$

where we then condition on the second toss. The probabilities are again the same, and we can write all of the conditional expectations in terms of $E(X)$, where $E(X|H_1, H_2) = 2$ and $E(X|H_1, T_2) = 2 + E(X)$. We can then solve for $E(X)$ plugging into the original equation.

However, in this case, we do not have that these probabilities are so simple, and rather it seems to me that we must condition $X$ on the random variable $P$ for the probability. My confusion and main concern for this is that I still intuitively think that we should still set the problem up and solve it in a very similar way to the simple case in that we need to condition $X$ on the first and second tosses. I am really confused on how to condition $X$ on both the probability and the tosses at the same time and how to express this in the forms of conditional expectations.

1

There are 1 best solutions below

2
On

For fixed $p\in(0,1)$ let $X_p$ the number of tosses needed to arrive at $2$ consecutive heads when the probability on heads is $p$.

Now find $f(p):=\mathbb E[X_p]$.

(Actually you have done that for special case $p=\frac12$ which gives me the impression that you can also do it for a fixed $p\in(0,1)$)

Now let $P$ be a random variable that has the beta-distribution you mentioned.

Then also $f(P)$ is a random variable and this fortunately with:$$\mathbb EX=\mathbb Ef(P)$$ where $X$ denotes the random variable prescribed in your question.


It is an application of the general rule:$$\mathbb EY=\mathbb E[\mathbb E[Y\mid Z]]$$

This with $Y:=X$ and $Z:=P$.

Another notation for $f(p)$ is $\mathbb E[X\mid P=p]$.