46.01.05 · information-theory / information-measures

Entropy Rates of Stationary Processes and the Entropy of Markov Chains

shipped3 tiersLean: none

Anchor (Master): Cover & Thomas 2006 Elements of Information Theory 2e (Wiley) §4.1-4.5; Shannon 1948 A Mathematical Theory of Communication §7; Kieffer 1974 On the Inverse Problem for Entropy Rates of Stationary Processes

Intuition Beginner

Imagine recording the weather every day for a year. Each day is sunny, cloudy, or rainy. If every day's weather were independent of the previous day, the total information in 365 days would just be 365 times the entropy of a single day. But weather is not independent — today's weather depends heavily on yesterday's. When outcomes depend on each other, there is less total information in a sequence than you would get by treating each observation as independent.

The entropy rate measures the average information per symbol in a long sequence of dependent observations. It answers: if you have already observed a million days of weather, how much new information does the next day bring? That new information is the entropy rate. For independent draws it equals the single-symbol entropy. For dependent draws it is strictly less, because the past already tells you something about the future.

A Markov chain is the simplest model of dependence: tomorrow's state depends only on today's state, not on any earlier history. For a Markov chain, the entropy rate has a clean formula. You average the uncertainty of the next step over the long-run proportion of time spent in each state. If a weather chain spends 60 percent of days sunny, 25 percent cloudy, and 15 percent rainy, the entropy rate is 0.6 times the entropy of "tomorrow given today is sunny" plus 0.25 times the entropy of "tomorrow given today is cloudy" plus 0.15 times the entropy of "tomorrow given today is rainy."

Why does this matter? The entropy rate tells you the compression limit for correlated data. English text has an entropy rate of about 1 to 1.5 bits per character, far below the 4.7 bits you would get from treating each character independently. The gap comes from the fact that letters strongly predict their successors. The entropy rate captures exactly how predictable a source is, and no compression scheme can beat it.

Visual Beginner

Figure: a two-state Markov chain with states A and B. State A has a self-loop with probability 0.8 and an arrow to B with probability 0.2. State B has a self-loop with probability 0.6 and an arrow to A with probability 0.4. Below the diagram: the stationary distribution is , . The entropy rate is bits per symbol.

Source type Entropy rate (bits/symbol) Intuition
Fair coin (independent) 1.00 Each flip gives one full bit
Loaded coin 90/10 (independent) 0.47 Each flip is somewhat predictable
Two-state Markov (sticky) 0.72 Past reduces uncertainty in the next symbol
Two-state Markov (nearly independent) 0.99 Weak dependence, rate close to single-symbol entropy
English text (estimated) 1.0-1.5 Letters strongly predict successors
Deterministic chain 0.00 The next state is fully known

The pattern: dependence between symbols reduces the entropy rate below the single-symbol entropy. The stronger the dependence, the larger the gap.

Worked example Beginner

Consider a two-state Markov chain for weather. State S (sunny) and state R (rainy). The transition probabilities are: if today is sunny, tomorrow is sunny with probability 0.7 and rainy with probability 0.3. If today is rainy, tomorrow is rainy with probability 0.6 and sunny with probability 0.4.

Step 1. Find the stationary distribution. The stationary distribution satisfies . Let and .

Solving: , so and .

Step 2. Compute the conditional entropy for each state. Given state S, the next state has distribution , so:

Given state R, the next state has distribution , so:

Step 3. Average over the stationary distribution:

What this tells us. Each new day's weather adds about 0.92 bits of information, given that you already know today's weather. Over 365 days, the total information is roughly bits. Compare this to 365 independent draws from the stationary distribution , which would give bits. The Markov dependence saves about 25 bits over a year, because knowing yesterday's weather partially predicts today's.

Check your understanding Beginner

Formal definition Intermediate+

Let be a discrete-time stochastic process taking values in a finite alphabet .

Definition (Entropy rate). The entropy rate of a stochastic process is

provided the limit exists, where is the joint Shannon entropy of the first symbols.

