In 1913 Andrey Markov counted vowels and consonants in Pushkin's Eugene Onegin to show that dependent events still obey laws of large numbers. His chains, where the next state depends only on the current one, now model weather, credit ratings, web surfing and language.
We will look two steps ahead and finish with evolving distributions.
Step 1: Two steps ahead
One-step probabilities Pᵢⱼ = P(Xt+1 = j | Xₜ = i) determine everything else. The probability of a particular path multiplies its steps: in a chain that stays in state 2 with probability 0.6, the path 2 → 2 → 2 has probability 0.36. Two-step probabilities add the paths over the intermediate state:
If state 1 stays with probability 0.8 and moves to 2 with 0.2, while state 2 returns to 1 with 0.4, then P(1 → 1 in two steps) = 0.8 × 0.8 + 0.2 × 0.4 = 0.72.
Step 2: Evolving distributions
If today's state is uncertain, with distribution μ written as a row vector, tomorrow's is
In the example, starting from μ₀ = (0.5, 0.5), tomorrow's distribution is (0.5 × 0.8 + 0.5 × 0.4, 0.5 × 0.2 + 0.5 × 0.6) = (0.6, 0.4). A state can be reached in exactly n steps only if some path of n arrows, each with positive probability, leads there: in a chain 1 → 2 → 3 → 1, from state 1 only state 3 can be reached in exactly 2 steps.