Skip to main content
KetQat

Appearance

Definition · introductory

Relative entropy (Kullback–Leibler divergence)

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 pp and qq on a finite set X\mathcal{X}, the relative entropy of pp with respect to qq is

D(p∥q)=∑x∈Xp(x)log⁡2p(x)q(x),D(p \Vert q) = \sum_{x \in \mathcal{X}} p(x) \log_2 \frac{p(x)}{q(x)} ,

with the conventions 0log⁡(0/q)=00 \log(0/q) = 0 and plog⁡(p/0)=+∞p \log(p/0) = +\infty for p>0p > 0. Thus D(p∥q)<∞D(p \Vert q) < \infty exactly when the support of pp is contained in the support of qq. It is the expectation under pp of the log-likelihood ratio log⁡2(p(X)/q(X))\log_2(p(X)/q(X)).

D(p∥q)≥0D(p \Vert q) \ge 0 with equality iff p=qp = q (Gibbs' inequality), but DD is not a metric: in general D(p∥q)≠D(q∥p)D(p \Vert q) \ne D(q \Vert p) and the triangle inequality fails. Entropy and mutual information are special cases: for uu uniform on X\mathcal{X}, H(p)=log⁡2∣X∣−D(p∥u)H(p) = \log_2\abs{\mathcal{X}} - D(p \Vert u), and I(X;Y)=D(pXY∥pX⊗pY)I(X; Y) = D(p_{XY} \Vert p_X \otimes p_Y). It is jointly convex in (p,q)(p, q) and cannot increase when the same stochastic map is applied to both arguments.

Operationally, D(p∥q)D(p \Vert q) is the optimal exponent with which the probability of mistaking qq for pp (accepting pp when the nn samples come from qq) decays while the error probability under pp 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.
Mentioned in

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. S. Kullback, R. A. Leibler (1951). On Information and Sufficiency. The Annals of Mathematical Statistics 22, 79-86. doi:10.1214/aoms/1177729694
  2. Thomas M. Cover, Joy A. Thomas (2005). Elements of Information Theory. Wiley (2nd edition). doi:10.1002/047174882X

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. 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

  1. 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).