I am going through Rabiner 1989 and he writes that the discrete probability density function of duration $d$ in state $i$ (that is, staying in a state for duration $d$, conditioned on starting in that state) is $$p_i(d) = {a_{ii}}^{d-1}(1-a_{ii})$$
($a_{ii}$ is the state transition probability from state $i$ to state $i$ - that is, staying in the same state).
He then continues to say that the expected durations in a state, conditioned on starting in that state, is $$\overline d_i = \sum_{i=1}^\infty d p_i(d) = \frac{1}{1-a_{ii}}$$
Where does the coefficient $d$ (in $\sum_{i=1}^\infty d p_i(d)$) come from?