Epilogue

Problem · Solved · Mathematics

Markov Chains

Listen

Each step can depend on the one before it, and the long-run share can still settle. Markov proved that for his chains, then found the dependence in Pushkin.

01 · History

Free will had borrowed the averages

By 1906 the fight was already personal. Pavel Nekrasov, a pious, seminary-trained mathematician in Moscow, had been arguing that the law of large numbers required independence, and that independence was the statistical face of free will. Social counts settle. Crime figures settle. Nekrasov treated the settling as evidence that the acts underneath were voluntary, with no causal tug from one act to the next. Andrey Markov, a combative, atheist probabilist in Petersburg, called that performance “an abuse of mathematics.”

The law itself is older than either man. Jacob Bernoulli’s version, published in 1713 in Ars Conjectandi, says that independent trials average out. Flip a coin long enough and the share of heads sits near the coin’s true chance. The trials are forbidden to remember each other. Nekrasov treated the hypothesis as a requirement, and carried the requirement into an argument for free will. If the averages settle, the trials must have been independent. If human statistics settle, the humans must have been free. Markov went after the mathematical step. A sequence can remember its last outcome and still average out, if the memory is the right shape.

The 1906 paper builds the smallest such shape. Two states. The next state depends on the current one and on nothing earlier. That is the whole memory. For the first case he required every transition probability to sit strictly between zero and one, so the chain can always leave its current state, and no jump is certain. Under that condition, a long chain is very likely to spend a share of its time in each state close to one fixed value. The start washes out. The transitions remain. That is a weak law of large numbers for dependent trials. He widened the argument over the next few years. The name came later. Sergei Bernstein put “Markov chain” into print in 1926.

Markov’s temper was public. In February 1912 he asked the Holy Synod to excommunicate him. He gave his reasons: disbelief in the biblical stories, and no important difference between icons and idols. The Synod refused the rite. It recorded that he had already fallen away from the Church. An internal comment said excommunication would be too great an honor.

The demonstration that traveled was a poem. On 23 January 1913 Markov lectured the Imperial Academy of Sciences in St. Petersburg. The year was the Romanov tercentenary. It was also two hundred years since Bernoulli’s book. In a letter of 15 January he reminded the statistician Alexander Chuprov that the law of large numbers had a bicentenary, and asked that the anniversary be marked. For the lecture he took Alexander Pushkin’s Eugene Onegin, the whole first chapter and sixteen stanzas of the second, removed spaces and punctuation, and dropped the hard and soft signs, which do not sound by themselves. Twenty thousand letters remained. He called each letter a vowel or a consonant and counted. 8,638 vowels. 11,362 consonants. The vowel share was 0.432.

Independence would keep the chance of a vowel near 0.432 no matter what the previous letter was. Markov’s pairs sit far from that flat chance. A vowel followed a vowel 1,104 times. Divided by the 8,638 vowels, that chance is 0.128. After a consonant, the chance of a vowel rose to 0.663. Pushkin’s letters prefer to alternate. The next letter depends on the current one, and the lean is large. He did the arithmetic by hand, in two hundred blocks of one hundred letters. The same census on 100,000 letters of Sergei Aksakov’s childhood memoir gave a vowel share of 0.449, a vowel-after-vowel chance of 0.552, and a vowel-after-consonant chance of 0.365. Different book, different lean, same kind of chain. In the 1913 edition of his textbook he closed with Onegin as a good example of dependent trials that can still be treated as a simple chain.

One letter of memory

Start on a consonant. With Onegin’s chances, the next letter rarely repeats a vowel.

C
Now
Consonant
Vowels so far
0.000
Filled chips are vowels. After a vowel, Onegin’s chance of another vowel is 0.128. After a consonant, it is 0.663.

02 · Exact statement

The claim in one sentence

Markov chains

For a two-state chain in which every transition chance lies strictly between zero and one, a long run spends a settled share of its time in each state, and the transitions alone set that share.

A state is the situation the process is in now: vowel or consonant, this page or that one, a switchboard with this many calls. A transition chance is the probability of each possible next state, given only the current one. The Markov property is that short memory. Once the current state is known, the earlier path adds nothing about what comes next.

For vowels and consonants, let the chance of a vowel after a vowel be a, and the chance of a vowel after a consonant be b. The long-run vowel share is b / (b + 1 - a). The denominator is b plus the chance of a consonant after a vowel. Onegin’s estimates are a = 0.128 and b = 0.663, so the consonant-after-vowel chance is 0.872. Then 0.663 / (0.663 + 0.872) = 0.432. The same 0.432 his letter count already gave. A long text from this chain sits in balance: the transitions and the overall share agree.

