Homework 3 Markov Chain Random Walk
Homework 3 Markov Chain Random Walk
(a) Define the transition matrix P of a Markov chain modelling this process.
(b) Show that this Markov chain is ergodic but not regular.
(c) Explain why the limit
I + P + P2 + ··· + Pn
lim
n→∞ n+1
exists and compute it.
3 marks
2. Assume that for a student going to a three-year medical school, in each year we have a probability
q = 0.2 of flunking out, a probability r = 0.1 of having to repeat the year, and a probability
p = 0.7 of moving on to the next year (in the third year, moving on means graduating). This
process can be modelled by a Markov chain with states 1, 2, 3, G and F, where F stands for
flunking out, G for graduating, and 1, 2, and 3 represent the first, second and third years of
study, respectively.
3. An absent-minded professor has two umbrellas, used when commuting from home to work and
back. If it rains and an umbrella is available, the professor takes it. If an umbrella is not
available, the professor gets wet. If it does not rain the professor does not take the umbrella. It
rains on a given commute with probability p, independently for all days. What is the steady-
state probability that the professor will get wet on a given day? Will the process converge to
the steady-state? Explain / justify your answer.
2 marks
4. A mathematician travels between four coffee shops located as shown in Figure 1 below. Assume
she chooses among the paths departing from a coffee shop by treating each path as equally likely.
We can model the mathematician’s journey as a Markov chain. Take as a suitable state space
S = {1, 2, 3, 4} corresponding to the coffee shops as indicated in Figure 1.
(a) Write the transition matrix P for this Markov chain. Is this Markov chain regular, ergodic
or absorbing. Explain / justify your answer.
(b) Considering xTn = xTn−1 P = x0 P n , does the limit of xn , as n → ∞, exist for any x0 ? Does
the limit of P n , as n → ∞, exist? Explain / justify your answer. If yes determine the
matrix obtained in the limit.
3 marks
1
3
1 2
Find a stationary distribution for the stochastic matrix P . Is this Markov chain regular? Explain
/ justify your answer.
1 marks
6. A spider in a bath tub goes up with a probability of p = 0.51 and down with a probability 1 − p.
Denote by n ∈ N the position of the spider (height along the tub). Consider that the spider
starts at position n = n0 and escapes if n = s, for some n0 , s ∈ N, and drowns if n = 0.
Write down the relationship for the probability the spider escapes.
If n0 = 6 and s = 12 what is the probability the spider escapes?
Use Python to simulate the spider’s fate.
4 marks
7. (a) Write a Python code to simulate M steps of a random walk on the real line starting from
zero with probability of moving left or right equal to 1/2 and with ∆x = 0.1 and ∆t = 0.1.
(b) Consider different probabilities q = 1/3 for moving to the left and 1 − q = 2/3 for moving to
the right.
(c) Explain the difference between the two situations considered here.
5 marks