Skip to content
The Lumenary

Each worksheet prints cleanly on A4 or Letter. Answer keys are on a separate page.

The Lumenary · Advanced undergraduate

Markov chains

Name: ______________________

Date: ______________________

You will learn to

  • Model processes with transition matrices and compute nn-step transition probabilities and distributions λPn\lambda P^n
  • Compute hitting probabilities and expected hitting times by first-step analysis, including gambler's ruin
  • Classify states into communicating classes, as recurrent or transient, and by period, and prove the recurrence criterion ∑npii(n)=∞\sum_n p_{ii}^{(n)} = \infty
  • Prove that an irreducible finite chain has a unique stationary distribution, and use detailed balance to find it
  • Prove convergence to equilibrium for irreducible aperiodic finite chains, with a geometric rate
  • State Pólya's theorem and prove recurrence of simple random walk in dimensions one and two
  1. 1.

    A Markov chain X0,X1,…X_0, X_1, \dots is often called memoryless. Which statement captures the Markov property?

    • A.Xn+1X_{n+1} is independent of X0,…,XnX_0, \dots, X_n.
    • B.Given XnX_n, the next state Xn+1X_{n+1} is conditionally independent of X0,…,Xn−1X_0, \dots, X_{n-1}.
    • C.From every state, all next states are equally likely.
    • D.The distribution of XnX_n does not change with nn.
  2. 2.

    A weather chain on (dry, cloudy, rainy) has transition matrix P=(0.60.30.10.30.40.30.20.30.5)P = \begin{pmatrix} 0.6 & 0.3 & 0.1 \\ 0.3 & 0.4 & 0.3 \\ 0.2 & 0.3 & 0.5 \end{pmatrix}. Today is dry. What is the probability, in percent, that the day after tomorrow is dry?

  3. 3.

    Find the stationary distribution of P=(0.90.10.50.5)P = \begin{pmatrix} 0.9 & 0.1 \\ 0.5 & 0.5 \end{pmatrix}.

    • A.(56,16)\big(\tfrac56, \tfrac16\big)
    • B.(16,56)\big(\tfrac16, \tfrac56\big)
    • C.(12,12)\big(\tfrac12, \tfrac12\big)
    • D.(0.9,0.5)(0.9, 0.5)
  4. 4.

    In the fair gambler's ruin game you start with 33 coins and play one-coin fair bets until you have 00 or 1010 coins. What is the expected number of bets?

  5. 5.

    A chain on {1,2,3,4}\{1, 2, 3, 4\} has p12=1p_{12} = 1; p21=p23=12p_{21} = p_{23} = \tfrac12; p33=p34=12p_{33} = p_{34} = \tfrac12; p43=1p_{43} = 1. Which statements are true? (Choose all that apply.)

    • A.{3,4}\{3, 4\} is a closed class, and its states are recurrent.
    • B.States 11 and 22 are transient.
    • C.State 11 has period 22.
    • D.The chain is irreducible.
    • E.The stationary distribution gives positive probability to state 11.
  6. 6.

    The lesson proves uniqueness of the stationary distribution by showing that every harmonic function (Ph=hPh = h) is constant. Where exactly is irreducibility used?

    • A.To show that hh attains a maximum.
    • B.To pass from "hj=Mh_j = M for every jj reachable in one step from a maximiser" to "hj=Mh_j = M for every state jj".
    • C.To show that hi=∑jpijhjh_i = \sum_j p_{ij}h_j is an average of the values hjh_j.
    • D.To show that P−IP - I and its transpose have the same rank.
  7. 7.

    A walker moves on the 66 vertices of a hexagon, stepping to each of the two neighbouring vertices with probability 12\tfrac12. What is the period of the chain?

  8. 8.

    Which statement about simple random walk is correct?

    • A.On Z3\Z^3 the walk returns to the origin with probability 11, but the expected return time is infinite.
    • B.On Z2\Z^2 the expected number of returns to the origin is infinite, so the walk returns with probability 11.
    • C.On Z\Z the walk has a stationary distribution, because it is recurrent.
    • D.Computing ∑n≤106P(S2n=0)\sum_{n \le 10^6} P(S_{2n} = 0) in Z2\Z^2 proves the series diverges.
  9. 9.

    Which Lean statement formalises "detailed balance implies stationarity"? (π ᵥ* P is the row vector πP\pi P.)

    • A.(hrow : ∀ i, ∑ j, P i j = 1) (hdb : ∀ i j, π i * P i j = π j * P j i) : π ᵥ* P = π
    • B.(hrow : ∀ i, ∑ j, P i j = 1) (hst : π ᵥ* P = π) : ∀ i j, π i * P i j = π j * P j i
    • C.(hdb : ∀ i j, π i * P i j = π j * P j i) : π ᵥ* P = π
    • D.(hrow : ∀ i, ∑ j, P i j = 1) (hdb : ∀ i j, π i * P i j = π j * P j i) : P *ᵥ π = π
  10. 10.

    Write step(mu, P) returning the row vector μP\mu P (lists of Fractions), and power_iterate(mu, P, n) applying step nn times. Then write is_stationary(pi, P). The tests use the two-state chain with a=14a = \tfrac14, b=12b = \tfrac12 and check that μPn\mu P^n approaches π=(23,13)\pi = (\tfrac23, \tfrac13) at the rate ∣1−a−b∣n=4−n|1 - a - b|^n = 4^{-n}.

    Computational — Practice

Code: Apache-2.0 · Content: CC BY-SA 4.0