For two variables with joint distribution and marginals and , derive the identity Use the identity to prove that , with equality exactly when the variables are independent. Then evaluate the mutual information for a hundred rows in a table with cells 50, 10, 10 and 30, read row by row, to four decimal places.
Worked solution
Write each entropy as a sum over the joint table. The marginal is and is the same with . The joint entropy is Substituting into gives The bracket is the logarithm of a product divided by a product, so This is exactly the KL divergence between the true joint table and the product of the marginals.
For non-negativity, work in natural logarithms and call the right-hand side . Then where the inequality is applied to each term, or equivalently Jensen's inequality for the concave logarithm. Hence . Equality in holds only at , so every cell with must satisfy . The two distributions share their marginals, so the remaining cells are forced to match as well. That is the definition of independence.
Now evaluate the table. The cells are , , and . Both marginals are and , so The joint entropy is The terms are , , and , so Therefore which rounds to . The product model assigns , , and to the four cells. The KL divergence from the true table to that product is which equals the same . Section 16.2 defines the divergence; section 16.3 uses it to read mutual information as the cost of assuming independence. The derivation shows that the two sections describe one quantity, not two.