The Long-Run Steady State

The split that stops moving, and PageRank.

Watching the split settle

Each year 0.2 of the city moves to the country and 0.3 of the country moves to the city, so the transition matrix is T = (0.8 0.3; 0.2 0.7), the city first. Start with all 1000 people in the city and multiply by T year after year.

After one year the city holds 0.8 × 1000 = 800 and the country 200. Then 0.8 × 800 + 0.3 × 200 = 700, then 0.8 × 700 + 0.3 × 300 = 650, then 0.8 × 650 + 0.3 × 350 = 625. The city's numbers drop by 200, 100, 50 and 25, each drop half the one before, so they are closing in on 600.

citycountryyear 010000year 1800200year 2700300year 3650350year 4625375

The city is 400, 200, 100, 50 and then 25 above 600: the gap halves every year.

AB0%100%0.3 →← 0.2π_A = 0.4t104812t = 0: A = 0%

the split is still 40 percentage points from 40/60, and the gap halves at every step: (a₀ − 0.4) × 0.5ᵗ

Start with everything in A, then step time forward until the split freezes

The same chain, with A the country and B the city: 0.3 of A moves to B and 0.2 of B moves to A each year. It opens with everyone in the city. From any start, stepping time forward ends at 40% country and 60% city. The instrument writes the shares as a row π and the matrix as P, so π P = π says the same as T s = s.

A split that T leaves alone

The split has settled when another year changes nothing: T times the split gives the same split back. Write the settled split as a column s. Then T s = s, which is the eigenvector equation A v = λ v with λ = 1. The long-run split is an eigenvector of T with eigenvalue 1.

Every transition matrix has 1 as an eigenvalue. Each column of T adds to 1, so each column of T − I adds to 0, and then the bottom row of T − I is minus the sum of the rows above it. So the determinant of T − I is 0, and 1 is an eigenvalue. Here T − I has rows (−0.2, 0.3) and (0.2, −0.3), and the second is minus the first.

Solving (T − I) s = 0

T s = s rearranges to T s − s = 0, that is (T − I) s = 0, exactly as for any other eigenvector. Take 1 off each entry of the main diagonal of T: 0.8 − 1 = −0.2 and 0.7 − 1 = −0.3.

With s = (x, y), the first row says −0.2x + 0.3y = 0, so 0.2x = 0.3y, which is 2x = 3y. The second row says 0.2x − 0.3y = 0, the same condition. So x : y = 3 : 2: in the long run there are 3 people in the city for every 2 in the country.

T0.80.30.20.7I1001T − I−0.20.30.2−0.3−=

Subtracting I takes 1 off the two diagonal entries of T. The second row of T − I is minus the first, so both rows give 2x = 3y.

Scaling to the whole

An eigenvector fixes only a direction, so (3, 2), (6, 4) and (0.6, 0.4) all satisfy 2x = 3y. The steady state is the one whose entries add to the whole. For 1000 people, split 1000 in the ratio 3 : 2: there are 5 parts of 200, so the city gets 3 × 200 = 600 and the country 2 × 200 = 400. As shares that add to 1, the steady state is (0.6, 0.4).

Check it with T: the city gets 0.8 × 600 + 0.3 × 400 = 480 + 120 = 600, and the country gets 0.2 × 600 + 0.7 × 400 = 120 + 280 = 400. Nothing changes.

People still move every year, but the flows balance: 0.2 × 600 = 120 leave the city and 0.3 × 400 = 120 arrive from the country.

T0.80.30.20.7s600400600400×=

T times the steady state 600, 400 gives 600, 400 again.

Why every start ends there

T has a second eigenvalue, 0.5, with eigenvector (1, −1): T sends (1, −1) to (0.8 − 0.3, 0.2 − 0.7) = (0.5, −0.5). Any start is the steady state plus some multiple of (1, −1). Starting from everyone in the city, (1000, 0) = (600, 400) + 400(1, −1).

