This page builds every piece of notation the parent note topic note leans on, starting from a smart 12-year-old who has never seen a ∑ sign. Read it top to bottom; each symbol is earned before it is used.
Before any formula, we need the raw material: probability.
The picture. Imagine a bar of total length 1. You cut it into pieces, one piece per possible outcome. The width of a piece is its probability. All widths together must exactly fill the bar — nothing missing, nothing overflowing.
Why the topic needs it. Entropy and KL divergence are averages weighted by these widths. A wide (likely) outcome pulls the average toward its value; a thin (rare) outcome barely nudges it. Without probabilities there is nothing to weigh.
Read x∈X as "x is one item chosen from the list X." The symbol ∈ just means "belongs to."
The picture.X is the set of labels written under each slice of the certainty bar in §1. If the bar has three slices, then X={sun,rain,snow} and ∣X∣=3 — the vertical bars ∣⋯∣ mean "count how many items are inside."
Why the topic needs it. The maximum-entropy property H(X)≤log2∣X∣ literally counts how many outcomes exist. That ∣X∣ is exactly this list-length.
This is the tool the whole topic is built on, so we install it carefully.
Examples you can check by hand:
log21=0 (already there, no doublings).
log22=1, log24=2, log28=3.
log221=−1 (one halving — negative because we shrank).
The additivity that earns the log. If event x has probability p and independent event y has probability q, the pair happens with probability p⋅q. Then
−log2(p⋅q)=−log2p+(−log2q).
Surprise of the pair = surprise of each, added. That single line is why −log2p (called surprisal) is the right meter, and why log sits at the heart of entropy.
The picture. Rare slice (thin, small p) → tall surprise spike. Certain slice (p=1) → flat zero. Plot surprisal against probability and you get a curve diving to 0 at p=1 and shooting to +∞ as p→0.
Why the topic needs it. Entropy is nothing but the average of these spike heights, and cross-entropy is the average of spikes computed with the wrong meter — so surprisal is the atom both are built from.
The picture. Balance point of a see-saw: place a weight p(x) at position f(x) for every outcome; the expectation is where the plank balances. Wide slices sit heavier and drag the balance toward their value.
Why the topic needs it. With this one symbol the parent's two headline formulas collapse into plain English:
H(X)=Ex∼p[I(x)](average surprise),DKL(p∥q)=Ex∼p[logq(x)p(x)](average wasted surprise).
The picture. Two certainty bars stacked. Where the q-slice is narrower than the p-slice, your model under-expects a common event — and you pay for it. KL divergence is the running tally of that payment.
The picture. As a slice's width shrinks toward zero, its surprisal spike grows tall, but the width multiplying it shrinks faster — the product (a thin, tall sliver of area) collapses to nothing. The see-saw feels no weight from a zero-width slice.
This map shows the dependency order used above: probabilities and logs are the roots; expectation fuses surprisal into entropy; two distributions plus the log-ratio give KL divergence; both feed the parent topic. Downstream, these same tools power Cross-Entropy Loss, Mutual Information, Information Gain, the Maximum Entropy Principle, Jensen-Shannon Divergence, F-divergences, and the Evidence Lower Bound (ELBO) used in Variational Autoencoders.