Let and on three outcomes. Compute , the cross-entropy , and both and in bits. What do the numbers show?
Probability and statistics, Information theory
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can evaluate entropy-type quantities by hand and know that KL is not symmetric.
Key idea
, , and .
Steps
- Entropy: bits.
- Cross-entropy: for every , so bits.
- KL from to : bits.
- KL the other way: bits.
- Read the results. Both KLs are positive, as they must be, and they are different (0.085 against 0.082), so KL is not symmetric. Also : coding with the wrong distribution costs extra bits.
Common mistakes
- Mixing natural logs and base-2 logs. Use one base throughout and say which.
- Calling KL a distance. It is not symmetric and does not satisfy the triangle inequality.
- Using for , which swaps the arguments.
How long your answer should be
Half a page, 3 minutes.
Last checked on 4 December 2026.
Read this
Previous in Probability and statistics: A non-negative random variable (say, the response time of a server) has mean and variance . Using Markov's and Chebyshev's inequalities, what bounds do you get for and for , and why is one bound much tighter?
Next in Probability and statistics: Two binary variables and have the joint distribution and . What is the mutual information in bits, and what would it be if and were independent?