Mental Models204 cards · 12 fields

Mental Models/Mathematics & Statistics

Markov Models

马尔可夫模型

Only where you are decides where you go next, and in time the start stops mattering.

Your phone keyboard guesses as you type: write one word, and the suggestion bar already shows the words most likely to come next. It doesn't need to understand what you are writing. It only needs to remember which word most often follows which.

In 1913 the Russian mathematician Andrei Markov counted out the same kind of pattern with pen and paper. He took the first 20,000 letters of Pushkin's long poem Eugene Onegin and first counted the vowels: about 43%. Then he counted again, split by the letter before. When the letter before was a vowel, the next one was also a vowel only 13% of the time; when the letter before was a consonant, the next one was a vowel 66% of the time. If letters had nothing to do with each other, both numbers should be close to 43%. That they were so far apart showed that one letter really does sway the next.

At the time, some people believed that only events with nothing to do with each other settle into a steady proportion when you count enough of them. Markov used the poem to show otherwise: each letter pulls on the next, and still the vowels across the whole text settle steadily at a little over 40%. The next step depends only on where you are now, and the long-run proportions are still fixed. That is a Markov model.

Use a Markov model on the two supermarkets in a small town. Each month, a tenth of Store A's customers switch to Store B, and a fifth of Store B's customers switch to Store A. Where each person shops next month depends only on where they shop now. Suppose the whole town shops at A when the stores open: the next month A keeps 90%, the month after 83%, and after a year it settles around 67%. Suppose instead the whole town starts at B: A gets 20% first, then 34%, and after a year about 66%. Two different starts, and a year later both end up in the same place.

Two starts, one place a year later
A's long-run share67%
0%25%50%75%100%024681012MonthStore A's shareAll start at AAll start at BIn and out cancel
0%50%100%0510MonthStore A's shareAll start at AAll start at BIn and out cancel

Drag the two switching rates: the end point moves. Where you start only sets how long it takes to get there.

The share stops where the flows in and out cancel

Store A's share stops moving at 2/3. Of the 2/3 of the town at A, a tenth leave, about 6.7% of the town; of the 1/3 at B, a fifth come over, also about 6.7%. What goes out and what comes in cancel. The starting point only decides how long it takes to get there: each month the gap from 2/3 shrinks by 30%, a tenth plus a fifth.

Change one switching rate and the end point moves

Call the share of A's customers who switch to B each month , the share of B's who switch to A , and A's share of the town . Each month A loses and gains . When the two are equal, , which solves to

A's long-run share is the B-to-A rate divided by the sum of the two switching rates. Right now that is . Raise B-to-A from 20% to 30% and keep A-to-B at 10%: 0.3÷(0.1+0.3), and A rises to 75%. Put B-to-A back at 20% and raise A-to-B from 10% to 30%: 0.2÷(0.2+0.3), and A falls to 40%.

A one-off shock is worn away within months

Store A runs a big sale and pushes its share up to 90%. The sale didn't change the switching rates: every month after it, a tenth still leave and a fifth still come back. Six months later A is back to about 69%, and after a year it is at 67% again.

It fits best a system with only a few places to go and switching rates that stay the same for years, like customers moving among a few brands. When the rates themselves change, say a platform holds on to people better the more people it has, the model can't keep up. Catching an illness once can leave you immune, so the next step depends on earlier history, and that doesn't fit either. If customers switch stores every single month without fail, the whole town moves back and forth between the two stores and the shares never settle. Using the long-run share as next month's forecast is also far off, because the distance to the end point shrinks by only 30% a month.

Predict
A membership gym that knows the share of members who quit each month and the share who come back can work out where its membership will finally settle, without stepping through it month by month.
Explain
Two rivals' market shares have barely moved in decades, because the customers flowing out and the customers flowing back canceled each other out long ago.
Reason
Support tickets move among "waiting," "in progress," "resolved" and "reopened." Know the share that moves between them each day, and you can work out how many days a new ticket takes to close on average.
  1. What states does this system have? In which ledger or which dataset can I count the share that moves from one state to another each month?
  2. Does where each kind of person goes next month really depend only on where they are now? Is there a kind of customer who gets harder to lose the longer they stay?
  3. Have these rates been changing over the past year? In which report can I see the month-by-month numbers?

Games

The jail in Monopoly

In Monopoly, the square you land on next depends only on the square you are on now and what you roll this turn. Landing on the Go to Jail square and drawing a Go to Jail card both send you to jail, and after a few hundred turns jail is the square landed on most. Whether you start from Go or from any other square, the share of landings on each square comes out the same.

Language

Writing a sentence one word at a time

In 1948, in A Mathematical Theory of Communication, Claude Shannon opened an English book at random and picked a word. He read on to the next place that word appeared and copied down the word right after it, then looked for that new word the same way. Sentences built like this have phrases that read smoothly, but the sentence as a whole means nothing.

Finance

The rating transition table

Every year, rating agencies publish a table: of the bonds with a given rating, what share are upgraded, unchanged, downgraded or in default a year later. A bank multiplies the table through five years and gets the chance that a BBB-rated loan defaults within five years, without having to wait five years.

In a city, every resident either rents a home or owns one. Suppose that each year 4% of renters buy a home and 1% of owners sell and go back to renting, and that these two rates never change. When the city was built, almost everyone rented.

Many years later, about what share of residents own their home?

You run an online course platform, and the share of learners who are active has held steady at about 40% for several years. You have the month-by-month data and want to know whether this long-run share is already changing.

Which piece of data best shows that the long-run share is changing?

You are running a training course. Each month, 80% of the learners keep studying, 15% graduate and 5% drop out. People who graduate or drop out don't come back. The course starts with 100 new learners.

Once everyone has left the course, about how many will have graduated?