Skip to content
Infinitesimal Dynamics home
Notebook: 0 XP

Information Theory / Measuring information

Entropy

The average surprise of a source, and the number of yes-or-no questions needed to pin down its output.

3 min read · 2 sections · 2 checks

Contents 3 sections
  1. §1Average surprise
  2. §2Twenty questions
  3. ?Check yourself

By the end you can

  • Compute Shannon entropy
  • Identify the distributions with maximum and minimum entropy
  • Interpret entropy as average question count

Helps to know: Information and Surprise

§1Average surprise

H(X)=−∑xp(x)log⁡2p(x)H(X) = -\sum_x p(x) \log_2 p(x)

Entropy is zero when the outcome is certain and largest, log⁡2n\log_2 n, when all nn outcomes are equally likely. A biased coin that lands heads 90% of the time has entropy only 0.470.47 bits.

Preparing the instrument…
Fig. 1 Type into the box: the entropy of your text updates letter by letter.

§2Twenty questions

To identify a uniformly random whole number from 1 to 64, halving the range each time takes exactly 6=log⁡2646 = \log_2 64 yes-or-no questions. In general, the entropy is the minimum average number of well-chosen binary questions needed to determine the outcome, up to less than one extra question.

Check yourself

  1. Q1
    The entropy of a fair 8-sided die is…
  2. Q2
    Which source has the lowest entropy?