1. Modify the program ErgodicChain so that you can compute the basic quan- tities for the queueing example of Exercise 11.3.20. Interpret the mean recur- rence time for state 0.
2. Consider a random walk on a circle of circumference n. The walker takes one unit step clockwise with probability p and one unit counterclockwise with probability q = 1 - p. Modify the program ErgodicChain to allow you to input n and p and compute the basic quantities for this chain.
(a) For which values of n is this chain regular? ergodic?
(b) What is the limiting vector w?
(c) Find the mean first passage matrix for n = 5 and p = .5. Verify that mij = d(n - d), where d is the clockwise distance from i to j.