Regular Markov Chains

A regular Markov chain is a Markov chain whose transition matrix P has some power with all positive entries. In a regular Markov chain, the state vector settles to one steady-state vector S, whatever the starting state. You find S by solving SP = S with entries that add to 1.

Before this lesson: Markov Chains, Substitution Method for Systems of Equations and Systems of Equations in Three Variables

The idea

In the coffee-shop chain from Markov chains, 80% of Brew customers return each week and 30% of Daily customers switch to Brew. Start with everyone at Brew, or everyone at Daily, and multiply by P again and again. Both runs drift toward 60% Brew and 40% Daily.

Line graph of the share of customers at Brew after n weeks, for n from 0 to 8. Starting at Brew, the share goes 1, 0.8, 0.7, 0.65, 0.625 and keeps falling toward 0.6. Starting at Daily, the share goes 0, 0.3, 0.45, 0.525, 0.5625 and keeps rising toward 0.6. A dashed horizontal line marks 0.6.
Whatever the starting state, the share at Brew settles at the steady-state value 0.6.

At 60% and 40%, one more step changes nothing: the customers who leave Brew are balanced by the ones who arrive. That balance point is the steady state. A regular chain always reaches it in the long run.

Steady-state vector of a regular Markov chain

A transition matrix P is regular if some power P^k has only positive entries (no zeros). Then:

  • There is exactly one steady-state vector S (also called the stationary distribution): a row vector with nonnegative entries that add to 1 and SP = S.
  • For any starting vector X_0, the vectors X_0 P^n approach S as n grows.
  • Every row of P^n approaches S.
SP = S \qquad s_1 + s_2 + \cdots + s_n = 1
  1. Write S with unknown entries, such as S = \begin{bmatrix} x & y \end{bmatrix}.
  2. Multiply S by each column of P and set the result equal to the matching entry of S.
  3. Replace one of these equations with x + y + ⋯ = 1 (one column equation is always redundant).
  4. Solve the system and check that the entries are nonnegative and add to 1.

Regular Markov chain examples

Example 1: Testing whether a chain is regular

Decide whether each matrix is regular: (a) P = \begin{bmatrix} 0 & 1 \\ 0.4 & 0.6 \end{bmatrix} and (b) Q = \begin{bmatrix} 1 & 0 \\ 0.3 & 0.7 \end{bmatrix}.

(a)

p^{(2)}_{11} = 0(0) + 1(0.4) = 0.4

Row 1 of P times column 1 (see matrix multiplication).

p^{(2)}_{12} = 0(1) + 1(0.6) = 0.6

Row 1 times column 2.

p^{(2)}_{21} = 0.4(0) + 0.6(0.4) = 0.24

Row 2 times column 1.

p^{(2)}_{22} = 0.4(1) + 0.6(0.6) = 0.76

Row 2 times column 2.

P^2 = \begin{bmatrix} 0.4 & 0.6 \\ 0.24 & 0.76 \end{bmatrix}

Every entry is positive, so P is regular.

(b)

q^{(2)}_{11} = 1(1) + 0(0.3) = 1,\ q^{(2)}_{12} = 1(0) + 0(0.7) = 0

Row 1 of Q^2 is still (1, 0).

\text{row 1 of } Q^k = \begin{bmatrix} 1 & 0 \end{bmatrix} \text{ for every } k

State 1 always returns to state 1, so the 0 never fills in.

Answer: (a) P is regular, even though P itself has a zero. (b) Q is not regular. Its state 1 is absorbing: once the chain enters it, it never leaves.

Example 2: Steady state of a two-state chain

Find the steady-state vector for the coffee-shop chain P = \begin{bmatrix} 0.8 & 0.2 \\ 0.3 & 0.7 \end{bmatrix}.

S = \begin{bmatrix} x & y \end{bmatrix}

Name the unknown shares of Brew and Daily.

0.8x + 0.3y = x

S times column 1 must equal x.

0.3y = 0.2x

Subtract 0.8x from both sides.

x = 1.5y

Divide both sides by 0.2.

x + y = 1

The entries of S add to 1.

1.5y + y = 1

Substitute x = 1.5y (see substitution method).

2.5y = 1