The 1906 theorem is a weak law of large numbers for this kind of dependence. Run the chain for a long time. The observed share of each state is very likely to lie close to that fixed value. Where you started stops mattering. Markov began with two states and every transition strictly between 0 and 1, which keeps the chain from getting stuck, then extended the reach of the argument. The Onegin count is the illustration, a chain you can hold: real letters, real dependence, and a balance the formula recognizes.

03 · Where it stands

Solved in 1906. The poem was the demonstration.

The quarrel was a necessity claim. Nekrasov said the law of large numbers demands independence, and he carried that demand into an argument about free will. Markov showed a large class of dependent sequences still obey a weak law. The mathematical point he was fighting is closed.

The 1913 lecture did a second job. It showed this kind of dependence in the letters of a novel in verse that Russian schoolchildren recite. A memoryless vowel probability of 8,638 out of 20,000 would produce about 3,730 vowel-vowel pairs among the 19,999 adjacent pairs. Markov counted 1,104. The memoryless benchmark is more than three times that count. The name Markov chain is Bernstein’s, from 1926. The mathematics was already in the 1906 paper, and the poem was already in the lecture.

The existence of that share is settled. How fast a very large chain approaches it is a separate, active subject called mixing. Search rankings and sampling methods live on that speed. They rest on a theorem that already has its answer.

Formal status
Solved. Markov’s 1906 paper gives a weak law of large numbers for these dependent chains. The averages can settle when each step depends on the current state.
The count
23 January 1913. 20,000 letters of Eugene Onegin, hard and soft signs removed. Vowel share 0.432. Vowel after vowel 0.128. Vowel after consonant 0.663.
The name
Sergei Bernstein used “Markov chain” in print in 1926. The mathematics was already in the 1906 paper.
What it settled
A process can remember its current state, and a long run can still have a stable share for each state. The start washes out.
Still active nearby
Mixing times: how many steps a large chain needs before its share is close to the stationary value. The existence of that value, for these chains, is settled.

04 · Visualizations

Walk the letters until the share locks

Two states, vowel and consonant, with the transition chances Markov published for Eugene Onegin. Step the chain or let it run. The running share of vowels heads for a horizontal line fixed by those chances. A second curve is the exact probability of a vowel at each step. When letters like to alternate, that curve wobbles, then damps to the same line.

Two states, one step of memory

Move the chances, then walk the chain. The running share of vowels heads for the horizontal line.

Vowel after a vowel0.128
Vowel after a consonant0.663
FromTo vowelTo consonant
Vowel0.1280.872
Consonant0.6630.337
Scrub the chainStep 0 / 179
Step 0Vowel share, from 0 to 1Step 179
Now
Consonant
Running share
0.000
Exact chance
0.000
Stationary
0.432
The pale curve is the exact chance of a vowel at that step. It can wobble when vowels and consonants like to alternate, then it damps to the dashed line. The dark curve is one simulated running share. The sliders stay between 0.02 and 0.98, so every jump keeps a real chance, the hypothesis of Markov’s first argument.

05 · Impact

The chain left the poem and got to work

In 1998 Larry Page and Sergey Brin ranked the web with a stroll. The reader follows a link, or jumps to a random page, so the walk can leave a page with nowhere to go. Their write-up usually set the chance of following a link at 0.85, and the leftover 0.15 as a jump. The rank of a page is the long-run share of visits. A chain’s stationary share had become a way to sort the internet.

The Metropolis method of 1953, widened by Hastings in 1970, builds a chain whose long-run shares match a distribution you want to sample, including distributions too large to list. Speech recognizers through the 1970s and 1980s used hidden Markov models: the next linguistic state depends on the current one, and the microphone hears a noisy clue. Claude Shannon, in 1948, had already built Markov approximations of English, letting recent letters or words steer the next one. Later language models kept that habit of guessing the next piece from earlier text, often with a memory much longer than the single letter Markov counted in Onegin.

Agner Erlang’s telephone models, beginning with a 1909 paper, treat the number of calls in the system as a state. Arrivals and hang-ups move it, and the next count depends on the current count. The Jukes-Cantor model of 1969 lets a DNA base, one of the chemical letters of a genome, change with chances that depend on the base present now. Hidden Markov models of genes treat “inside a gene” as a state the letters only hint at. The quarrel that started this was about free will. The tool that came out of it averages a process that mostly forgets, except for where it is now.