Can someone give me an example of how -logp(x) works?

47 Views Asked by At

I'm studying information theory and I was reading that you receive more information from $-\ln p(x)$ when $p(x)$ is small. So from my understanding from an event happening that has a low likelihood gives a lot of information. How is this information quantified and why does $-\ln p(x)$ of a probability show this? Can someone give me an example to better my understanding?

1

There are 1 best solutions below

3
On BEST ANSWER

A coin flip has $p=\frac 12$, so the information it gives you is $-\log_2(\frac 12)=1$ bit. If you flip three coins and get the result, each result has a chance of $\frac 18$ and $-\log_2(\frac 18)=3$, so you have gotten three bits of information. We use the log so the information adds when the probabilities multiply.