The Machinery · Topic 14 of 20 · Information theory

Shannon entropy

Before asking how much quantum information is in a state, what does "how much information" even mean?

  1. 01
  2. 02
  3. 03
  4. 04
  5. 05
  6. 06
  7. 07
  8. 08
  9. 09
  10. 10
  11. 11
  12. 12
  13. 13
  14. 16
  15. 17
  16. 14
  17. 15
  18. 18
  19. 19
  20. 20
About this section: Information theory

Every topic so far has talked about qubits, measurement, and algorithms without ever asking the most basic question a communication engineer would ask first: how much information is actually here, measured in bits? That question has a classical answer nearly 80 years old, and a quantum generalisation that both agrees with it in the classical limit and produces one result with no classical analogue at all: the fact that a perfectly certain whole can have a genuinely uncertain half. This closes two loose threads left open on purpose: topic 02 promised the object entropy is computed from, and topic 07 promised the number that finally says how much two systems are entangled, not just whether they are.

See it

lopsided: p = 0.70, 0.15, 0.10, 0.05 H ≈ 1.32 bits flat: least predictable H = 2 bits (maximum)
Entropy is a single number measuring how spread out a distribution is. Nothing more mystical than that. A distribution that's almost certain to land on one outcome has low entropy; the flattest possible distribution over n outcomes has the highest entropy any distribution over n outcomes can have, exactly log₂n.

The intuition

Claude Shannon's 1948 answer to "how much information is in a message" was to measure the uncertainty it resolves, not its length. A message that could only ever have said one thing tells you nothing when it arrives. You already knew. A message drawn from many equally likely possibilities tells you a lot, because it rules out all the others. Entropy is that idea turned into a number, measured in bits: the expected number of yes/no questions it takes, on average, to pin down which outcome actually happened, under an optimal questioning strategy.

Two facts pin the scale down completely. A sure thing has H=0. No uncertainty, no questions needed. Spreading probability equally over n outcomes maximises the uncertainty and gives exactly H=log₂n, for n=2 (a fair coin), that's exactly 1 bit, which is where the unit gets its name. Every other distribution over the same n outcomes sits somewhere in between, never above that ceiling.

This is the classical benchmark the next topic generalises. It's also already implicit in something already on this page: phase estimation (topic 12) needs t counting qubits to resolve a phase to one of 2t possible outcomes: the same log₂ counting that says a message needs log₂n bits to distinguish n equally likely possibilities.

The mathematics

For a random variable X taking value i with probability pi, the Shannon entropy is:

H(X) = − Σᵢ pᵢ log₂ pᵢ (with 0·log₂0 defined as 0)

measured in bits. Two properties pin it down completely: H(X)≥0 always, with equality if and only if some pi=1 (no uncertainty); and H(X)≤log₂n for a variable with n possible outcomes, with equality if and only if the distribution is exactly uniform: spreading probability out can only ever increase or preserve entropy, never exceed the flat maximum. Verified numerically: uniform distributions over n=2,3,4,8 outcomes give H exactly log₂n (1.000000, 1.584963, 2.000000, 3.000000 bits); 1,600 random distributions across those same n never exceeded their ceiling. Shannon, Bell System Technical Journal 27, 379 (1948).

Where it actually matters

The floor under every compression and coding scheme that exists Shannon's source coding theorem says H(X) is the fewest bits per symbol any lossless compression scheme can average. Every zip file, video codec, and error-correcting code on Earth operates against this exact ceiling. The next topic asks the natural follow-up this whole site has been building toward: what happens to this number when the "outcome" isn't classical data at all, but a quantum state?