News for hackers. Stuff that matters.
Re:Kullback–Leibler Divergence by jwarden on Wednesday August 23, 2023 @06:43AM (#37234006)
> Why is surprisal defined as `log (1/p(X=x)`?

Good question. It's because -log P(X) is the number of bits of information I would need to eliminate any surprise about the value of X.

For example, let's say X is the value of an 8-bit register, and each of the 2^8=256 possible values has a probability of 1/256. I would need to learn all 8 bits to know the value of X: so Surprisal(X=x) = -log P(X=x) = -log 1/256 = 8.

Suppose I learned only that X is odd, which is equivalent to learning that the last bit of the register is equal to 1. The probability that X is 1 is 1/2, and so I would need to be provided with -log P(X is odd) = -log 1/2 = 1 bit of information to learn that X is odd.

Information can be thought of as simply the elimination of uncertainty. So Surprisal (uncertainty) is basically a measure of information, but instead of how much information you have, it's how much information you need to eliminate all uncertainty.

There are no comments on this comment yet.