Probability of getting a success in a trial is p. All trials are mutually independent.
My approach :
Let $N_k$ denotes the number of trials needed to perform the event.
We define
$Y_i = 1$ ; if there is a success in the $i^{th}$ trial
$Y_i = 0$ ; Otherwise
Then, $X_k = \displaystyle \sum_{i = 1}^{N_k} Y_i $
Now, we will try to find conditional expectation of $X_k$ given $N_k$
$E[X_k|N_k=n] = E[ \displaystyle \sum_{i = 1}^{n} Y_i ] $
$\implies E[X_k|N_k=n] = \displaystyle \sum_{i = 1}^{n} E[Y_i] $
$\implies E[X_k|N_k=n] = \displaystyle \sum_{i = 1}^{n} p $
$\implies E[X_k|N_k=n] = np $
$\implies E[X_k]= E[N_k]p$
So, all we have to find is $E[N_k]$ . And let $E[N_k] = L_k$ .
$N_k = N_{k-1} + A_{k-1,k}$ where $A_{k-1,k}$ denotes the number of trials needed more to get k consecutive successes after one has got k-1 successes.
Then, $A_{k-1,k} = 1$ if the next trial after k-1 consecutive successes is a success
But if the next trial after k-1 consecutive successes is a failure, then $A_{k-1,k}$ will follow the same distribution as of $1 + N_k$.
$\therefore E[N_k] = E[N_{k-1}] + E[A_{k-1,k}]$
$\implies L_k = L_{k-1} + p + (1-p)E[1+N_k]$
And on simplifying we get,
$pL_k = L_{k-1} + 1$
And on solving the above recurrence relation we get,
$L_k = \frac{p^k - 1}{p^k(p - 1)}$
And, then we get the final answer $E[X_k] = \frac{p^k - 1}{p^{k-1}(p - 1)}$.
I have tried the same by forming a recurrence relation using $X_k$ which is also giving me the same answer. And my prof is saying that this method is correct but above explained method is wrong. My prof’s comment on why the above described method is wrong “$E[X_k|N_k]$ can’t be equal to $N_kp$ because there are restrictions.”
I understand the comment, but I am not able to digest the fact that if the starting step in the described method is wrong, then how come it is giving the right answer?