I found different answers for a problem I was trying to calculate. I will write it down, then write my solution and the other I found.
Two players toss coins simultaneously until they have the first matching (meaning: both have heads or both have tails). Player 1 wins if the result is (Heads, Heads) for any throw, and player 2 wins if the result is (Tails, Tails) for any throw.
While the coin for the first player is "unbiased" ($p_{Heads} = 1/2$), the second player's coin is biased, with probability of heads being $p$, $0<p<1$. Let $X$ be the number of throws until player 1 wins. Find $E(X)$.
Now, the probability of player 1 winning in the n-th throw is $ P(X=n) = \frac{p}{2^n}$ if $n>0$. From it, we have:
$$ E(X) = \sum_{n=1}^{\infty} \frac{np}{2^n} = 2p $$
A friend of mine evaluated first $$P(X>k) = \sum_{j=k}^{\infty}\frac{p}{2^k} = 2^{1-k} p $$
It follows:
$$ E(X) = \sum_{k=0}^{\infty} P(X>k)= 1 + \sum_{k=1}^{\infty} P(X>k) = 1+2p$$ which is different from my solution.
Where's the mistake? Because I understand that both methods are valid.
Thank you!
First, there is a "typo" mistake, when computing $P(X>k)$, then $j$ should start from $k+1$, $$P(X>k)=\sum_{j=k+1}^\infty\frac{p}{2^j}=2^{-k}p.$$ But this is not the most important, the most important thing here is the assumption that $P(X>0)=1$, which is not true. According to your analysis, $P(X>0)=p$. If you fix that, then it works out $$E(X)=\sum_{k=0}^\infty P(X>k)=\sum_{k=0}^\infty 2^{-k}p=2p$$