TITLE: Expected value of sum of two dependent Binomial variables
QUESTION [5 upvotes]: Question: Assume we toss a coin in two trials. In the first trial we toss it n times. In the second trial we toss it as many as the number of tails observed in the first trial.
Calculate the expectation of total number of tails in both trails:
Solution: This is what I have tried but can't find any closed form for the answer when n is not given. I am not sure if I have taken the right approach:
$T_1$ = Number  of  tails in the 1st trial
$T_2$ =  Number of tails in the 2nd trial
T1 ~ Binomial(n,p)
T2 ~ Binomial(T1,p)
$E(T1 + T2) = 
E(T1) + E(T2) = \\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ n p+\sum_{i=0}^{n} E\left(T_{2} \mid T_{1}=i\right) P\left(T_{1}=i\right) =\\
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ n p+\sum_{i=0}^{n} i p \times\left(\begin{array}{l}n \\ i\end{array}\right) p^{i}(1-p)^{n-i}$
I couldn't find any closed form for the answer. Any advice on how to approach this?

REPLY [3 votes]: Let's consider an equivalent experiment. We have $n$ identical coins, numbered from $1$ to $n$. We toss each of the $n$ coins once; then each coin which came up tails is tossed one more time. Let $X_i$ be the number of times the $i^\text{th}$ coin comes up tails, and $X=\sum_{i=1}^nX_i$ the total number of tails obtained.
$$E(X)=\sum_{i=1}^nE(X_i)=\sum_{i=1}^n(p+p^2)=n(p+p^2)$$