Each year leaves the steady part alone and halves the other part, so after n years the city holds 600 + 400 × 0.5ⁿ: 800, 700, 650, 625, exactly the table. As n grows, 0.5ⁿ shrinks toward 0, and the split ends at 600 and 400 whatever the start was.

This is what a regular chain guarantees: one steady state, and every other eigenvalue smaller than 1 in size, so every start settles there. Two kinds of chain behave differently. With a trap state, the steady state puts everyone in the trap. With two states that swap every step, T = (0 1; 1 0) leaves (0.5, 0.5) unchanged, but a start of (1, 0) goes to (0, 1) and back forever and never settles; its second eigenvalue is −1, which does not shrink.

PageRank

A search engine can rank web pages with a steady state. A reader on a page clicks one of its links at random, so a page with two links sends 0.5 along each. Take three pages: A links only to B, B links only to C, and C links to A and to B. With s = (a, b, c), T s = s gives a = 0.5c, then b = a + 0.5c, and c = b.

So c = b and a = 0.5c, and with a + b + c = 1, 0.5c + c + c = 1 gives c = 0.4. The steady state is (0.2, 0.4, 0.4): in the long run the reader is on B or C 0.4 of the time each and on A only 0.2 of the time, so B and C rank above A. Check the first row: 0.5 × 0.4 = 0.2. The full method also lets the reader jump to a random page now and then, which makes the chain regular.

110.50.5ABC

Each arrow is a link, carrying the chance a reader follows it. A and B each have one link, which carries 1; C has two, which carry 0.5 each.

The usual mistakes

Solving T s = 0 instead of T s = s. T s = 0 asks for a split that becomes nobody at all, but T keeps the total: the entries of T s add to the same total as the entries of s. The steady state is what T leaves unchanged.

Stopping at the ratio. 2x = 3y gives a direction; the steady state also needs the entries to add to the whole, 600 and 400 out of 1000.

Swapping the ratio. 2x = 3y means x : y = 3 : 2, so the city, x, gets the larger share.

Reading the long run from one year, or from a column of T. After one year the city holds 800, which is still moving; only the steady state is left unchanged by T.

A machine, car-hire depots and three web pages

In the applications below, the steady state of a machine that works or breaks down gives the share of working days in a year. Then a car-hire firm's steady state across three depots, scaled to 120 cars, gives the parking spaces each depot needs. And the steady state of three linked pages ranks them by where a reader's clicks land.

Worked example: A Factory Machine That Works or Breaks Down Each Day, and the Share of Days It Works in the Long Run

