Log Sum Inequality — Definition, Formula & Example
The log sum inequality is a bound for weighted sums of logarithms of ratios. If you add up the terms one at a time, the total is never less than the single term you get from pooling all the 's and all the 's first.
For nonnegative reals and , with and , the inequality states . The logarithm may have any base greater than 1. By convention and for . Equality holds if and only if is the same constant for every . Proof idea: is convex. Apply Jensen's inequality to at the points with weights . This gives , and multiplying both sides by gives the inequality.
Key Formula
Where:
- = Nonnegative numbers, often probabilities or counts from one distribution
- = Nonnegative numbers, often probabilities or counts from a second distribution
- = Number of terms being summed
- = Logarithm in any base greater than 1. Base 2 measures in bits and base e measures in nats.
Worked Example
Problem: Let and . Using base-2 logarithms, compute both sides of the log sum inequality and decide whether equality holds.
Step 1: Pool the numbers by finding the two totals.
Step 2: Compute the left side term by term. The first term is negative, but the sum is still large.
Step 3: Compute the right side from the pooled totals, then compare the two sides.
Answer: The left side is 22 and the right side is 10, so the inequality holds. It is strict because the ratios are and , which are not equal.
Why It Matters
In an information theory course, this inequality is the standard proof of Gibbs' inequality. If and are probability distributions, then , the right side becomes , and so the KL divergence . Applied to mixtures, the same inequality shows that KL divergence is jointly convex in the pair . That convexity underlies cross-entropy loss in machine learning and the cost of using the wrong code in data compression.
Common Mistakes
Mistake: Assuming every term must be nonnegative, or trying to prove the inequality one term at a time.
Correction: A single term can be negative. In the example above, the first term is . The inequality concerns only the total. A negative term appears whenever , and the bound comes from convexity applied to the whole weighted sum.
