Surprise, bits and entropy

Claude Shannon measured information as surprise. An outcome of probability p carries log₂(1/p) bits, and the average surprise, entropy, is a hard limit on how far any message can be compressed.

40 min

After this lesson you can

  • Compute the surprise of an outcome and explain why it has to be a logarithm
  • Compute the entropy of a distribution and say when it is largest and smallest
  • Explain entropy as the number of yes/no questions an optimal strategy needs, on average (the source coding theorem, informally)
  • Build a Huffman code and compare its average length with the entropy

In this lesson

  1. The engineer’s question
  2. Why a logarithm?
  3. From possibilities to probabilities: surprise
  4. Entropy: the average surprise
  5. Twenty questions
  6. The limit: Shannon’s source coding theorem
  7. The code
  8. In the papers

This lesson is part of Descent Pro

Descent Pro unlocks every lesson on the route, from base camp to the summit. Every plan starts with a free trial.

Descent Pro

Start your free trial to keep reading

This lesson, and every other lesson on the route, is part of Descent Pro. Every plan starts with a free trial, and students with a .edu email get longer. Cancel before the trial ends and you pay nothing.