Skip to content
← All questions

How is the KL-divergence expression for mutual information expanded into a sum?

The KL-divergence expression is expanded by applying the standard definition of discrete KL divergence. By setting P=p(x,y)P = p(x,y) and Q=p(x)p(y)Q = p(x)p(y), the divergence becomes a sum over all pairs (x,y)(x,y) in the joint support of the joint probability times the logarithm of the ratio of the joint probability to the product of the marginals.

Conditions

  • The derivation is for discrete distributions using probability mass functions.
  • The logarithm base is not explicitly stated in the expanded sum, though earlier entropy used base 2.
  • The ratio form requires p(x,y)>0p(x,y)>0 and p(x)p(y)>0p(x)p(y)>0 on the summed support.

Reasoning, step by step

  1. Start with the KL divergence formula DKL(P∣∣Q)D_{KL}(P || Q).
  2. Substitute P=p(x,y)P = p(x,y) and Q=p(x)p(y)Q = p(x)p(y).
  3. Apply the discrete summation definition: ∑x,yP(x,y)log⁡P(x,y)Q(x,y)\sum_{x,y} P(x,y) \log \frac{P(x,y)}{Q(x,y)}.
  4. Write the expanded form: ∑x,yp(x,y)log⁡p(x,y)p(x)p(y)\sum_{x,y} p(x,y) \log \frac{p(x,y)}{p(x)p(y)}.

Example

The video displays the expansion: =∑x,yp(x,y)log⁡p(x,y)p(x)p(y)=\sum_{x,y} p(x,y)\log \frac{p(x,y)}{p(x)p(y)}, which the narrator explains as the joint-weighted average log-ratio between the true joint and the independent reference law.

Common misconceptions

  • Assuming the sum is over only xx or only yy; it is a double sum over all pairs (x,y)(x,y).
  • Forgetting that the logarithm applies to the entire ratio p(x,y)p(x)p(y)\frac{p(x,y)}{p(x)p(y)}, not just the numerator.

Watch the explanation

Connected concepts

Explore next

Related questions

Meet the concept

↗
Understand why

↗
Meet the concept

↗
Understand why

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.