MODULE 01 · LESSON 06
Entropy
Entropy measures uncertainty. KL divergence compares two probability distributions.
PLAIN-LANGUAGE INTRODUCTION
What is this?
Entropy measures uncertainty. KL divergence compares two probability distributions.
One simple example
Use coin probabilities p=[0.75,0.25] and q=[0.5,0.5]. Then H(p)=0.811 bits and KL(p||q)=0.189 bits.
What goes in?
Probability lists whose values add to 1.
What comes out?
Uncertainty for one list or extra coding cost between two lists.
Why does it matter?
These measures describe uncertain targets and mismatched model probabilities.
What is it not?
KL divergence is not symmetric. Swapping p and q can change it.
WORK THROUGH THE IDEA
See the idea in more detail
- A probability states how often an outcome is expected. Here, heads has
0.75. Tails has0.25. - Entropy uses
H(p) = −Σ p log₂ p. The symbolΣmeans add one term per outcome. - For
p, entropy is about0.811bits. The fair distributionqhas1bit. - Using
qfor outcomes frompcosts1bit. The extra cost is1 − 0.811 = 0.189bits. - Common mistake: KL is not an ordinary distance. Its direction matters.