The expected log-likelihood ratio between two probability distributions. It is nonnegative, zero only for equal distributions, not symmetric, and infinite when the first distribution puts weight where the second has none; it is the error exponent of hypothesis testing.
Established definitionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01
AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.
For probability distributions p and q on a finite set X, the
relative entropy of p with respect to q is
D(p∥q)=x∈X∑p(x)log2q(x)p(x),
with the conventions 0log(0/q)=0 and plog(p/0)=+∞ for p>0. Thus
D(p∥q)<∞ exactly when the support of p is contained in the support of q.
It is the expectation under p of the log-likelihood ratio log2(p(X)/q(X)).
D(p∥q)≥0 with equality iff p=q
(Gibbs' inequality), but D is not a metric: in general
D(p∥q)=D(q∥p) and the triangle inequality fails. Entropy and mutual
information are special cases: for u uniform on X,
H(p)=log2∣X∣−D(p∥u), and
I(X;Y)=D(pXY∥pX⊗pY). It is jointly convex in (p,q) and
cannot increase when the same stochastic map is applied to both arguments.
Operationally, D(p∥q) is the optimal exponent with which the probability of
mistaking q for p (accepting p when the n samples come from q) decays while the
error probability under p is kept bounded (Stein's lemma, chapter 11 of
Cover and Thomas). The quantity was introduced by
Kullback and Leibler. The quantum generalisation is the
quantum relative entropy, with the corresponding
quantum Stein lemma.
Holds when
Distributions on a finite set; logarithms base 2 unless stated.
Claude (AI drafting assistant)Writing, original draft (CRediT roles)
Review history
Automated source check · Pass with notes · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)
Definition, support condition, Gibbs, asymmetry, the entropy and mutual-information special cases (checked numerically), joint convexity and data processing compared with Polyanskiy and Wu, Information Theory: From Coding to Learning (authors' open PDF) chapters 2-3 and 7; Stein's lemma direction compared with the same book, Theorem 14.14 (type-I error held fixed under P, type-II error under Q decays with exponent D(P||Q)). Cover and Thomas chapter 11 title confirmed via Crossref; Crossref metadata for Kullback-Leibler (1951) matches the entry.
The operational sentence said D(p||q) is the exponent of the probability of 'mistaking p for q', which is the error that Stein's lemma keeps bounded. Reworded to mistaking q for p (accepting p when the samples come from q), with the error under p kept bounded.
Revision history
2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
Current revision a1598d436ea8b4a9. Source file knowledge/records/definition/classical-relative-entropy.md in the content repository (readable there once it is public).