Contents / Information Theory / Entropy, Joint and Conditional Entropy
Chapter 1
Entropy, Joint and Conditional Entropy
What information means, how entropy measures it, and how entropy behaves when several random variables are considered together.
Introduction
What information means, how entropy measures it, and how entropy behaves when several random variables are considered together.
1.1Surprisal: What Information Should Mean
Before measuring information we must decide what we are measuring. Information theory takes the position that information is reduction of uncertainty: an outcome you were already certain of tells you nothing, and the more unexpected an outcome is, the more you learn from observing it. That single sentence, taken seriously, forces the logarithm on us.
Definition 1.1 (Surprisal (self-information)). Let be a discrete random variable with probability mass function . The surprisal of the outcome is
defined for every with .
Intuition. Surprisal answers "how astonished should I be?", measured in yes/no questions. If an event has probability , then narrowing the world down to that event is exactly the work of successive halvings — coin flips' worth of news. A certain event () costs bits, and an event of probability costs about bits.
Why the logarithm specifically? Because we want surprisal to be additive over independent observations: hearing two unrelated pieces of news should inform you by the sum of their separate amounts. Combined with monotonicity and a little regularity, additivity pins the function down completely.
Theorem 1.2 (The logarithm is forced). Suppose satisfies
- is monotone non-increasing (rarer events are no less informative),
- for all (independent events add), and
- is not identically zero.
Then there is a constant with for all . Normalising by gives , i.e. .
Proof. Put for . Condition (2) becomes , Cauchy's functional equation, and condition (1) makes monotone non-decreasing. Additivity gives for every positive integer , and forces for every positive rational . If is irrational, take rationals ; monotonicity gives , and letting and yields . Hence , that is, . Condition (3) forces and monotonicity forces ; set .∎
Note how little was assumed. We did not ask for continuity — monotonicity alone rules out the pathological additive functions — and we did not ask for any particular scale. The base of the logarithm is a choice of unit, not a piece of mathematics.
Notation. Base gives bits (also called shannons); base gives nats; base gives bans (or hartleys). Conversion is one multiplication, since :
Every identity and inequality in this chapter is base-independent, because changing base multiplies every term by the same positive constant.
Example 1.3 (Surprisal of a lottery ticket). A lottery has equally likely tickets. How many bits of information is the announcement "ticket #472913 won", and how many is "a ticket with an even number won"?
Solution. The winning ticket has probability , so
The second announcement has probability and so carries bit. The two are consistent with additivity: telling you the parity ( bit) and then the identity among the tickets of that parity ( bits) totals bits, exactly the surprisal of naming the ticket outright. □□
Pitfall. Surprisal is a property of the outcome; entropy is a property of the distribution. Asking "what is the information in this sentence?" is ambiguous until you say which ensemble the sentence was drawn from. A string of random digits has high surprisal under the uniform model and essentially none under a model that puts all its mass on that string.
1.2From Surprisal to Entropy: The Two Analytic Tools
Surprisal attaches a number to each outcome. To attach one number to the source, average:
That is entropy, formalised in the next section. Before studying it we install the two analytic tools that every proof in this chapter uses. Both are statements about the concavity of , and it is worth seeing them once, cleanly, so that later arguments can be one line long.
Theorem 1.4 (Jensen's inequality). Let be a concave function on an interval and let be a random variable taking finitely many values in . Then
If is strictly concave, equality holds if and only if is constant with probability . For convex the inequality reverses.
Proof. Induct on the size of the support. For both sides agree. Suppose the claim holds for supports of size , and let take values with positive probabilities . Write for , so , and set . Concavity applied to the two-point combination gives
and the induction hypothesis gives . Substituting,
For the equality case, strict concavity makes the two-point step strict unless , and the inductive step strict unless ; together these force all equal.∎
Intuition. A chord of a concave curve lies below the curve. Averaging the inputs and then bending () always lands at or above bending and then averaging (). Since is concave, "the log of an average is at least the average of the logs" — and that one sentence proves the information inequality, the bound , and the data processing inequality.
The second tool is a workhorse form of the same fact, tailored to ratios of non-negative numbers. It is what makes convexity arguments about relative entropy short.
Theorem 1.6 (Log-sum inequality). Let and be non-negative numbers, and write , . Then
with the conventions and for . Equality holds if and only if the ratio is the same for every .
Proof. Assume all ; terms with contribute nothing to either side, and a zero with makes the left side infinite. The function is strictly convex on , since its second derivative is . Apply Jensen's inequality in its convex form to the random variable taking value with probability :
Now , and . Multiplying through by gives exactly the claim. Strict convexity makes equality equivalent to the being constant.∎
Example 1.7 (Two pieces of logarithmic arithmetic). Convert bits to nats, then evaluate for and and check it against the log-sum bound.
Solution. Bits to nats divides by : nats.
For the sum, and , so
Here , so the log-sum bound reads , and indeed . The inequality is strict because . This instance is precisely the statement , proved in general in the relative entropy sections. □□
1.3What the Measures Are For, and What They Are Not
The quantities of this chapter are not free-floating definitions; each is the exact answer to an operational question. Stating those answers now explains why the definitions look the way they do, even though the full proofs belong to later chapters on source and channel coding.
Theorem 1.8 (Kraft inequality). A prefix-free binary code with codeword lengths exists if and only if
Proof. () Draw the infinite binary tree and let . A codeword of length occupies a node at depth , and the prefix-free condition says no codeword node is an ancestor of another, so the sets of depth- descendants of the codeword nodes are disjoint. The codeword of length has such descendants and there are nodes at that depth altogether, so , which is the claim.
() Sort the lengths and assign to the -th codeword the first binary digits of . The hypothesis keeps every partial sum below , and for the two partial sums differ by at least , so the -th codeword is not a prefix of the -th.∎
Kraft is the bridge between distributions and codes: given lengths satisfying the inequality, is a sub-probability distribution, and conversely any distribution suggests the lengths . Every statement about code lengths in this chapter is a statement about distributions in disguise.
Theorem 1.9 (Source coding theorem, one-shot form). Let have entropy and let be the minimum expected length of a prefix-free binary code for . Then
Proof. For the lower bound, let be any prefix-free code, put and . Then
which is non-negative because by Gibbs' inequality and .
For the upper bound take . These lengths satisfy Kraft, since and the sum to , and , so the expected length is below .∎
The trailing is the rounding loss from insisting on whole-bit codewords; coding blocks of symbols at a time divides it by , which is why entropy is the true limit asymptotically. The channel side of the theory has a matching statement, which we quote without proof.
Theorem 1.10 (Noisy channel coding theorem (quoted)). For a discrete memoryless channel with transition law , define the capacity
Then for every rate there are codes of rate whose probability of decoding error tends to as the block length grows, and for every the error probability is bounded away from .
Note. The converse half of this theorem is within reach of this chapter: it follows from the data processing inequality and Fano's inequality, both stated and proved below. The achievability half — that good codes exist — rests on a random coding argument and the joint asymptotic equipartition property, and is out of scope here.
Intuition. Two numbers govern the whole enterprise. Entropy is how much you must say; capacity , a maximised mutual information, is how much can be heard. Shannon's separation principle says that as long as you may compress down to and then protect the result up to , losing nothing by doing the two jobs separately.
Example 1.11 (Sizing a source). A source emits symbols A, B, C with probabilities . Estimate the size of a compressed file of symbols and exhibit a code that achieves it.
Solution. The entropy is
so symbols need about bits, or bytes. The code , , is prefix-free with expected length bits, meeting the bound exactly. Equality is possible here precisely because every probability is a power of , so the ideal lengths are already integers and nothing is lost to rounding. □□
Pitfall. Information measures say nothing about meaning, value, or truth. A megabyte of cryptographic noise has more entropy than a megabyte of Shakespeare, and a perfectly reliable channel carrying lies has full capacity. Shannon's framework deliberately quantifies only the statistical difficulty of reproducing a symbol stream.
1.4Definition of Entropy
Entropy is the central quantity of information theory: the average surprisal of a source, the number of bits per symbol that an ideal compressor needs, and — by the characterisation below — the only function of a distribution that behaves the way a measure of uncertainty ought to. This section and the two that follow define it, establish its structural properties, and develop the habits needed to compute it.
Definition 1.12 (Shannon entropy). Let be a discrete random variable with values in a countable alphabet and probability mass function . The entropy of is
When is infinite the series may diverge, in which case we write .
Notation. By convention , which is the limit of as . Outcomes of probability zero therefore contribute nothing, and the entropy of depends only on the list of positive probabilities — not on the alphabet from which they were drawn, not on their order, and not on the values the variable takes.
That last point deserves emphasis: is a function of , not of . The notation is traditional and convenient but slightly misleading; a fair coin labelled and a fair coin labelled have the same entropy, bit. This is exactly what distinguishes entropy from variance, which is sensitive to the numerical values and is not defined at all for an unordered alphabet.
Intuition. Entropy is average surprise, and equivalently the expected number of yes/no questions an optimal questioner needs to identify the outcome. For a source over four equally likely symbols, two questions always suffice and never fewer: . For the source with probabilities , the optimal strategy asks "is it the first symbol?" first and averages questions.
Example 1.13 (Entropy of a biased coin). Compute the entropy of a coin with .
Solution.
Sanity check: the answer lies strictly between (a two-headed coin) and (a fair coin), as it must for a biased but not deterministic coin. Operationally, a long sequence of these flips can be compressed to about bits per thousand flips. □□
The characterisation below explains why this particular formula, rather than some other decreasing function of predictability, is the measure of uncertainty. Its content is that entropy is forced by a grouping axiom: it should not matter whether you reveal an outcome all at once or in stages.
Theorem 1.14 (Shannon's characterisation of entropy (proof sketched)). Let be defined for every probability vector and suppose
- is continuous in ,
- is increasing in , and
- (grouping) for ,
Then for some constant .
Proof. Sketch. Write . Repeatedly applying the grouping axiom to split a uniform distribution on points into groups of gives , so is an additive, increasing function on the integers; the argument used for the surprisal characterisation gives . Grouping then extends this from uniform distributions to rational probability vectors, by realising a vector with denominators as a grouping of the uniform distribution on points, and continuity (1) passes to arbitrary real vectors. The full bookkeeping is standard but long, and we do not reproduce it; the essential step is the one displayed above.∎
Remark. Several inequivalent axiom sets give the same conclusion, and none of them is the reason entropy matters. The decisive argument is operational: Theorem Source coding theorem, one-shot form says entropy is the minimum achievable description length, and no other functional has that property. Axioms explain the formula; coding theorems justify it.
1.5Properties of Entropy
Everything in this section is proved from the definition together with Jensen's inequality. Each item will be used repeatedly later.
Theorem 1.15 (Range of entropy). Let take values in a finite alphabet . Then
The left equality holds if and only if is deterministic; the right equality holds if and only if is uniform on .
Proof. Each term is non-negative because makes , so . The sum vanishes only if every term does, i.e. every is or , which means is deterministic.
For the upper bound apply Jensen's inequality to the concave function and the random variable :
Since is strictly concave, the first inequality is an equality only when is constant, i.e. is uniform on its support, and the second only when the support is all of .∎
Intuition. Uncertainty is largest when you have no idea at all, and "no idea at all" means uniform. Entropy is bounded by the log of the number of possible outcomes, which is why an alphabet of symbols can never carry more than bits per symbol however cleverly it is used.
One special case of the entropy formula recurs so often that it gets its own symbol.
Definition 1.17 (Binary entropy function). For ,
the entropy of a single bit that equals with probability . It satisfies , , and .
Theorem 1.18 (Concavity of entropy). Regarded as a function of the probability vector on a fixed finite alphabet, is concave: for distributions and ,
Proof. The map is concave on , since its second derivative is . Entropy is the sum over of this concave function applied to the coordinate , and a sum of concave functions of an affine argument is concave. Explicitly, for each ,
and summing over gives the result.∎
Intuition. Mixing two sources cannot make the result more predictable than the average of the two, because a mixture hides which source produced each symbol — and that hidden label is itself uncertainty. The probabilistic reading is exact: if picks source or and is drawn from the chosen source, then , which is concavity restated.
Theorem 1.19 (Deterministic processing cannot increase entropy). For any function defined on the alphabet of ,
with equality if and only if is injective on the support of .
Proof. Let . Since is determined by we have , so the chain rule (Theorem Chain rule for entropy) gives
because conditional entropy is non-negative. Equality forces , i.e. is determined by almost surely, which for a deterministic means is injective on the support.∎
Pitfall. The inequality needs to be deterministic. If you add independent noise — with a random bit — then can exceed . Random processing can create entropy; it just cannot create information about , which is the content of the data processing inequality.
Example 1.20 (Where entropy sits for small alphabets). For which does a three-symbol source with probabilities have maximal entropy, and what is the maximum?
Solution. By Theorem Range of entropy the maximum over all distributions on three symbols is , attained only at the uniform distribution. The family contains the uniform distribution at , so the maximum over the family is at .
Checking directly: , and , which vanishes exactly when , i.e. . The two routes agree, and the derivative test confirms it is a maximum since changes from positive to negative there. □□
1.6Calculating Entropy
Method 1.21 (Computing an entropy from a pmf).
- List every outcome with positive probability and its probability .
- Compute the surprisal of each. (Useful values: , , , , .)
- Form the weighted sum .
- Check , where is the number of outcomes with positive probability, and check that is well below when the distribution is visibly lopsided.
A short table of reference values is worth memorising, because most exercises reduce to one of them.
| Distribution | Probabilities | Entropy (bits) |
|---|---|---|
| Deterministic | | |
| Fair coin | | |
| Biased coin | | |
| Uniform on | | |
| Dyadic | | |
| Uniform on | | |
Example 1.22 (A four-symbol source). Symbols occur with probabilities . Find .
Solution. The surprisals are , , , bits. Weighting,
Sanity check: , with the gap from reflecting the mild non-uniformity. □□
Infinite alphabets need a closed form rather than a table. The geometric distribution is the standard example, and its entropy is computable exactly.
Proposition 1.23 (Entropy of a geometric distribution). Let for , with . Then
where is the binary entropy function.
Proof. Write . Then
The second piece sums to since the probabilities total . For the first, . Hence
Example 1.24 (Reading the geometric formula). How many bits are needed on average to encode the number of fair coin flips until the first head?
Solution. Here , so bits. The unary code — zeros followed by a one — has expected length bits and is therefore optimal, which we can confirm against the source coding theorem: . Equality is possible because every probability is dyadic. □□
Intuition. Two forces set the size of : how many outcomes are in play (which raises the ceiling ) and how unevenly the mass is spread (which pushes below the ceiling). A distribution over a million symbols with of its mass on one of them has entropy well under a bit.
1.7Joint Entropy
A source rarely emits one symbol in isolation. Joint entropy extends to a vector of random variables and is the quantity that the rest of this chapter, and the chapters that follow it, are built on: conditional entropy, mutual information, and entropy rate are all differences of joint entropies.
Definition 1.25 (Joint entropy). Let be a pair of discrete random variables with joint pmf . Their joint entropy is
More generally, for ,
There is nothing new here: is the ordinary entropy of the single random variable taking values in . Everything proved for therefore applies at once — it is non-negative, it is bounded by of the size of the joint support, and it is concave in the joint distribution.
Intuition. Treat the pair as one bigger die. is the average surprise of seeing both coordinates at once, or equivalently the number of bits a compressor needs per pair. If the two coordinates are related, many cells of the table are empty or nearly so, and the pair is cheaper to describe than the two coordinates separately.
Example 1.26 (Independent versus coupled bits). Compute for (a) two independent fair bits, and (b) the pair with , .
Solution. (a) All four cells have probability , so bits.
(b) Two cells hold and two hold :
Both marginals are fair bits in each case, so both pairs have . The coupled pair costs bits rather than — the -bit saving is exactly the mutual information we compute later. □□
Pitfall. To evaluate you must use the joint probabilities , never the product of the marginals. Substituting the product silently computes , which is an upper bound and is correct only under independence.
1.8Joint Entropy Against Its Marginals
Two bounds sandwich the joint entropy between the largest marginal and the sum of the marginals. The lower bound says adding a variable never helps; the upper bound — subadditivity — says dependence always saves.
Theorem 1.27 (Subadditivity and monotonicity). For any pair of discrete random variables,
The left equality holds iff one variable is a deterministic function of the other (specifically iff almost surely); the right equality holds iff and are independent.
Proof. Lower bound. is a function of the pair , so Theorem Deterministic processing cannot increase entropy gives ; the same applies to . Equality requires that be recoverable from , i.e. is determined by .
Upper bound. Compute the difference directly:
by Gibbs' inequality, since is a probability distribution on . Gibbs' equality case forces everywhere, i.e. independence.
(To see the first equality, expand using : , and similarly for .)∎
Intuition. Describing and separately costs bits. Describing them together can only be cheaper, because a joint description can exploit the fact that some combinations never occur. The saving is the mutual information, and it is zero exactly when there is nothing to exploit.
Example 1.28 (When the joint collapses to a marginal). Let be uniform on and . Verify both bounds.
Solution. and , since is a fair bit. The joint puts mass on each of and zero elsewhere, so bits.
Lower bound: — equality, exactly as predicted, because . Upper bound: — strict, because the variables are as dependent as possible. The shortfall bit is : knowing resolves entirely. □□
The upper bound extends to any number of variables, and the proof is a clean induction once the chain rule is available.
Corollary 1.29 (Independence bound). For any ,
with equality if and only if the are mutually independent.
Proof. By the chain rule, , and each term satisfies by Theorem Conditioning reduces entropy. Summing gives the bound. Equality requires every term to be tight, i.e. independent of for each , which is exactly mutual independence.∎
1.9The Chain Rule
The chain rule is the single most used identity in the subject. It is the entropy translation of the probability factorisation , and it turns every joint quantity into a telescoping sum of one-symbol conditional quantities.
Theorem 1.30 (Chain rule for entropy). For discrete random variables ,
where the term is . In particular .
Proof. For the two-variable case, factor the joint pmf and split the logarithm:
The first sum is , and the second is by definition. Symmetry of in its arguments gives the other factorisation.
For general , induct. Applying the two-variable rule with and ,
and the induction hypothesis expands the first term. Alternatively, write , take , and average.∎
Intuition. Describe the sequence one symbol at a time. The first symbol costs bits; after that, each symbol costs only what is still unknown about it given everything already sent. Total cost is the sum — and it is the same total whatever order you choose to send them in, which is a genuinely useful degree of freedom.
Corollary 1.31 (Conditional chain rule). For discrete , , ,
Proof. Apply the two-variable chain rule to the conditional distribution given , obtaining , then average over with weights . Each term averages to the corresponding conditional entropy by definition.∎
Example 1.32 (Chain rule in both directions). Suppose , and bits. Find and , and say which variable is more informative about the other.
Solution. Rearranging the chain rule, bits and bit.
The reductions are what matter: and . They agree, as they must — both equal bit. So neither variable is more informative about the other; mutual information is symmetric even though the conditional entropies differ. The asymmetry in versus reflects only that was more uncertain to begin with. □□
Pitfall. Do not read " " as " tells you more about than does about ". Conditional entropies measure what is left over, and are not comparable across variables with different marginal entropies. The symmetric measure of shared information is .
1.10Definition of Conditional Entropy
Conditional entropy measures how much uncertainty about survives once has been observed. It is the information-theoretic counterpart of residual variance in regression, and it is the quantity that turns entropy from a static measure of a source into a measure of prediction difficulty.
There are two objects here, and keeping them apart prevents most of the errors people make with conditional entropy.
Definition 1.33 (Conditional entropy). For a fixed value with , the entropy of the conditional distribution is
The conditional entropy of given is its average over :
is a function of — a different number for each observation. is a single number, the -weighted average. The theorems of this chapter are about the average; none of them holds value by value.
Note. By the chain rule, , and in practice this is usually the fastest route to a number: build the joint, take the marginal, subtract. The definitional form is the one to use when the conditional distributions are what you are given, as with a channel specified by its transition probabilities.
Intuition. After looking at , how many more bits do you still need to pin down ? If is the month and tomorrow's temperature, is the uncertainty left after the calendar has told you what it can. A perfect predictor drives it to ; a useless one leaves it at .
Example 1.34 (An asymmetric channel). Let be a fair bit. If then with certainty; if then is an independent fair bit. Find , , and .
Solution. Value by value: because is deterministic there, and . Averaging,
The joint pmf is , , , so bits. Since , the chain rule confirms .
Going the other way: and , so bits and bits.
Sanity check: both conditional entropies are non-negative and each is below the corresponding marginal ( and ), and the two reductions agree: and . That common value is . □□
Example 1.35 (The deterministic extreme). If exactly, then given the variable is a point mass, so for every and hence . More generally if and only if is a deterministic function of with probability .
Solution. One direction is the computation above. Conversely, forces for every with , since the average of non-negative numbers vanishes only when each does; and an entropy vanishes only for a point mass (Theorem Range of entropy). So for each such there is a value with , and almost surely. □□
1.11Conditioning Reduces Entropy, and Fano's Inequality
Theorem 1.36 (Conditioning reduces entropy). For any discrete , ,
with if and only if and are independent. More generally, conditioning on more can only help:
Proof. Non-negativity is immediate, since is an average of entropies and each is non-negative. For the upper bound, subadditivity (Theorem Subadditivity and monotonicity) gives , and the chain rule rewrites the left side as ; cancelling leaves . The equality case is the equality case of subadditivity, namely independence.
For the second claim, apply the first to the conditional distributions given : holds for each . Averaging over gives ; relabelling the roles of and gives the stated form.∎
Pitfall. "Conditioning reduces entropy" is a statement about the average , not about individual values. It is entirely possible that for some particular : a specific observation can leave you more confused than you were. Concretely, let with , and with . Then , so , while . The average is safe: .
Intuition. Data can only help on average. A measurement that turns out to be misleading is always possible, but the ensemble of measurements you might have made cannot, in aggregate, make you worse off — because the prior is itself the average of the posteriors.
The most important consequence of conditional entropy is a quantitative link between uncertainty and guessing error. If is large, no estimator of from can be reliable. Fano's inequality makes this precise and is the engine of every converse in information theory.
Theorem 1.37 (Fano's inequality). Let take values in a finite alphabet , let be any random variable, and let be any estimator of computed from . Write . Then
Consequently
Proof. Introduce the error indicator , a random variable determined by . Expand with the conditional chain rule in two ways:
the last term vanishing because is a function of , and the first being at most since conditioning reduces entropy.
For the middle term, split on the value of :
Given we have , so that entropy is . Given and , the variable ranges over the values other than , so its entropy is at most . Hence and
Finally, since is a function of , conditioning on is at least as informative as conditioning on : , the equality because adds nothing to and the inequality because conditioning reduces entropy. The weaker second form follows from and , and rearranging gives the bound on .∎
Intuition. Fano says uncertainty is a floor on error. If, after seeing everything you get to see, one bit of uncertainty about a binary remains, then no decision rule can do better than coin-flipping. Turned around: a decoder that is nearly always right is proof that almost no conditional entropy was left.
Example 1.38 (Fano in action). A message is uniform on possibilities. After a noisy observation , the residual uncertainty is bits. What does Fano guarantee about the error probability of the best possible decoder?
Solution. With so , the weak form gives
So every decoder errs at least of the time. The sharper form gives a slightly better bound: at the right side is , while at it is , so in fact . Sanity check: bits and means the observation conveyed bits — half the message — and half a message is not enough to decode it. □□
1.12Chain Rules and the Algebra of Conditioning
Every identity in this chapter survives the addition of a conditioning variable. That is worth stating as a principle, because it lets you re-derive conditional versions of results rather than memorising them.
Proposition 1.39 (Conditioning principle). Let be any identity or inequality between information measures that holds for all distributions. Then the statement obtained by appending " " to every measure in also holds.
Proof. Apply to the conditional distribution given , which is a genuine probability distribution for each with . This yields the statement with every measure replaced by its "given " version. Each conditional measure given is by definition the -average of these, and averaging preserves both equalities and inequalities of a fixed direction.∎
So, for example, from we get , and from we get , with no further work.
Theorem 1.40 (Chain rule, conditional form). For and any ,
Proof. Immediate from the chain rule (Theorem Chain rule for entropy) and the conditioning principle.∎
Pitfall. The conditioning principle does not say that conditioning preserves the value of a quantity, and in particular it does not say that conditioning reduces mutual information. It is a fact that , but can be either larger or smaller than — see the discussion of conditional mutual information in the next part. Conditioning on a common effect creates dependence where none existed.
Example 1.41 (Expanding a three-variable joint entropy). A system has , , bits. Find , and give an upper bound on .
Solution. The chain rule expands directly in the given order:
For , conditioning reduces entropy gives , which is a lower bound; the requested upper bound comes from monotonicity, bits. Both are attainable in principle: when is independent of , and only if is a function of . □□
Summary. The core identities so far, all proved above:
with equality in the last display exactly under mutual independence, and Fano's inequality linking residual entropy to unavoidable error.
- Confusing information with meaning or importance. Entropy measures statistical unpredictability. A random digit string can have maximal entropy and no significance whatsoever.
- Reading a surprisal as an entropy. is attached to one outcome; is its average. The rare outcome of a near-deterministic source has enormous surprisal while the source itself has almost no entropy.
- Forgetting to fix a base. Mixing and in one calculation produces answers off by the factor . Fix the base at the start and state the unit with every number.
- Treating entropy as a property of a particular string. Entropy belongs to a distribution; the individual-string analogue is Kolmogorov complexity, a different and uncomputable quantity.
- **Expecting a symbol code to reach exactly.** The gap in is real and closes only when the probabilities are dyadic, or in the limit of long blocks.
- Quoting capacity as a property of the input. maximises over inputs; it is a property of the *channel*.
- Dropping the minus sign. is negative; entropy is its negative. If your answer is negative, you dropped the sign.
- **Leaving undefined in code.** Mathematically it is ; in a program it is `NaN`. Guard the zero-probability terms explicitly.
- **Confusing the entropy of with a statistic of a sample.** is a functional of the distribution. What you compute from a finite sample is an *estimate*, and the plug-in estimate is biased downwards.
- Assuming the maximum entropy on an alphabet is always attained. It is — at the uniform distribution — but only when the whole alphabet is in the support. A distribution supported on of symbols is capped at , not .
- Thinking entropy measures spread in the numerical sense. Relabelling the outcomes changes the variance and leaves the entropy untouched.
- Using the single-symbol entropy for a source with memory. That is an upper bound on the true per-symbol cost; the entropy rate of the final sections is the correct quantity.
- **Writing unconditionally.** That is the independence case only; in general the sum is an upper bound.
- Confusing joint entropy with mutual information. is the total; is the overlap.
- **Assuming the joint support is the full product . ** Dependence empties cells, and can be far below .
- Reversing the chain rule. It is , never . Check that the conditioning variable is the one already "paid for".
- Expanding in an order that makes life hard. The chain rule holds in every order; choose the one whose conditionals you actually know.
- Forgetting that the chain rule conditions gracefully. Every identity here remains true with an extra attached to every term.
- **Believing can be negative.** It is an average of entropies and so is always . (Its continuous analogue, conditional *differential* entropy, genuinely can be negative — see the final section.)
- **Confusing with . ** The first is what is left; the second is what was removed. They sum to .
- **Computing from marginals.** You need or the joint. No function of and alone determines .
- **Generalising from a single . ** may exceed ; only the average cannot.
- **Reading as "every determines ".** It means that for -almost every the conditional law is a point mass; values of probability zero are unconstrained.
- Applying Fano without checking the alphabet. The bound involves ; for a binary that term vanishes and Fano reduces to , which is much sharper than the generic form.