A house has 9 rooms as shown in the figure. A mouse is in room 3. A cat waits in room 7 and in room 9 there is a hole in the wall where the mouse lives. The mouse moves around the house moving through the doors at random. For example, from room 3, the mouse can only move to rooms 2 or 6 each with equal probability. From room 5, the mouse can move to rooms 2, 4, 6, or 8 each with equal probability. Starting in room 3, the mouse continues to move around the house until it enters room 7 or 9. The mouse stops when it reaches room 7 (killed by the cat) or reaches room 9 (safe at home).
(a) Draw a directed graph that represents the random walk Markov chain of the mouse’s movements.
(b) Exhibit the transition probability matrix, P.
(c) Which states (rooms) are transient and which are recurrent? Justify your answer.
(d) Write a program to estimate the long run probability of the mouse being in each room. Exhibit your estimates and interpret the results (for example, what is the probability the mouse arrives safely at home).