Markov process, compute how much time spent in each state in average before absorption. This problem has three states for a person, which are either employed, unemployed or early retirement. The probability that a working person goes unemployed is 0.2 (ie with intensity 0.2 per year). The probability
that an unemployed gets a job is 4 per year, and the probability that an unemployed retires early is 0.5 per year. A working person never retires directly and an retired person statys retired forever.
A person starts with a job and makes 280 00 dollars each year he works, and 224 00 dollars each year he is unemployed and no money when he is retired, what is the expected amount of money in total that this person will make?
Solution:
Intensity matrix \begin{equation} Q = \begin{bmatrix}-0.2 & 0.2 & 0 \\ 4 & -4.5 & 0.5 \\ 0 & 0 & 0\end{bmatrix} \end{equation}
We get the sub matrix \begin{equation} Q_0 = \begin{bmatrix}-0.2 & 0.2\\ 4 & -4.5\end{bmatrix} \end{equation}
And for the average absorption time we have \begin{equation} M = -Q_0^{-1} = \begin{bmatrix} 45 & 2\\ 4 & 2\end{bmatrix}\end{equation}.
I don't know what to do next. I know that if I sum up the first row, I will end up with the average time the person spends before retiring if the person starts with a job, but I dont know how much of that time is spent working or not.
 A: This problem took longer than I expected and I'm a bit too tired to finish it tonight. But perhaps this partial solution will give you some hints:
We have that $\{X(t):t\geqslant0\}$ is a continuous-time Markov chain on state space $\{w,u,r\}$ with intensity matrix $Q$. Let $M(t)$ be the amount of money that the person is making at time $t$ and $R$ the time that they retire. Then $M(t)=0$ for $t\geqslant r$ and for $0\leqslant t<R$,
\begin{align}M(t) &= 28000\cdot\mathsf 1_{\{X(t)=w\}} + 22400\cdot\mathsf 1_{\{X(t)=u\}}\\
&=5600(5\cdot \mathsf 1_{\{X(t)=w\}} + 4\cdot\mathsf 1_{\{X(t)=u\}})
\end{align} 
and since $X(t)\in\{w,u\}$ on $[0,R)$, it follows that $$M(t) =5600\left(4t +\mathsf 1_{\{X(t)=w\}}\right). $$
Let $N(t)$ be the total amount of money earned up to time $t$, then $$N(t) = \int_0^{t\wedge R} M(s)\ \mathsf ds $$
and
\begin{align}
\mathbb E[N(t)] &= \mathbb E\left[\int_0^{t\wedge R} M(s)\ \mathsf ds\right]\\
&= \mathbb E\left[\int_0^t M(s)\ \mathsf ds\right]\mathbb P(R>t) + \mathbb E\left[\int_0^R M(s)\ \mathsf ds\right]\mathbb P(R<t).
\end{align}
For $t<R$, we have
\begin{align}
\mathbb E[N(t)] &= 5600\int_0^t\left(4s + \mathbb E[\mathsf 1_{\{X(s)=w\}}) \right)\ \mathsf dt\\
&= 5600\left(4t + \int_0^t \mathbb P(X(s)=w)\ \mathsf ds \right).
\end{align}
Conditioned on $t<R$ we have $$\mathbb P(X(s)=w)+\mathbb P(X(s)=w)=1 \tag 1$$ 
and from the balance equations,
$$\frac15\mathbb P(X(s)=u) = 4\mathbb P(X(s)=w). \tag 2$$
Solving $(1)$ and $(2)$ yields
$$\mathbb P(X(s)=w)=\frac{20}{21}, \ \mathbb P(X(s)=u) = \frac1{21}. $$
Hence $$\mathbb E[N(t)] = 5600\left(4t + \int_0^t \frac{20}{21}\ \mathsf ds \right) = 5600\left(4+\frac{20}{21}\right)t = \frac{83200}3 t. $$
Now, the embedded DTMC $\{X_n:n=0,1,2,\ldots\}$ where $X_{n+1}$ is the $n^{\mathrm{th}}$ transition, has initial distribution $X_0=w$ a.s. and transition matrix 
$$P=\begin{bmatrix} 0 & 1 & 0\\ \frac{20}{21} & 0 & \frac1{21}\\ 0&0&1\end{bmatrix}. $$
Let $\tau = \inf\{n:X_n = r\}$, then 
\begin{align}
\mathbb E[\tau] &= 1 + \mathbb P(X_2=r\mid X_1=u) + \mathbb P(X_2=w\mid X_1=u)\mathbb E[\tau]\\
\mathbb E[\tau] &= 1 + \frac1{21} + \frac{20}{21}\mathbb E[\tau],
\end{align}
so that $\mathbb E[\tau] = 22$. By a similar argument, we have $$\mathbb P(\tau = 3n-1) = \frac1{21}\left(\frac{20}{21}\right)^{n-1}, \ n=1,2,\ldots $$
Now, $$\{\tau = 3n-1\}=\{T_{3n-1}\leqslant R<T_{3n}\}$$
where $T_n$ are the jump times, so.. (to be continued)
