In information theory, what does the Shannon entropy H(X) of a discrete random variable measure?
Show the answer and explanation
Correct answer: C, The average uncertainty, or expected information content, of an outcome, computed as −Σ p(x) log p(x).
Explanation Information Theory
Shannon entropy H(X) = −Σ p(x) log p(x) is the expected information content (surprise) of an outcome, i.e. how uncertain we are, on average, about the value of X before seeing it.
| Distribution | Entropy (bits) |
|---|---|
| one certain outcome | 0 |
| coin with p = 0.9 / 0.1 | ≈ 0.469 |
| fair coin | 1 |
| uniform over 4 values | 2 |
Why the other statements are wrong:
- Σ p(x)(x − μ)² is the variance; it depends on the numeric values of X, while entropy depends only on the probabilities.
- A dominant outcome means low entropy, not high: the more predictable X is, the smaller H(X).
- The number of values only sets the maximum entropy, log n, reached by the uniform distribution; a skewed distribution over the same values has lower entropy.
Interview tip: connect it to ML: decision trees using the entropy criterion pick splits that maximize information gain (the drop in entropy), and cross-entropy loss builds on the same quantity.