Question A machine in a bottling factory is either working or broken at the start of each day. If it is working today, it is working tomorrow with probability 0.9 and broken with probability 0.1. If it is broken today, it is repaired and working tomorrow with probability 0.6, and still broken with probability 0.4. The state vector is a column of the chances of working and broken. The machine is broken on Monday. (a) Find the chance that it is working on Wednesday. (b) Find the fraction of days on which the machine works in the long run, and the number of working days in a year of 350 days.

  1. 1.The column for working holds 0.9 and 0.1, and the column for broken holds 0.6 and 0.4: T = 0.90.60.10.4.

    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4to0.9 + 0.1 = 1, 0.6 + 0.4 = 1
    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4to0.9 + 0.1 = 1, 0.6 + 0.4 = 1
    T = 0.90.60.10.4, with the columns in the order working, broken.
  2. 2.Monday is 01, so Tuesday is the second column, 0.60.4. Wednesday is T0.60.4 = 0.54 + 0.240.06 + 0.16 = 0.780.22.

    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4toTuesday0.60.4Wednesday0.780.22
    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4toTuesday0.60.4Wednesday0.780.22
    From a broken Monday, Tuesday is 0.60.4 and Wednesday is T0.60.4 = 0.780.22.
  3. 3.(a) The chance that the machine is working on Wednesday is 0.78: repaired on Tuesday and still working, 0.6 × 0.9 = 0.54, or still broken on Tuesday and repaired on Wednesday, 0.4 × 0.6 = 0.24.

    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4to0.6 × 0.9 = 0.54, 0.4 × 0.6 = 0.24(a) 0.54 + 0.24 = 0.78
    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4to0.6 × 0.9 = 0.54, 0.4 × 0.6 = 0.24(a) 0.54 + 0.24 = 0.78
    (a) Repaired on Tuesday and still working, or repaired on Wednesday: 0.54 + 0.24 = 0.78.
  4. 4.For the steady state π = wb, the first row of Tπ = π gives 0.9w + 0.6b = w, so 0.6b = 0.1w and w = 6b. With w + b = 1, 7b = 1, so b = 17 and w = 67.

    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4to0102468days after a broken Monday6/71/70.6b = 0.1w, w = 6bw = 6/7, b = 1/7
    worksbroken0.90.10.60.40102468days after a broken Monday6/71/70.6b = 0.1w, w = 6bw = 6/7, b = 1/7
    The points are the chances day by day. The first row of Tπ = π gives w = 6b: the steady state is 67 and 17, dashed.
  5. 5.(b) In the long run the machine works on 67 of the days: 67 × 350 = 300 working days in the year, and 50 days broken. Check: the first entry of T6717 is 5.4 + 0.67 = 67.

    worksbroken0.90.10.60.4fromworksbrokenworks0.90.6broken0.10.4to0102468days after a broken Monday6/71/7(b) 6/7 × 350 = 300 working days
    worksbroken0.90.10.60.40102468days after a broken Monday6/71/7(b) 6/7 × 350 = 300 working days
    (b) The machine works on 67 of the days: 300 days out of 350.

Answer: (a) 0.78; (b) 67 of the days: 300 working days out of 350

Common mistakes

  • Working out 0.6 × 0.9 = 0.54 alone for Wednesday. That is only the path in which the machine is repaired on Tuesday; it can also stay broken on Tuesday and be repaired on Wednesday, 0.4 × 0.6 = 0.24, so the chance is 0.54 + 0.24 = 0.78.
  • Taking the long-run share of working days as 0.9, the chance of working after a working day. The machine is sometimes broken, and a broken day is followed by a working day only 0.6 of the time, so the share is 67 ≈ 0.857, a little below 0.9.

More transition matrices and markov chains problems, worked step by step →

Worked example: A Car-Hire Firm's Cars Returned to Three Depots, and How Many Each Depot Holds in the Long Run

