Independent trials, each of which is a success with probability p, are performed until there are k consecutive successes. What is the mean of the number of the necessary trials?
Let $N_k$ be the number of trials needed to get k successive successes.
While I am convinced that to answer this problem we should start by doing $$M_k = E[N_k]= E[E[N_k|N_{k-1}]]$$ like explained in another post on StackExchange(See Expectation by conditioning) I don't understand how to complete the solution. The suggested solution is $$\begin{align} M_k &= E[N_k]\ (line1 ) \\&= E[E[N_k|N_{k-1}]] \ (Line 2) \\&=E[p(N_{k-1}+1)+q[N_{k-1}+1+E[N_k]]] \ (line3) \\ &=E[N_{k-1}+1+qE[N_k]] \ (Line 4 ) \\ &=E[N_{k-1}]+1+qE[N_k] \ (Line 5 ) \\&= M_{k-1}+1+qM_{k} \ (Line 6 ) \\&=\frac{1}{p}+\frac{M_{k-1}}{p} \ (Line 7 ), M_0=0 \end{align}$$
What I don't understand is $(line3)$ especially $ q* [N_{k-1}+1+E[N_k]]$
Please someone could provide me an explanation ?
Thank you