Conditional entropy explained

Y

given that the value of another random variable

X

is known. Here, information is measured in shannons, nats, or hartleys. The entropy of

Y

conditioned on

X

is written as

Η(Y|X)

.

Definition

The conditional entropy of

Y

given

X

is defined as

where

lX

and

lY

denote the support sets of

X

and

Y

.

Note: Here, the convention is that the expression

0log0

should be treated as being equal to zero. This is because
\lim
\theta\to0+

\thetalog\theta=0

.[1]

Intuitively, notice that by definition of expected value and of conditional probability,

\displaystyleH(Y|X)

can be written as

H(Y|X)=E[f(X,Y)]

, where

f

is defined as

\displaystylef(x,y):=-log\left(

p(x,y)
p(x)

\right)=-log(p(y|x))

. One can think of

\displaystylef

as associating each pair

\displaystyle(x,y)

with a quantity measuring the information content of

\displaystyle(Y=y)

given

\displaystyle(X=x)

. This quantity is directly related to the amount of information needed to describe the event

\displaystyle(Y=y)

given

(X=x)

. Hence by computing the expected value of

\displaystylef

over all pairs of values

(x,y)\inl{X} x l{Y}

, the conditional entropy

\displaystyleH(Y|X)

measures how much information, on average, the variable

X

encodes about

Y

.

Motivation

Let

Η(Y|X=x)

be the entropy of the discrete random variable

Y

conditioned on the discrete random variable

X

taking a certain value

x

. Denote the support sets of

X

and

Y

by

lX

and

lY

. Let

Y

have probability mass function

pY{(y)}

. The unconditional entropy of

Y

is calculated as

Η(Y):=E[\operatorname{I}(Y)]

, i.e.

Η(Y)=\sumy\inlY{Pr(Y=y)I(y)}=-\sumy\inlY{pY(y)log2{pY(y)}},

where

\operatorname{I}(yi)

is the information content of the outcome of

Y

taking the value

yi

. The entropy of

Y

conditioned on

X

taking the value

x

is defined analogously by conditional expectation:

Η(Y|X=x) =-\sumy\inlY{\Pr(Y=y|X=x)log2{\Pr(Y=y|X=x)}}.

Note that

Η(Y|X)

is the result of averaging

Η(Y|X=x)

over all possible values

x

that

X

may take. Also, if the above sum is taken over a sample

y1,...,yn

, the expected value

EX[Η(y1,...,yn\midX=x)]

is known in some domains as .[2]

X

with image

lX

and

Y

with image

lY

, the conditional entropy of

Y

given

X

is defined as the weighted sum of

Η(Y|X=x)

for each possible value of

x

, using

p(x)

as the weights:[3]

\begin{align} Η(Y|X)&\equiv\sumx\inlXp(x)Η(Y|X=x)\\ &=-\sumx\inlXp(x)\sumy\inlYp(y|x)log2p(y|x)\\ &=-\sumx\inlX,p(x)p(y|x)log2p(y|x)\\ &=-\sumx\inlX,p(x,y)log2

p(x,y)
p(x)

.\end{align}

Properties

Conditional entropy equals zero

Η(Y|X)=0

if and only if the value of

Y

is completely determined by the value of

X

.

Conditional entropy of independent random variables

Conversely,

Η(Y|X)=Η(Y)

if and only if

Y

and

X

are independent random variables.

Chain rule

Assume that the combined system determined by two random variables

X

and

Y

has joint entropy

Η(X,Y)

, that is, we need

Η(X,Y)

bits of information on average to describe its exact state. Now if we first learn the value of

X

, we have gained

Η(X)

bits of information. Once

X

is known, we only need

Η(X,Y)(X)

bits to describe the state of the whole system. This quantity is exactly

Η(Y|X)

, which gives the chain rule of conditional entropy:

Η(Y|X)=Η(X,Y)-Η(X).

The chain rule follows from the above definition of conditional entropy:

