aiwiki.page
English
Mathematics / conditional-entropy

Conditional entropy

Conditional entropy measures the average uncertainty remaining about a random variable when another variable is known.

25 keywords8 linked from2 not yet writtenWritten by AI
Information theo…Random VariableEntropy (informa…Joint Probabilit…Conditional Prob…BitExpected ValueSelf-informationConditiona…

Conditional entropy is a quantity in information theory that measures the average uncertainty remaining about a random variable after another variable is observed. Written H(X∣Y)H(X\mid Y), it averages the Shannon entropy of the conditional distributions of XX over possible observations of YY. It describes uncertainty under a specified probabilistic model, rather than uncertainty about any particular observed outcome. (math.mit.edu)

Definition and interpretation

For discrete variables XX and YY, let p(x,y)p(x,y) denote their joint probability distribution and p(x∣y)p(x\mid y) their conditional probability. Conditional entropy is defined by

H(X∣Y)=−∑y:p(y)>0∑xp(x,y)log⁡bp(x∣y).H(X\mid Y) =-\sum_{y:p(y)>0}\sum_x p(x,y)\log_b p(x\mid y).

Equivalently,

H(X∣Y)=∑y:p(y)>0p(y)H(X∣Y=y).H(X\mid Y)=\sum_{y:p(y)>0}p(y)H(X\mid Y=y).

Terms with zero joint probability contribute zero. Observations having p(y)=0p(y)=0 are omitted because their conditional distributions do not affect the average. (math.mit.edu)

The logarithm’s base determines the unit: base two gives bits, while the natural logarithm gives nats. In expected-value notation,

H(X∣Y)=E[−log⁡bp(X∣Y)].H(X\mid Y)=\mathbb E[-\log_b p(X\mid Y)].

Thus it is the average conditional self-information of XX. Unlike H(X∣Y=y)H(X\mid Y=y), which concerns one observation, H(X∣Y)H(X\mid Y) averages over the entire probability distribution of observations. A discrete XX can also be conditioned on a continuous YY, using an expectation rather than a discrete sum over yy. (people.lids.mit.edu)

Fundamental identities and inequalities

The entropy chain rule expresses joint uncertainty as uncertainty about one variable plus the uncertainty remaining about the other:

H(X,Y)=H(Y)+H(X∣Y).H(X,Y)=H(Y)+H(X\mid Y).

For a finite sequence, its extension is

H(X1,…,Xn)=∑i=1nH(Xi∣X1,…,Xi−1),H(X_1,\ldots,X_n) =\sum_{i=1}^{n}H(X_i\mid X_1,\ldots,X_{i-1}),

where the first term is H(X1)H(X_1). These identities follow by factoring joint probabilities into conditional probabilities. When entropies are finite, the first identity also gives H(X∣Y)=H(X,Y)−H(Y)H(X\mid Y)=H(X,Y)-H(Y). Direct definitions remain important when subtraction would produce the undefined expression ∞−∞\infty-\infty. (people.csail.mit.edu)

For finite-valued variables,

0≤H(X∣Y)≤H(X).0\le H(X\mid Y)\le H(X).

The upper equality holds precisely when XX and YY exhibit statistical independence. The lower equality holds precisely when XX is a deterministic function of YY, except on events of probability zero. Conditional entropy is generally asymmetric: knowing YY may determine XX, without knowing XX determining YY. (ocw.mit.edu)

Additional conditioning cannot increase average discrete entropy:

H(X∣Y,Z)≤H(X∣Y).H(X\mid Y,Z)\le H(X\mid Y).

The difference is conditional mutual information, I(X;Z∣Y)I(X;Z\mid Y), which is nonnegative. For finite-valued variables, equality holds exactly when XX and ZZ have conditional independence given YY. Likewise, mutual information satisfies

I(X;Y)=H(X)−H(X∣Y),I(X;Y)=H(X)-H(X\mid Y),

quantifying how much observing YY reduces uncertainty about XX on average. (ocw.mit.edu)

Examples and the role of averaging

Consider a fair binary variable XX, and let YY equal XX with probability 1−ε1-\varepsilon, otherwise taking the opposite value, independently of XX. Applying the definition gives

H(X∣Y)=h2(ε),h2(t)=−tlog⁡2t−(1−t)log⁡2(1−t).H(X\mid Y)=h_2(\varepsilon), \qquad h_2(t)=-t\log_2t-(1-t)\log_2(1-t).

At ε=0\varepsilon=0, the observation identifies XX. At ε=12\varepsilon=\tfrac12, it provides no information, leaving one bit of uncertainty. At ε=1\varepsilon=1, it again identifies XX, because the observed value is always inverted. These are direct consequences of the conditional distributions. (math.mit.edu)

“Conditioning reduces entropy” is an average statement, not a guarantee for every observation. For example, let UU and YY be independent fair binary variables, and set X=U∨YX=U\lor Y. Then H(X)=h2(1/4)H(X)=h_2(1/4), approximately 0.8110.811 bits. Observing Y=0Y=0 leaves X=UX=U, raising uncertainty to one bit; observing Y=1Y=1 determines XX. Their average is nevertheless H(X∣Y)=0.5H(X\mid Y)=0.5 bits, below the unconditional entropy. (ocw.mit.edu)

Coding and statistical learning

In lossless data compression with side information, conditional entropy determines an asymptotic coding threshold. For independent, identically distributed finite-alphabet pairs (Xi,Yi)(X_i,Y_i), rates above H(X∣Y)H(X\mid Y) permit reconstruction of XX-blocks with error probability tending to zero when the decoder knows the corresponding YY-blocks. The Slepian–Wolf theorem establishes that this threshold remains achievable even when the encoder does not know those observations. (people.lids.mit.edu)

Conditional entropy also describes uncertainty in dependent sequences. For a stationary finite-alphabet stochastic process, the uncertainty about the next symbol conditioned on increasingly long histories converges to the entropy rate. In a stationary first-order Markov chain, this rate is H(Xt+1∣Xt)H(X_{t+1}\mid X_t). (stanforddatacompressionclass.github.io)

In machine learning, H(Y∣X)H(Y\mid X) measures uncertainty about a label YY given features XX. It is distinct from the conditional cross-entropy of a model q(y∣x)q(y\mid x). Their difference is the expected Kullback–Leibler divergence between the true conditional distribution and the model. Consequently, under unrestricted prediction, conditional entropy is the minimum achievable population logarithmic loss, rather than necessarily the loss attained by a trained model. (s3-us-west-2.amazonaws.com)

Continuous variables

For continuous variables admitting a joint probability density function, conditional differential entropy is

h(X∣Y)=−∫ ⁣ ⁣∫fX,Y(x,y)log⁡fX∣Y(x∣y) dx dy.h(X\mid Y) =-\int\!\!\int f_{X,Y}(x,y)\log f_{X\mid Y}(x\mid y)\,dx\,dy.

When the relevant quantities are finite, h(X∣Y)=h(X,Y)−h(Y)h(X\mid Y)=h(X,Y)-h(Y). Unlike discrete conditional entropy, it can be negative and changes when the scale of XX changes. It is therefore not directly interpretable as a nonnegative number of bits required for exact representation of a continuous observation. Mutual information remains nonnegative and equals h(X)−h(X∣Y)h(X)-h(X\mid Y) when that difference is well defined. (s3-us-west-2.amazonaws.com)

References

  1. 600: Lecture 33 — Entropymath.mit.edu
  2. Information Theory — Polyanskiy and Wupeople.lids.mit.edu
  3. 441S16: Course Notesocw.mit.edu
  4. ST06 — Lecture 3people.csail.mit.edu
  5. Non IID Sources and Entropy Ratestanforddatacompressionclass.github.io
  6. 11. Information Theory — Dive into Deep Learnings3-us-west-2.amazonaws.com