A one-step memory
The topic Hypothesis tests and A/B testing closed the statistics part of the course, and every result in it rested on one assumption: the observations are independent. Users in an A/B test, examples in a test set, tosses of a coin — each new draw knew nothing about the previous ones. That is what made the law of large numbers and the CLT work. Many random processes are not like that. Tomorrow's weather depends on today's, the next word of a sentence on the words before it, the next page a reader opens on the page they are reading. This topic studies the simplest model of such dependence through time.
A sequence with values in a finite set of states is a Markov chain if the future depends on the past only through the present:
The first equality is the Markov property: the current state holds everything about the past that matters for the next step. The second is a separate assumption, time homogeneity: the rule is the same at every . All chains in this topic are homogeneous.
The numbers form the transition matrix . Row is the distribution of the next state given the current state , so every entry is nonnegative and every row sums to . (Here is a matrix; is still a probability, and the brackets tell them apart.)
A three-state weather model, with rows and columns ordered sunny, cloudy, rainy:
After a sunny day comes another sunny day with probability . The multiplication rule from the topic Conditional probability and Bayes' formula, together with the Markov property, gives the probability of a whole path as a product of one-step factors:
For example, from a sunny day the path sunny, sunny, cloudy has probability .