\begin{align}Η(Y|X)&=\sumx\inlX,p(x,y)log\left(

p(x)
p(x,y)

\right)\\[4pt] &=\sumx\inlX,p(x,y)(log(p(x))-log(p(x,y)))\\[4pt] &=-\sumx\inlX,p(x,y)log(p(x,y))+\sumx\inlX,{p(x,y)log(p(x))}\\[4pt] &=Η(X,Y)+\sumxp(x)log(p(x))\\[4pt] &=Η(X,Y)-Η(X).\end{align}

In general, a chain rule for multiple random variables holds:

Η(X1,X2,\ldots,Xn)=

n
\sum
i=1

Η(Xi|X1,\ldots,Xi-1)

It has a similar form to chain rule in probability theory, except that addition instead of multiplication is used.

Bayes' rule

Bayes' rule for conditional entropy states

Η(Y|X)=Η(X|Y)-Η(X)+Η(Y).

Proof.

Η(Y|X)=Η(X,Y)-Η(X)

and

Η(X|Y)=Η(Y,X)-Η(Y)

. Symmetry entails

Η(X,Y)=Η(Y,X)

. Subtracting the two equations implies Bayes' rule.

If

Y

is conditionally independent of

Z

given

X

we have:

Η(Y|X,Z)=Η(Y|X).

Other properties

For any

X

and

Y

:

\begin{align} Η(Y|X)&\leΗ(Y)\\ Η(X,Y)&=Η(X|Y)+Η(Y|X)+\operatorname{I}(X;Y),    \\ Η(X,Y)&=Η(X)+Η(Y)-\operatorname{I}(X;Y),\\ \operatorname{I}(X;Y)&\leΗ(X), \end{align}

where

\operatorname{I}(X;Y)

is the mutual information between

X

and

Y

.

For independent

X

and

Y

:

Η(Y|X)=Η(Y)

and

Η(X|Y)=Η(X)

Although the specific-conditional entropy

Η(X|Y=y)

can be either less or greater than

Η(X)

for a given random variate

y

of

Y

,

Η(X|Y)

can never exceed

Η(X)

.

Conditional differential entropy

Definition

The above definition is for discrete random variables. The continuous version of discrete conditional entropy is called conditional differential (or continuous) entropy. Let

X

and

Y

be a continuous random variables with a joint probability density function

f(x,y)

. The differential conditional entropy

h(X|Y)

is defined as

Properties

In contrast to the conditional entropy for discrete random variables, the conditional differential entropy may be negative.

As in the discrete case there is a chain rule for differential entropy:

h(Y|X)=h(X,Y)-h(X)

Notice however that this rule may not be true if the involved differential entropies do not exist or are infinite.

Joint differential entropy is also used in the definition of the mutual information between continuous random variables:

\operatorname{I}(X,Y)=h(X)-h(X|Y)=h(Y)-h(Y|X)

h(X|Y)\leh(X)

with equality if and only if

X

and

Y

are independent.

Relation to estimator error

The conditional differential entropy yields a lower bound on the expected squared error of an estimator. For any random variable

X

, observation

Y

and estimator

\widehat{X}

the following holds:

\mathbb\left[\bigl(X - \widehat{X}{(Y)}\bigr)^2\right] \ge \frace^

This is related to the uncertainty principle from quantum mechanics.

Generalization to quantum theory

In quantum information theory, the conditional entropy is generalized to the conditional quantum entropy. The latter can take negative values, unlike its classical counterpart.

See also

Notes and References

  1. Web site: David MacKay: Information Theory, Pattern Recognition and Neural Networks: The Book. www.inference.org.uk. 2019-10-25.
  2. Hellman, M.. Raviv, J.. 1970. Probability of error, equivocation, and the Chernoff bound. IEEE Transactions on Information Theory. 16. 4. 368–372. 10.1109/TIT.1970.1054466. 10.1.1.131.2865.
  3. Book: 0-471-06259-6. 1991. Thomas M. Cover. T. Cover. J. Thomas. Elements of Information Theory. Wiley . registration.