I have an exercise, which I think my solution is right but it doesn't match the given answer.
We start by flipping $N$ fair coins. Later, we take all the coins that showed $H$ and flip them again. Later, we do the same, and we go on until no coin show $H$. Let Y be the total number of times a coin showed $H$. The question is about $E(Y|N=n)$.
My attempt was: Let $X_i$ - the number of flips that the $i$ coin shows $H$. Then $E(X_i)=\frac{1}{2}$
$E(Y|N=n)=E(\sum_{i=1}^{N} X_i | N=n)=E(\sum_{i=1}^{n} X_i) =\sum_{i=1}^{n}E(X_i)=2n$
I can't find a flaw in my solution, though is "right" answer is n.