Combine like terms.

y = 0.4

Divide both sides by 2.5.

x = 1.5(0.4) = 0.6

Substitute back into x = 1.5y.

0.2(0.6) + 0.7(0.4) = 0.12 + 0.28 = 0.4

Check with column 2: the result equals y.

Answer: S = \begin{bmatrix} 0.6 & 0.4 \end{bmatrix}. In the long run, 60% of customers buy at Brew and 40% at Daily.

Example 3: Steady state of a three-state chain

A shared bike is returned each day to station A, B or C. Find the long-run share of days the bike spends at each station.

P = \begin{bmatrix} 0.5 & 0.5 & 0 \\ 0.25 & 0.5 & 0.25 \\ 0 & 0.5 & 0.5 \end{bmatrix} \quad \text{(order A, B, C)}

P has zeros, but every entry of P^2 is positive (for example, A reaches C in two steps through B), so the chain is regular.

S = \begin{bmatrix} x & y & z \end{bmatrix}

Name the unknown shares.

0.5x + 0.25y + 0z = x

S times column A must equal x.

0.25y = 0.5x

Subtract 0.5x from both sides.

y = 2x

Divide both sides by 0.25.

0x + 0.25y + 0.5z = z

S times column C must equal z.

0.25y = 0.5z

Subtract 0.5z from both sides.

y = 2z

Divide both sides by 0.25.

z = x

Both 2x and 2z equal y, so divide 2z = 2x by 2.

x + 2x + x = 1

Substitute into x + y + z = 1 (see systems of equations in three variables).

4x = 1

Combine like terms.

x = 0.25

Divide both sides by 4.

y = 2(0.25) = 0.5,\ z = 0.25

Substitute back.

0.5(0.25) + 0.5(0.5) + 0.5(0.25) = 0.5

Check with column B: the result equals y.

Answer: S = \begin{bmatrix} 0.25 & 0.5 & 0.25 \end{bmatrix}. The bike spends about half its days at station B and a quarter at each of A and C.

Example 4: Powers of P approach the steady state

Use P^2 = \begin{bmatrix} 0.70 & 0.30 \\ 0.45 & 0.55 \end{bmatrix} for the coffee-shop chain (from Markov Chains, Example 3) to find P^4. Compare its rows with S.

P^4 = P^2 \cdot P^2

Four steps are two steps done twice.

0.7(0.7) + 0.3(0.45) = 0.49 + 0.135 = 0.625

Row 1 times column 1.

0.7(0.3) + 0.3(0.55) = 0.21 + 0.165 = 0.375

Row 1 times column 2.

0.45(0.7) + 0.55(0.45) = 0.315 + 0.2475 = 0.5625

Row 2 times column 1.

0.45(0.3) + 0.55(0.55) = 0.135 + 0.3025 = 0.4375

Row 2 times column 2.

P^4 = \begin{bmatrix} 0.625 & 0.375 \\ 0.5625 & 0.4375 \end{bmatrix}

Write the four-step matrix.

Answer: both rows of P^4 are already close to (0.6, 0.4), and they get closer with each higher power. These are the points at n = 2 and n = 4 on the graph above.

Example 5: Long-run apartment occupancy (word problem)

An apartment complex has 200 units. Each month, 5% of occupied units become vacant, and 60% of vacant units are rented. In the long run, about how many units are occupied?

P = \begin{bmatrix} 0.95 & 0.05 \\ 0.6 & 0.4 \end{bmatrix}

States in the order Occupied, Vacant; each row adds to 1.

0.95x + 0.6y = x

S times column 1 must equal x.

0.6y = 0.05x

Subtract 0.95x from both sides.

x = 12y

Divide both sides by 0.05.

12y + y = 1

Substitute into x + y = 1.

13y = 1

Combine like terms.

y = 1/13 \approx 0.077

Divide both sides by 13.

x = 12/13 \approx 0.923

Substitute back into x = 12y.

200(12/13) \approx 184.6

Multiply the long-run share by the number of units.

Answer: about 92.3% of units, or about 185 of the 200, are occupied in the long run.

Common mistakes

