Expected hitting time (source code)

= Expected hitting time

For a target set $A$, the expected hitting time $g(i)=\mathbb E_iT_A$ satisfies $g=0$ on $A$ and
$$
g(i)=1+\sum_jP_{ij}g(j)
$$
outside $A$, whenever the expectation is finite.