Theorem (Existence for stationary processes). If the process is stationary, then exists and equals

Proof sketch. Stationarity implies that the sequence of conditional entropies is non-increasing: conditioning on more variables reduces (or preserves) entropy, so . Since , the sequence converges to some limit . By the chain rule, . By the Cesaro mean theorem, the average of a convergent sequence converges to the same limit: . Hence both limits exist and are equal.

Definition (Entropy rate of a stationary Markov chain). For a stationary Markov chain with state space , transition matrix , and stationary distribution , the entropy rate is

This follows because for a first-order Markov chain, , so the conditional entropy does not decrease after the first step, and the entropy rate equals when the chain is in its stationary regime.

Counterexamples to common slips

  • Entropy rate is not . For a process with dependence, the entropy rate is the average new information per symbol given the entire past. It is always at most and equals it only when symbols are independent.

  • The limit may not exist for non-stationary processes. A process whose statistics drift over time (e.g., a source that becomes more random) need not have a well-defined entropy rate. Stationarity is what guarantees the limit exists.

  • A Markov chain must be in stationarity. The formula applies when the chain is started from (or has converged to) its stationary distribution . If you start from a different initial distribution, the per-symbol entropy converges to this rate as , but the finite- averages may differ.

Key theorem with proof Intermediate+

Theorem (Entropy rate of a stationary Markov chain). Let be a stationary first-order Markov chain with transition matrix and stationary distribution . Then

Proof. For a first-order Markov chain, the conditional entropy satisfies by the Markov property. By stationarity, for all . Therefore

Expanding the conditional entropy:

Bridge. The entropy rate formula is the load-bearing identity that connects the probabilistic structure of a Markov source to the information-theoretic compression limit. It builds toward the AEP for stationary ergodic sources 46.02.01 by establishing that the per-symbol entropy converges to a fixed constant, which becomes the exponent governing the typical set size. It appears again in the channel coding theorem 46.03.01 as the information rate that a channel can sustain, the foundational reason why Markov structure simplifies the capacity calculation. The formula generalises to hidden Markov models and processes with countable alphabets, and is dual to the thermodynamic entropy production rate in statistical mechanics, the central insight being that the entropy rate is the unique time-averaged information measure that is both operationally meaningful (compression limit) and mathematically well-behaved (Cesaro convergence) for any stationary source.

Exercises Intermediate+

Lean formalization Intermediate+

Mathlib does not define the entropy rate for stochastic processes. The components exist in isolation — ProbabilityTheory.Stationary for stationary distributions, PMF for probability mass functions, and basic entropy is absent entirely — but there is no functional defined on the space of stationary processes. The proof that is non-increasing relies on the conditioning-reduces-entropy inequality, which itself is unformalised. The specialization to Markov chains, where , requires the Markov property and the Cesaro mean convergence argument, neither of which exist in Mathlib. A Codex.InformationTheory.EntropyRate module defining the entropy rate on stationary processes and proving the Markov chain formula from the Cesaro convergence theorem would be the load-bearing first step; this unit ships without it.

Advanced results Master

The second law of thermodynamics for Markov chains

The entropy rate has a thermodynamic interpretation. For a Markov chain with transition matrix , define the conditional entropy of the transition from state as . The entropy rate is the stationary average .

If the chain is not started from the stationary distribution but from some initial distribution , the per-symbol entropy at time is

where is the distribution at time . The second-law interpretation says that for an irreducible aperiodic chain, and therefore . The entropy production rate converges to the stationary entropy rate.

More precisely, the conditional entropy increases monotonically if the chain is doubly stochastic (because the uniform distribution is stationary and the entropy under a doubly stochastic map increases), but this monotonicity does not hold in general. What does hold is the Cesaro convergence: the time-averaged entropy .

Functions of Markov chains and hidden Markov models

If is a Markov chain and for a function that is not injective, then is generally not a Markov chain. The process is a hidden Markov model (or function of a Markov chain). Its entropy rate satisfies by the data-processing argument in Exercise 7.