MistakeExample of the errorFix
Forgetting the equation x + y = 1Stopping at x = 1.5y in Example 2SP = S alone has infinitely many solutions. Add the condition that the entries add to 1.
Solving PS = S with a column vectorMultiplying P by rows of S in the wrong orderWith row vectors, solve SP = S: multiply S by the columns of P.
Deciding a matrix is not regular because P has a zeroRejecting P in Example 1(a)Check powers of P. If any power has all positive entries, the chain is regular.
Thinking every chain settles to one steady stateExpecting \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} to settleThat chain flips back and forth forever. Only regular chains are sure to converge to one S from every start.
Rounding P^n entries and calling it SReporting (0.625, 0.375) as the steady statePowers only approach S. Solve SP = S for the exact answer.
Using a column sum instead of a row sumChecking that column 1 of P adds to 1Rows of P add to 1. The steady-state vector S must also add to 1.

Related ideas

A shortcut for two states

If P = \begin{bmatrix} 1 - a & a \\ b & 1 - b \end{bmatrix} with a and b positive (and not both 1), the steady state is S = \begin{bmatrix} \frac{b}{a + b} & \frac{a}{a + b} \end{bmatrix}. For the coffee shops, a = 0.2 and b = 0.3, so S = (0.3/0.5, 0.2/0.5) = (0.6, 0.4).

Eigenvector view

The equation SP = S says that S is a left eigenvector of P for the eigenvalue 1. Equivalently, the transpose of S is an eigenvector of the transpose of P. See eigenvalues and eigenvectors and transpose of a matrix.

Chains that are not regular

A chain with an absorbing state, like Q in Example 1, is not regular. Its long-run behavior is the topic of the next lesson, Absorbing Markov Chains.

Practice problems

  1. Is \begin{bmatrix} 0.3 & 0.7 \\ 1 & 0 \end{bmatrix} regular?
  2. Is \begin{bmatrix} 1 & 0 \\ 0.5 & 0.5 \end{bmatrix} regular?
  3. Is \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} regular?
  4. Find the steady-state vector of \begin{bmatrix} 0.9 & 0.1 \\ 0.4 & 0.6 \end{bmatrix}.
  5. Find the steady-state vector of \begin{bmatrix} 0.5 & 0.5 \\ 0.25 & 0.75 \end{bmatrix}.
  6. In a gym, P = \begin{bmatrix} 0.7 & 0.3 \\ 0.4 & 0.6 \end{bmatrix} with states Workout, Skip. What share of members work out in the long run?
  7. Show that \begin{bmatrix} 0.25 & 0.75 \end{bmatrix} is the steady-state vector of \begin{bmatrix} 0.4 & 0.6 \\ 0.2 & 0.8 \end{bmatrix}.
  8. Find the steady-state vector of \begin{bmatrix} 0.5 & 0.5 & 0 \\ 0.5 & 0 & 0.5 \\ 0 & 0.5 & 0.5 \end{bmatrix}.
  9. In a town of 5,000 voters, 85% of party A voters stay with A each election and 15% switch to B; 10% of B voters switch to A. How many vote A in the long run?
  10. Each year, 20% of phone carrier X’s customers switch to carrier Y, and 10% of Y’s customers switch to X. What long-run share of customers does X have?
Show answers

1.

p^{(2)}_{11} = 0.3(0.3) + 0.7(1) = 0.09 + 0.7 = 0.79

Row 1 times column 1.

p^{(2)}_{12} = 0.3(0.7) + 0.7(0) = 0.21

Row 1 times column 2.

p^{(2)}_{21} = 1(0.3) + 0(1) = 0.3,\ p^{(2)}_{22} = 1(0.7) + 0(0) = 0.7

Row 2 of P^2 is row 1 of P.

Answer: Yes. Every entry of P^2 is positive.

2.

\text{row 1 of every power} = \begin{bmatrix} 1 & 0 \end{bmatrix}

State 1 is absorbing, so its row never changes.

Answer: No. Every power has a 0 in row 1.

3.

P^2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}

Two flips return each state to itself.

P^3 = P,\ P^4 = P^2

The powers repeat, so they always contain zeros.

Answer: No. The chain alternates between the two states forever.

4.

0.9x + 0.4y = x