Question A car-hire firm has 120 cars and three depots: the airport (A), the city center (C) and the harbor (H). Each car is hired for a day and returned the next morning. Of the cars hired from the airport, 70% come back to the airport, 20% to the city center and 10% to the harbor. Of those hired from the city center, 30% come back to the airport, 60% to the city center and 10% to the harbor. Of those hired from the harbor, 30% come back to the airport, 20% to the city center and 50% to the harbor. Take the state vector as a column of the numbers of cars at A, C and H. This morning each depot has 40 cars. (a) Write down the transition matrix T, and find the number of cars at each depot tomorrow morning. (b) Find the number of cars each depot holds in the long run, so that the firm knows how many parking spaces each depot needs.

  1. 1.The column for each depot holds where its cars go: T = 0.70.30.30.20.60.20.10.10.5, with the rows and columns in the order A, C, H. Each column adds up to 1.

    ACH0.70.20.10.30.60.10.30.20.5fromACHA0.70.30.3C0.20.60.2H0.10.10.5toeach column adds up to 1A: 0.7 + 0.2 + 0.1 = 1
    ACH0.70.20.10.30.60.10.30.20.5fromACHA0.70.30.3C0.20.60.2H0.10.10.5toeach column adds up to 1A: 0.7 + 0.2 + 0.1 = 1
    Each depot's arrows are its column of T = 0.70.30.30.20.60.20.10.10.5.
  2. 2.(a) Tomorrow morning: T404040 = 28 + 12 + 128 + 24 + 84 + 4 + 20 = 524028: 52 cars at the airport, 40 in the city center and 28 at the harbor. Check: 52 + 40 + 28 = 120.

    ACH0.70.20.10.30.60.10.30.20.5fromACHA0.70.30.3C0.20.60.2H0.10.10.5toT ×404040=52402852 + 40 + 28 = 120
    ACH0.70.20.10.30.60.10.30.20.5fromACHA0.70.30.3C0.20.60.2H0.10.10.5toT ×404040=52402852 + 40 + 28 = 120
    (a) Tomorrow morning T404040 = 524028: 52 cars at the airport, 40 in the city center and 28 at the harbor.
  3. 3.For the long run, let the steady state be π = ach, with Tπ = π and a + c + h = 1. The third row gives 0.1a + 0.1c + 0.5h = h, so 0.1(a + c) = 0.5h. Since a + c = 1 − h, 0.1 − 0.1h = 0.5h, so 0.6h = 0.1 and h = 16.

    ACH0.70.20.10.30.60.10.30.20.5fromACHA0.70.30.3C0.20.60.2H0.10.10.5to20406002468mornings200.1(a + c) = 0.5h0.1 − 0.1h = 0.5h, h = 1/6
    ACH0.70.20.10.30.60.10.30.20.520406002468mornings200.1(a + c) = 0.5h0.1 − 0.1h = 0.5h, h = 1/6
    The points are the numbers of cars each morning from 40 at each depot. The third row of Tπ = π gives h = 16: 20 cars, dashed.
  4. 4.The first row gives 0.7a + 0.3c + 0.3h = a, so 0.3(c + h) = 0.3a and c + h = a. With a + c + h = 1, 2a = 1, so a = 12 and c = 12 − 16 = 13.

    ACH0.70.20.10.30.60.10.30.20.5fromACHA0.70.30.3C0.20.60.2H0.10.10.5to20406002468mornings206040c + h = a, 2a = 1a = 1/2, c = 1/3
    ACH0.70.20.10.30.60.10.30.20.520406002468mornings206040c + h = a, 2a = 1a = 1/2, c = 1/3
    The first row gives c + h = a, so a = 12 and c = 13: 60 and 40 cars.
  5. 5.(b) In the long run the depots hold 12 × 120 = 60, 13 × 120 = 40 and 16 × 120 = 20 cars. Check: T604020 = 42 + 12 + 612 + 24 + 46 + 4 + 10 = 604020.

    ACH0.70.20.10.30.60.10.30.20.5fromACHA0.70.30.3C0.20.60.2H0.10.10.5to20406002468mornings206040T ×604020=604020(b) 60 at A, 40 at C, 20 at H
    ACH0.70.20.10.30.60.10.30.20.520406002468mornings206040T ×604020=604020(b) 60 at A, 40 at C, 20 at H
    (b) In the long run the depots hold 60, 40 and 20 cars, the numbers that T leaves unchanged.

Answer: (a) T = 0.70.30.30.20.60.20.10.10.5; tomorrow 52 cars at the airport, 40 in the city center and 28 at the harbor; (b) 60, 40 and 20 cars

Common mistakes

  • Solving Tπ = π without the condition a + c + h = 1. The three equations fix only the ratio a : c : h = 3 : 2 : 1, because any multiple of a steady state is also left unchanged; the condition that the shares add up to 1 picks out 12, 13 and 16.
  • Reading the long run from tomorrow's numbers, 52, 40 and 28. One morning moves the cars only part of the way: the airport goes on filling, to an average of 56.8 cars the morning after, and only the steady state, 60, is left unchanged by T.

More transition matrices and markov chains problems, worked step by step →

Worked example: Three Pages of a Website Linked to One Another, and a Ranking by Where Visitors' Clicks Land