Computing exactly is substantially harder than for the underlying Markov chain. The conditional entropy does not stabilize at a fixed finite memory length, because has infinite-order dependence in general. Blackwell showed in 1957 that the entropy rate can be computed via a recursive update on the space of posterior distributions over the hidden state, but this space is continuous and the computation is generally intractable except for small state spaces.

Entropy rate and the Shannon-McMillan-Breiman theorem

For a stationary ergodic process, the Shannon-McMillan-Breiman theorem (the ergodic theorem for entropy) strengthens the AEP. It states that the normalized log-probability converges almost surely:

This is stronger than the convergence in probability given by the AEP. The proof uses the martingale convergence theorem applied to the conditional probabilities . For a stationary ergodic Markov chain, the result follows from the ergodic theorem applied to the function , giving

The time average of the per-state conditional entropies converges to the stationary average almost surely.

Entropy rate as a variational quantity

The entropy rate can be expressed as the solution to an optimization problem. For a stationary process on alphabet , the entropy rate is the infimum of over all , because the sequence converges to from above (the Cesaro mean of a non-increasing sequence converges from above). Equivalently, for any :

and the bound tightens as grows. This means that block-coding at block length achieves a compression rate at most , which approaches the entropy rate in the limit. The rate of convergence is governed by the information covariance , which measures the total long-range dependence.

Synthesis. The entropy rate is the unique time-averaged information measure that is both operationally meaningful (the compression limit for stationary sources) and mathematically well-behaved (Cesaro convergence of conditional entropies); for Markov chains it reduces to the stationary average , a weighted sum of per-state conditional entropies; the second-law interpretation says that a non-stationary start converges to the stationary entropy rate as the chain mixes, the central insight being that the entropy rate captures the irreducible uncertainty per symbol that no amount of knowledge of the past can eliminate; this generalises to hidden Markov models and general stationary ergodic processes via the Shannon-McMillan-Breiman theorem, putting these together the entropy rate becomes the fundamental limit for source coding, channel capacity, and rate-distortion in the correlated-source setting.

Full proof set Master

Proposition (Conditional entropy decreases to the entropy rate). Let be a stationary process. Then is non-increasing, for all , and as .

Proof. We show . By stationarity, the joint distribution of equals that of . Therefore

Now compare:

where the inequality holds because conditioning reduces entropy: adding to the conditioning set can only decrease the conditional entropy. Since and is non-increasing, converges to some limit .

To show : by the chain rule, (where ). Dividing by :

Since , the Cesaro mean also converges: . By definition, .

Proposition (Markov chain entropy rate: direct derivation). Let be a stationary first-order Markov chain on a finite state space with transition matrix and stationary distribution . Then

Proof. For a first-order Markov chain, the Markov property gives for all . Stationarity gives for all . Therefore the sequence is constant for : , and the entropy rate equals this constant.

Expanding the conditional entropy:

Under stationarity, , and . Substituting:

Proposition (Upper bound via marginal entropy). For any stationary process, , with equality iff the process consists of independent symbols.

Proof. By the previous proposition, and is non-increasing, so . Equality holds iff for all , meaning for all , which is equivalent to being independent of for all , i.e., the symbols are mutually independent.

Connections Master

  • 46.01.01 — The chain rule is the algebraic engine that decomposes joint entropy into a telescoping sum; the entropy rate is the Cesaro limit of those conditional entropies.
  • 37.05.01 — The Markov property and transition matrix are the probabilistic substrate on which the entropy rate formula is built.
  • 37.05.06 — Convergence to equilibrium ensures that , guaranteeing that the per-symbol entropy converges to the stationary entropy rate regardless of initial distribution.
  • 46.02.01 — The AEP for stationary ergodic sources uses the entropy rate as the exponent governing the typical set size; the convergence proved here is the foundation.
  • 46.02.02 — Shannon's source coding theorem for stationary sources proves that the minimum achievable compression rate equals the entropy rate ; this unit defines the quantity that theorem operationalizes.
  • 46.01.02 — The mutual information decomposition expresses the entropy rate in terms of mutual information, connecting the rate to the divergence calculus developed in that unit.

