Gary can be Cheerful $(1)$, So-so $(2)$, or glum $(3)$. The following transition matrix describes the Markov chain that records Gary's mood changes.
$$P=\begin{bmatrix}0.5 & 0.4 & 0.1\\0.3 & 0.4 & 0.3\\0.2 & 0.3 & 0.5\end{bmatrix}$$
With stationary distribution vector
$$ \pi = (0.33871,0.370968,0.290323)$$
If Gary is cheerful today, what is the expected amount of days until he is glum three days in a row?
This problem comes from Sheldon Ross' Intro to Probability Models, 10th edition, problem 51 of chapter 4. In chapter 4, Ross details how to obtain the expected amount of time after $X_0=r$ until a pattern $(i_1, ..., i_k)$ appears. The stated formula for a pattern with no overlaps is
$$ \mathbb {E}[N(i_1, ..., i_k)|X_0=r]=\mu(r,i_1)-\mu(i_k,i_1)+\frac {1}{\Pi_{i_1}T_{i_1,i_2}\cdots T_{i_{k-1},i_k}}$$
Where $\Pi$ is the stationary distribution vector, $T$ is the transition probability matrix for that chain, $N(i_1, ..., i_k)=\text{min}\{n \ge k : X_{n-k+1}=i_1,...,X_n = i_k\}$ and $\mu (x,i_1)$ is the mean number of transitions for the chain to enter state $i_1$ given it is in state $x$.
Ross also explains how to obtain an expression for a pattern that has overlaps, i.e. if for $j<k$ then $(i_{k-j+1},...,i_k)=(i_1,...,i_j)$. His strategy consists of breaking down the pattern into its overlapping parts and repeating until we can use the first formula.
However, for Gary's mood swings, this is not enough because the pattern I am looking for is the same everywhere, so that I cannot apply the first formula and I cannot break the pattern down. The idea I had was to compute, via conditioning
$$\mathbb{E}[N(x,3,3,3)|X_0=1] =\mathbb{E}[N(x,3,3,3)|X_0=1,x=1]\mathbb{P}(x=1)+\mathbb{E}[N(x,3,3,3)|X_0=1,x=2]\mathbb{P}(x=2)$$
Now, if the above is valid, then I have two non-overlapping patterns and I can apply the formula given in the book, but to calculate $\mathbb{P}(x)$ I would still have some trouble, although I think that $\mathbb{P}(x=i)=\pi_i$ is justified.
Main questions
- Is my approach correct? If not, how can I solve this problem?
- Is $\mathbb{P}(x=i)=\pi_i$ really justified? What does the vector $\pi$ really represent?