An unemployed worker who is searching for a job has a probability $p_0=0.2$ of finding it, while an employed worker who doesn't want to quit his job has a probability $p_1 = 0.9$ of keeping it. An idle worker (someone who quits or doesn't search for a job) will definitely be unemployed next period. Thus, the transition probabilities are
\begin{align}
q = \begin{bmatrix}1-p_0 &p_0\1-p_1&p_1\end{bmatrix},&\qquad\text{if active} \
= \begin{bmatrix}1 & 0\1 &0 \end{bmatrix},&\qquad\text{if iddle}
\end{align}

We simulate the model 10000 times for a time horizon $T=40$, starting with an unemployed worker ($i=0$) at the long-term wage rate mean $\bar{w}$. To be able to reproduce these results, we set the random seed at an arbitrary value of 945.