Suppose we flip a fair coin repeatedly until we have flipped four consecutive heads. What is the expected number of flips that are needed? The hint is given is as follows: Consider a Markov chain with state space {0,1,...4}.
Can anybody give an idea of where to start? Thanks! As I make progress I will add what my solution becomes. Otherwise any help would be appreciated.
Here is my solution!
$P=\begin{bmatrix} 1/2 &1/2 &0 &0 &0 \\ 1/2&0 &1/2 &0 &0 \\ 1/2&0 &0 &1/2 &0 \\ 1/2&0 &0 &0 &1/2 \\ 0&0 &0 &0 &1 \end{bmatrix}$
We will then treat state 4 like a recurrent state and solve for the matrix of the form
$\begin{bmatrix} I & & &0 \\ & & & \\ & & & \\ S& & & Q \end{bmatrix}$ Note: Sorry I don't know how to partition the matrix into four equal parts.
We then solve for the matrix $M=(I-Q)^{-1}$. So we find that $M=\begin{bmatrix} 16 &8 &4 &2 \\ 14&8 &4 &2 \\ 12& 6 & 4 &2 \\ 8&4 &2 &2 \end{bmatrix}$
We then take the matrix M and add up the first row 16+8+4+2=30.