Expectation by conditioning Problem:
Independent trials, each of which is a success with probability $p$, are performed until there are $k$ consecutive successes. What is the mean number of necessary trials?
Start on solution.
Let $N_k$ denote the number of necessary trials to obtain $k$ consecutive successes, and let $M_k$ denote its mean. We will obtain a recursive equation for $M_k$ by conditioning on $N_{k−1}$, the number of trials needed for $k − 1$ consecutive successes. This yields
$$M_k = {\rm E}[N_k] = {\rm E}[{\rm E}[N_k|N_{k−1}]].$$
I do not understand that equation.
 A: Do you understand the left-hand equality?  $N_k$ is a random variable that describes the number of trials needed to obtain $k$ consecutive successes, so $M_k$ is by definition the expected value of $N_k$.  The right-hand inequality is more subtle, and is what I suspect you are having difficulty understanding.
What's going on is this:  suppose I am interested in $M_3$, so I want to know the mean number of trials needed to obtain the first triplet.  Well, to get a triplet, I first need to have observed a pair.  For simplicity, suppose my outcomes are $0$ and $1$ and I want to find consecutive $1$s.  Then if my trials look like this: $$\{1,0,1,1,0,1,1,1\},$$ then $N_3 = 8$ in this instance.  I want to condition on the pairs of ones I could have seen.  So if $N_2 = r$, what is the chance that the next trial results in another $1$, completing a triplet on the $(r+1)^{\rm th}$ trial?  This is $p$.  What is the chance the next trial is $0$?  $1-p$.  So $N_k \mid (N_{k-1} = r)$ is a random variable whose value is $r+1$ with probability $p$, and some other value with probability $1-p$.  But since $N_{k-1}$ is a random variable, in order to find the expected value ${\rm E}[N_k]$, we have to take the expectation of $N_k \mid (N_{k-1} = r)$ over all permissible values of $r$.
That's what the expression ${\rm E}[{\rm E}[N_k \mid N_{k-1}]]$ indicates:  The innermost ${\rm E}[\cdot]$ is an expectation with respect to the first random variable $N_k$ for a fixed/given $N_{k-1}$.  The outermost ${\rm E}[\cdot]$ is an expectation with respect to the $N_{k-1}$.
This raises the question of what that mysterious "some other value" is that I alluded to.  Well, if we failed to get a $1$ on the $(r+1)^{\rm th}$ trial, we have to start all over:  the chain is broken.  The value of $N_k \mid (N_{k-1} = r)$ is $N_k + {r+1}$ with probability $1-p$.  The rest of the details should follow.
