Markov Chains
A Markov Chain is a mathematical system that undergoes transitions from one state to another on a state space. It is a stochastic process characterized by the Markov property: the conditional probability distribution of future states of the process depends only upon the present state, not on the sequence of events that preceded it.
Formally, a stochastic process is a Markov chain if, for all and any sequence of states , the following equality holds:
This fundamental property states that the entire history of the process is encapsulated in its current state . This drastically simplifies the study of complex systems, reducing an infinite-dimensional dependency into a single-step conditional probability. Discrete and continuous-time variants form the backbone of modern stochastic modeling, encompassing applications ranging from simple queuing systems to complex financial models and molecular dynamics.
Discrete-Time Markov Chains (DTMC)
A Discrete-Time Markov Chain operates with a discrete time parameter . The set of possible values for the random variables forms a countable set , called the state space. The probability of moving from state to state in one time step is given by the transition probability , defined as:
When these transition probabilities are independent of the time step , the Markov chain is said to be time-homogeneous. We will strictly focus on time-homogeneous chains, as their structure permits robust long-term behavioral analysis.
Transition Matrices
For a state space containing a finite number of states (or countably infinite), the one-step transition probabilities are arranged in a matrix , called the transition matrix:
This matrix has two vital properties:
- for all .
- for all .
Every row describes a probability distribution, making a stochastic matrix. If the initial distribution of the chain is a row vector (where ), the distribution after one step is . By induction, the probability distribution of the state after steps is given by . The matrix multiplication organically computes the sum over all possible paths of length between any two states, weighting each path by its probability.
-Step Transition Probabilities
The -step transition probability is the probability that a process currently in state will be in state exactly steps later:
For , . For , is if and otherwise.
If the transition matrix $P$ of a 3-state Markov chain has row sums of 1, what must be true about the row sums of $P^2$?
Chapman-Kolmogorov Equations
The computation of -step transition probabilities is fundamentally governed by the Chapman-Kolmogorov equations. These equations provide a rigorous method for computing the probability of moving from state to state in steps by conditioning on the intermediate state attained after steps:
In matrix notation, this corresponds exactly to the multiplication of powers of the transition matrix: Let be the matrix whose entries are . Then . Consequently, . The equation elegantly states that the transition matrix for steps is the -th power of the 1-step transition matrix.
Classification of States
The long-term behavior of a Markov chain is heavily dependent on the communication structure and the topological arrangement of its state space.
Accessibility and Communication
- State is accessible from state (denoted ) if there exists an integer such that . Simply put, there is a path of non-zero probability from to .
- States and communicate (denoted ) if and .
Communication is an equivalence relation (it is reflexive, symmetric, and transitive), which partitions the state space into disjoint communication classes. If a Markov chain has only one communication class—meaning every state is accessible from every other state—it is called irreducible.
Recurrent and Transient States
Let denote the probability that the first transition into state (starting from ) occurs exactly at step :
Let be the probability of ever reaching state given that the chain started in state . The parameter is therefore the probability of ever returning to state given that the chain started in state .
- A state is recurrent if . A recurrent state will be visited infinitely many times with probability .
- A state is transient if . A transient state will be visited only a finite number of times with probability .
A state is recurrent if and only if the expected number of returns to that state is infinite: . It is transient if and only if . Every finite Markov chain has at least one recurrent state, though an infinite state space may consist entirely of transient states (e.g., a simple random walk on ).
Periodicity
The period of a state is defined as the greatest common divisor (GCD) of the set of numbers of steps for which a return to state is possible:
- If , the state is aperiodic. Returns can occur at irregular intervals without a fixed rigid period.
- If , the state is periodic with period .
For irreducible chains, periodicity is a class property: all states in the same communication class have the same period.
Ergodic States
A state is positive recurrent if it is recurrent and its expected return time is finite: If a state is positive recurrent and aperiodic, it is classified as ergodic. A Markov chain is defined as ergodic if all its states are ergodic. Ergodicity is the bedrock property guaranteeing that a system will eventually “forget” its initial state and settle into a stable proportional equilibrium.
Stationary distributions
When an ergodic Markov chain runs for a sufficiently long time, its distribution approaches a steady state, completely independent of the starting state. This limiting distribution is called the stationary distribution, denoted by a row vector .
A probability distribution is a stationary distribution if:
- for all .
- .
- .
The condition indicates that if you start the chain randomly by picking the initial state according to the distribution , the state distribution at any subsequent step remains exactly .
For an irreducible, aperiodic, and positive recurrent (i.e., ergodic) Markov chain, a unique stationary distribution exists, and the fundamental limit theorem applies:
Furthermore, the stationary probability is inversely proportional to the expected return time: . This provides a profound link between the limits of transition probabilities and the stochastic temporal behavior of the chain.
A gambler plays a fair game where they win $1 with probability $0.5$ and lose $1 with probability $0.5$ at each step. The gambler starts with $\$a$ and the game ends when their capital reaches $0$ (ruin) or a predetermined target value $\$N$ (success). This process can be seamlessly modeled as a discrete-time Markov chain with state space $S = \{0, 1, 2, \dots, N\}$ where states $0$ and $N$ represent the termination of the game.
We are analyzing classification of states. Are the transient states guaranteed to be left forever, and what is the nature of states 0 and N within the context of state classifications?
Deep Dive into Continuous-Time Markov Chains (CTMC)
While discrete-time Markov chains rigidly describe systems transitioning at fixed, discrete time steps, vastly many real-world stochastic processes change state at random, continuously distributed times along the axis. Such processes are modeled as Continuous-Time Markov Chains (CTMC).
A stochastic process defined on a discrete state space is a CTMC if it satisfies the strict continuous-time Markov property:
For a time-homogeneous CTMC, the transition probability only depends on the length of the time interval :
Holding Times and Transition Rates
When a CTMC enters a state , the amount of time it spends in that state before making a sudden transition—called the holding time or sojourn time—strictly follows an exponential distribution with a rate parameter (often denoted or ).
Why an exponential distribution? The exponential distribution is the only strictly continuous probability distribution possessing the memoryless property. The Markov assumption fundamentally requires that the time already spent in a state yields zero new information about the remaining time to be spent in that state.
When the process inevitably leaves state , the probability it transitions specifically to state is independent of the holding time and is denoted by the transition probability , where and .
Equivalently, one specifies the unnormalized transition rates , defined precisely as the rate at which the continuous process transitions from state to state :
These transition rates are compactly arranged in the generator matrix (or infinitesimal generator) , whose scalar elements are given by:
- for
Because of this specific continuous balancing formulation, the row sums of the generator matrix are identically across all rows:
The Kolmogorov Forward and Backward Equations
In discrete time, matrices multiply simply via algebraic powers . In continuous time, the transition matrices satisfy systems of coupled linear differential equations instead of algebraic relations, linking the finite time transition probabilities to the instantaneous transition rates mathematically encoded in the matrix .
Kolmogorov Backward Equations: Component-wise, this elegantly expands to . These differential equations calculate probabilities by conditioning on the first transition out of the initial starting state.
Kolmogorov Forward Equations: Component-wise, this equates to . The forward equations construct the probability distribution by conditioning on the final transition immediately preceding time .
Provided sufficient regularity conditions (which automatically hold firm in all finite state spaces), the solution to these initial value problems (with boundary condition , the identity matrix) is given identically by the matrix exponential function:
Stationary Distributions in CTMCs
Much like in DTMCs, under the correct irreducibility and positive-recurrence topological assumptions, a continuous-time Markov chain invariably possesses a stationary distribution governing the exact long-term steady-state proportion of time the process spends occupying each state.
However, the geometric algebraic condition is dynamically replaced by a differential equilibrium corresponding to a zero net rate of probability flux:
Here, remains a normalized probability vector with . The matrix equation corresponds exactly to a set of global balance equations stating firmly that the total probability flux leaving state strictly equals the total probability flux entering state from all other states combined.
This flux balance principle is absolutely foundational to modern queuing theory, stochastic chemical reaction networks, and biological population models, permanently bridging the highly abstract formulations of analytical probability into powerful mathematical tools used for rigorously evaluating complex dynamic system metrics over infinite continuous-time horizons.