Historical & philosophical context Master

Claude Shannon introduced the entropy rate in Section 7 of his 1948 paper "A Mathematical Theory of Communication." His motivation was modeling natural language as a stochastic process. Shannon needed a single number that captured the per-symbol information content of English text, where the dependence between letters extends over many characters. The entropy rate was that number: by estimating the conditional entropy of the next character given increasing lengths of context, Shannon bounded the entropy rate of English between 0.6 and 1.3 bits per character. His experiments involved human subjects guessing the next letter of text; the guess accuracy provided a direct estimate of the conditional entropy.

The Markov chain entropy formula appeared in the same section. Shannon modeled English as a sequence of increasingly sophisticated Markov approximations: zero-order (independent letters), first-order (single-letter frequencies), second-order (digram frequencies), and so on. Each approximation's entropy rate provides an upper bound on the true entropy rate of English, and the sequence of bounds converges downward toward the actual rate. This methodology — approximating a complex source by Markov models of increasing order — became a standard tool in language modeling and data compression.

The connection to thermodynamics is not merely analogical. The entropy rate of a physical process governed by a Markov dynamics (e.g., a particle hopping between energy states in thermal contact with a heat bath) equals the thermodynamic entropy production rate divided by Boltzmann's constant, up to a change of logarithm base from base-2 to natural logarithm. The second law of thermodynamics — that the entropy of an isolated system does not decrease — corresponds to the information-theoretic fact that the conditional entropy is non-increasing for stationary processes. This connection was made rigorous by T. S. Han and K. Kobayashi in their work on the information-spectrum approach to entropy rates in the 1990s, and by M. Esposito and C. Van den Broeck in their 2010 analysis of entropy production as a conditional entropy in Markov jump processes.

The Shannon-McMillan theorem (1953, extended by Breiman 1957 to almost-sure convergence) generalized the entropy rate from Markov chains to arbitrary stationary ergodic processes, establishing that the normalized log-probability converges almost surely to the entropy rate. This result is the ergodic theorem of information theory and underpins the general theory of data compression for correlated sources.

Bibliography Master

@article{shannon1948,
  author  = {Shannon, C. E.},
  title   = {A Mathematical Theory of Communication},
  journal = {Bell System Technical Journal},
  volume  = {27},
  pages   = {379--423 and 623--656},
  year    = {1948},
}
@book{cover-thomas2006,
  author    = {Cover, T. M. and Thomas, J. A.},
  title     = {Elements of Information Theory},
  edition   = {2nd},
  publisher = {Wiley},
  year      = {2006},
}
@article{mcmillan1953,
  author  = {McMillan, B.},
  title   = {The Basic Theorems of Information Theory},
  journal = {Annals of Mathematical Statistics},
  volume  = {25},
  pages   = {239--274},
  year    = {1953},
}
@article{breiman1957,
  author  = {Breiman, L.},
  title   = {The Individual Ergodic Theorem of Information Theory},
  journal = {Annals of Mathematical Statistics},
  volume  = {28},
  pages   = {809--811},
  year    = {1957},
}
@article{blackwell1957,
  author  = {Blackwell, D.},
  title   = {The Entropy of Functions of Finite-State Markov Chains},
  journal = {Transactions of the First Prague Conference on Information Theory},
  pages   = {13--20},
  year    = {1957},
}
@article{kieffer1993,
  author  = {Kieffer, J. C.},
  title   = {A General Framework for the Study of Information Rates},
  journal = {IEEE Transactions on Information Theory},
  volume  = {39},
  pages   = {1253--1269},
  year    = {1993},
}
@article{esposito-vandenbroeck2010,
  author  = {Esposito, M. and Van den Broeck, C.},
  title   = {Entropy Production as Correlation Between System and Reservoir},
  journal = {Physical Review E},
  volume  = {82},
  pages   = {011143},
  year    = {2010},
}