Question A small website has three pages: Home (H), News (N) and Shop (S). Home links to News and to Shop, News links to Home and to Shop, and Shop links only to Home. A visitor on a page clicks one of its links, each with the same chance. The state vector is a column of the chances that the visitor is on H, N and S. (a) Write down the transition matrix T, and find the chance that a visitor who starts on Home is back on Home after two clicks. (b) Find the fraction of clicks that land on each page in the long run, and rank the pages.

  1. 1.Home has two links, so its column holds 12 for News and 12 for Shop; News also has two links; Shop has one, to Home. So T = 0121120012120, in the order H, N, S.

    HomeNewsShop1/21/21/21/21fromHomeNewsShopHome01/21News1/200Shop1/21/20totwo links: 1/2 each; one link: 1
    HomeNewsShop1/21/21/21/21fromHomeNewsShopHome01/21News1/200Shop1/21/20totwo links: 1/2 each; one link: 1
    Each page shares its column equally between its links: T = 0121120012120.
  2. 2.(a) Two clicks from Home back to Home go through News, with chance 12 × 12 = 14, or through Shop, with chance 12 × 1 = 12. The chance is 14 + 12 = 34.

    HomeNewsShop1/21/21/21/21fromHomeNewsShopHome01/21News1/200Shop1/21/20toH → N → H: 1/2 × 1/2 = 1/4H → S → H: 1/2 × 1 = 1/2(a) 1/4 + 1/2 = 3/4
    HomeNewsShop1/21/21/21/21fromHomeNewsShopHome01/21News1/200Shop1/21/20toH → N → H: 1/2 × 1/2 = 1/4H → S → H: 1/2 × 1 = 1/2(a) 1/4 + 1/2 = 3/4
    (a) Back on Home after two clicks: through News, 14, or through Shop, 12, so 34.
  3. 3.For the long run, let π = hns. The second row of Tπ = π gives n = 12h, and the third row gives s = 12h + 12n = 12h + 14h = 34h.

    HomeNewsShop1/21/21/21/21fromHomeNewsShopHome01/21News1/200Shop1/21/20to010246810clicks from Homen = h/2s = h/2 + n/2 = 3h/4
    HomeNewsShop1/21/21/21/21010246810clicks from Homen = h/2s = h/2 + n/2 = 3h/4
    The points are the chances click by click from Home. The second and third rows of Tπ = π give n = 12h and s = 34h.
  4. 4.With h + n + s = 1: h + 12h + 34h = 94h = 1, so h = 49, n = 29 and s = 39 = 13.

    HomeNewsShop1/21/21/21/21fromHomeNewsShopHome01/21News1/200Shop1/21/20to010246810clicks from Home4/91/32/9h + h/2 + 3h/4 = 1h = 4/9, n = 2/9, s = 1/3
    HomeNewsShop1/21/21/21/21010246810clicks from Home4/91/32/9h + h/2 + 3h/4 = 1h = 4/9, n = 2/9, s = 1/3
    With h + n + s = 1, h = 49, n = 29 and s = 13: the dashed levels.
  5. 5.(b) In the long run 49 of the clicks land on Home, 13 on Shop and 29 on News, so the ranking is Home, Shop, News. Check the first row: 12 × 29 + 1 × 13 = 19 + 39 = 49.

    HomeNewsShop1/21/21/21/21fromHomeNewsShopHome01/21News1/200Shop1/21/20to010246810clicks from Home4/91/32/9(b) Home 4/9, Shop 1/3, News 2/9
    HomeNewsShop1/21/21/21/21010246810clicks from Home4/91/32/9(b) Home 4/9, Shop 1/3, News 2/9
    (b) The ranking is Home, then Shop, then News.

Answer: (a) T = 0121120012120, and the chance is 34 = 0.75; (b) Home 49, Shop 13, News 29: Home first, then Shop, then News

Common mistakes

  • Ranking the pages by how many links each one has, which puts Home and News level. A page's rank depends on the links that point to it and on the rank of the pages they come from: Shop receives links from both Home and News, and ranks above News.
  • Putting a 1 for every link, so that Home's column holds 1 and 1. The visitor follows only one link, so the chances in each column must add up to 1, and each of Home's two links gets 12.

More transition matrices and markov chains problems, worked step by step →

Practice The Long-Run Steady State in the app