S times column 1 equals x.

0.4y = 0.1x

Subtract 0.9x from both sides.

x = 4y

Divide both sides by 0.1.

4y + y = 1

Substitute into x + y = 1.

y = 0.2,\ x = 0.8

Divide by 5, then x = 4(0.2).

Answer: S = \begin{bmatrix} 0.8 & 0.2 \end{bmatrix}

5.

0.5x + 0.25y = x

S times column 1 equals x.

0.25y = 0.5x

Subtract 0.5x from both sides.

y = 2x

Divide both sides by 0.25.

x + 2x = 1

Substitute into x + y = 1.

x = 1/3,\ y = 2/3

Divide by 3, then y = 2x.

Answer: S = \begin{bmatrix} \frac{1}{3} & \frac{2}{3} \end{bmatrix}

6.

0.7x + 0.4y = x

S times column 1 equals x.

0.4y = 0.3x

Subtract 0.7x from both sides.

x = \frac{4}{3}y

Divide both sides by 0.3.

\frac{4}{3}y + y = 1

Substitute into x + y = 1.

\frac{7}{3}y = 1

Combine like terms.

y = 3/7,\ x = 4/7 \approx 0.571

Multiply by 3/7, then x = 1 − y.

Answer: about 57.1% (exactly 4/7)

7.

0.25(0.4) + 0.75(0.2) = 0.1 + 0.15 = 0.25

S times column 1 gives the first entry back.

0.25(0.6) + 0.75(0.8) = 0.15 + 0.6 = 0.75

S times column 2 gives the second entry back.

0.25 + 0.75 = 1

The entries add to 1.

Answer: SP = S and the entries add to 1, so S is the steady state (the chain is regular since P has no zeros).

8.

0.5x + 0.5y = x

S times column 1 equals x.

y = x

Subtract 0.5x, then divide by 0.5.

0.5y + 0.5z = z

S times column 3 equals z.

z = y

Subtract 0.5z, then divide by 0.5.

3x = 1

Substitute into x + y + z = 1.

Answer: S = \begin{bmatrix} \frac{1}{3} & \frac{1}{3} & \frac{1}{3} \end{bmatrix} (the chain is regular: P^2 has no zeros)

9.

0.85x + 0.1y = x

S times column A equals x.

0.1y = 0.15x

Subtract 0.85x from both sides.

y = 1.5x

Divide both sides by 0.1.

2.5x = 1

Substitute into x + y = 1 and combine.

x = 0.4

Divide both sides by 2.5.

5000(0.4) = 2000

Multiply by the number of voters.

Answer: about 2,000 vote A in the long run.

10.

P = \begin{bmatrix} 0.8 & 0.2 \\ 0.1 & 0.9 \end{bmatrix}

States in the order X, Y.

0.8x + 0.1y = x

S times column X equals x.

0.1y = 0.2x

Subtract 0.8x from both sides.

y = 2x

Divide both sides by 0.1.

3x = 1

Substitute into x + y = 1 and combine.

Answer: X has 1/3 of the customers in the long run (about 33.3%).

Regular Markov chains FAQ

What makes a Markov chain regular?

Its transition matrix has some power with every entry positive. That means every state can reach every state in the same number of steps.

What is a steady-state vector?

It is a probability row vector S with SP = S. If the chain is in distribution S, it stays in S at every later step.

How do you find the steady state of a Markov chain?

Write S with unknowns, set SP = S, replace one equation with the condition that the entries add to 1, and solve the system.

Does every Markov chain have a steady state?

Every chain with finitely many states has at least one vector with SP = S, but the chain may not settle there. A regular chain has exactly one, and it reaches it from every start.

Summary

  • A chain is regular if some power of P has all positive entries.
  • A regular chain has one steady-state vector S with SP = S and entries that add to 1.
  • From any start, X_0 P^n approaches S, and every row of P^n approaches S.
  • To find S, use the column equations of SP = S together with the sum-to-1 equation.
  • For two states, S = (b/(a + b), a/(a + b)), where a and b are the switching probabilities.

Previous lesson: Markov Chains

Next lesson: Absorbing Markov Chains

Back to the Finite Math and Business Calculus Index