= Solution
Write $Z(u)$ for the <continuous-time Markov chain> and $\mathbb E_r$ for <expected value> conditional on $Z(0)=r$. The <occupation time of a continuous-time Markov chain> in state $s$ is the integral of its <indicator random variable>. By <Tonelli theorem>,
$$
\boxed{T_{rs}(t)=\mathbb E_r\!\left[\int_0^t\mathbf1\{Z(u)=s\}\,du\right]
=\int_0^t p_{rs}(u)\,du.}
$$
The interchange is valid because the integrand is nonnegative; indeed the random integral is bounded by $t$.
Back to article page