Venn diagram for various information measures associated with correlated variables X and Y. The area contained by both circles is the joint entropy H(X,Y). The circle on the left (red and violet) is the individual entropy H(X), with the red being the conditional entropy H(X|Y). The circle on the right (blue and violet) is H(Y), with the blue being H(Y|X). The violet is the mutual information I(X;Y).
In information theory , the conditional entropy (or equivocation ) quantifies the amount of information needed to describe the outcome of a random variable
Y
{\displaystyle Y}
given that the value of another random variable
X
{\displaystyle X}
is known. Here, information is measured in shannons , nats , or hartleys . The entropy of
Y
{\displaystyle Y}
conditioned on
X
{\displaystyle X}
is written as
H
(
Y
|
X
)
{\displaystyle H(Y|X)}
.
Definition
If
H
(
Y
|
X
=
x
)
{\displaystyle H(Y|X=x)}
is the entropy of the variable
Y
{\displaystyle Y}
conditioned on the variable
X
{\displaystyle X}
taking a certain value
x
{\displaystyle x}
, then
H
(
Y
|
X
)
{\displaystyle H(Y|X)}
is the result of averaging
H
(
Y
|
X
=
x
)
{\displaystyle H(Y|X=x)}
over all possible values
x
{\displaystyle x}
that
X
{\displaystyle X}
may take.
Given discrete random variables
X
{\displaystyle X}
with domain
X
{\displaystyle {\mathcal {X}}}
and
Y
{\displaystyle Y}
with domain
Y
{\displaystyle {\mathcal {Y}}}
, the conditional entropy of
Y
{\displaystyle Y}
given
X
{\displaystyle X}
is defined as: (Intuitively, the following can be thought as the weighted sum of
H
(
Y
|
X
=
x
)
{\displaystyle H(Y|X=x)}
for each possible value of
x
{\displaystyle x}
, using
p
(
x
)
{\displaystyle p(x)}
as the weights)[ 1]
H
(
Y
|
X
)
≡
∑
x
∈
X
p
(
x
)
H
(
Y
|
X
=
x
)
=
−
∑
x
∈
X
p
(
x
)
∑
y
∈
Y
p
(
y
|
x
)
log
p
(
y
|
x
)
=
−
∑
x
∈
X
∑
y
∈
Y
p
(
x
,
y
)
log
p
(
y
|
x
)
=
−
∑
x
∈
X
,
y
∈
Y
p
(
x
,
y
)
log
p
(
y
|
x
)
=
−
∑
x
∈
X
,
y
∈
Y
p
(
x
,
y
)
log
p
(
x
,
y
)
p
(
x
)
.
=
∑
x
∈
X
,
y
∈
Y
p
(
x
,
y
)
log
p
(
x
)
p
(
x
,
y
)
.
{\displaystyle {\begin{aligned}H(Y|X)\ &\equiv \sum _{x\in {\mathcal {X}}}\,p(x)\,H(Y|X=x)\\&=-\sum _{x\in {\mathcal {X}}}p(x)\sum _{y\in {\mathcal {Y}}}\,p(y|x)\,\log \,p(y|x)\\&=-\sum _{x\in {\mathcal {X}}}\sum _{y\in {\mathcal {Y}}}\,p(x,y)\,\log \,p(y|x)\\&=-\sum _{x\in {\mathcal {X}},y\in {\mathcal {Y}}}p(x,y)\log \,p(y|x)\\&=-\sum _{x\in {\mathcal {X}},y\in {\mathcal {Y}}}p(x,y)\log {\frac {p(x,y)}{p(x)}}.\\&=\sum _{x\in {\mathcal {X}},y\in {\mathcal {Y}}}p(x,y)\log {\frac {p(x)}{p(x,y)}}.\\\end{aligned}}}
Note: It is understood that the expressions 0 log 0 and 0 log (c /0) for fixed c >0 should be treated as being equal to zero.
H
(
Y
|
X
)
=
0
{\displaystyle H(Y|X)=0}
if and only if the value of
Y
{\displaystyle Y}
is completely determined by the value of
X
{\displaystyle X}
. Conversely,
H
(
Y
|
X
)
=
H
(
Y
)
{\displaystyle H(Y|X)=H(Y)}
if and only if
Y
{\displaystyle Y}
and
X
{\displaystyle X}
are independent random variables .
Chain rule
Assume that the combined system determined by two random variables X and Y has joint entropy
H
(
X
,
Y
)
{\displaystyle H(X,Y)}
, that is, we need
H
(
X
,
Y
)
{\displaystyle H(X,Y)}
bits of information to describe its exact state.
Now if we first learn the value of
X
{\displaystyle X}
, we have gained
H
(
X
)
{\displaystyle H(X)}
bits of information.
Once
X
{\displaystyle X}
is known, we only need
H
(
X
,
Y
)
−
H
(
X
)
{\displaystyle H(X,Y)-H(X)}
bits to describe the state of the whole system.
This quantity is exactly
H
(
Y
|
X
)
{\displaystyle H(Y|X)}
, which gives the chain rule of conditional entropy:
H
(
Y
|
X
)
=
H
(
X
,
Y
)
−
H
(
X
)
.
{\displaystyle H(Y|X)\,=\,H(X,Y)-H(X)\,.}
The chain rule follows from the above definition of conditional entropy:
H
(
Y
|
X
)
=
∑
x
∈
X
,
y
∈
Y
p
(
x
,
y
)
log
p
(
x
)
p
(
x
,
y
)
{\displaystyle H(Y|X)=\sum _{x\in {\mathcal {X}},y\in {\mathcal {Y}}}p(x,y)\log {\frac {p(x)}{p(x,y)}}}
=
−
∑
x
∈
X
,
y
∈
Y
p
(
x
,
y
)
log
p
(
x
,
y
)
+
∑
x
∈
X
,
y
∈
Y
p
(
x
,
y
)
log
p
(
x
)
{\displaystyle =-\sum _{x\in {\mathcal {X}},y\in {\mathcal {Y}}}p(x,y)\log \,p(x,y)+\sum _{x\in {\mathcal {X}},y\in {\mathcal {Y}}}p(x,y)\log \,p(x)}
=
H
(
X
,
Y
)
+
∑
x
∈
X
p
(
x
)
log
p
(
x
)
{\displaystyle =H(X,Y)+\sum _{x\in {\mathcal {X}}}p(x)\log \,p(x)}
=
H
(
X
,
Y
)
−
H
(
X
)
.
{\displaystyle =H(X,Y)-H(X).}
Bayes' rule
Bayes' rule for conditional entropy states
H
(
Y
|
X
)
=
H
(
X
|
Y
)
−
H
(
X
)
+
H
(
Y
)
.
{\displaystyle H(Y|X)\,=\,H(X|Y)-H(X)+H(Y)\,.}
Proof.
H
(
Y
|
X
)
=
H
(
X
,
Y
)
−
H
(
X
)
{\displaystyle H(Y|X)=H(X,Y)-H(X)}
and
H
(
X
|
Y
)
=
H
(
Y
,
X
)
−
H
(
Y
)
{\displaystyle H(X|Y)=H(Y,X)-H(Y)}
. Symmetry implies
H
(
X
,
Y
)
=
H
(
Y
,
X
)
{\displaystyle H(X,Y)=H(Y,X)}
. Subtracting the two equations implies Bayes' rule.
If Y is conditional independent of Z given X we have:
H
(
Y
|
X
,
Z
)
=
H
(
Y
|
X
)
.
{\displaystyle H(Y|X,Z)\,=\,H(Y|X).}
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.
Bayes' rule does not hold for conditional quantum entropy , since
H
(
X
,
Y
)
≠
H
(
Y
,
X
)
{\displaystyle H(X,Y)\neq H(Y,X)}
.[citation needed ]
Other properties
For any
X
{\displaystyle X}
and
Y
{\displaystyle Y}
:
H
(
Y
|
X
)
≤
H
(
Y
)
{\displaystyle H(Y|X)\leq H(Y)\,}
H
(
X
,
Y
)
=
H
(
X
|
Y
)
+
H
(
Y
|
X
)
+
I
(
X
;
Y
)
,
{\displaystyle H(X,Y)=H(X|Y)+H(Y|X)+I(X;Y),\qquad }
H
(
X
,
Y
)
=
H
(
X
)
+
H
(
Y
)
−
I
(
X
;
Y
)
,
{\displaystyle H(X,Y)=H(X)+H(Y)-I(X;Y),\,}
I
(
X
;
Y
)
≤
H
(
X
)
,
{\displaystyle I(X;Y)\leq H(X),\,}
where
I
(
X
;
Y
)
{\displaystyle I(X;Y)}
is the mutual information between
X
{\displaystyle X}
and
Y
{\displaystyle Y}
.
For independent
X
{\displaystyle X}
and
Y
{\displaystyle Y}
:
H
(
Y
|
X
)
=
H
(
Y
)
and
H
(
X
|
Y
)
=
H
(
X
)
{\displaystyle H(Y|X)=H(Y){\text{ and }}H(X|Y)=H(X)\,}
Although the specific-conditional entropy,
H
(
X
|
Y
=
y
)
{\displaystyle H(X|Y=y)}
, can be either less or greater than
H
(
X
)
{\displaystyle H(X)}
,
H
(
X
|
Y
)
{\displaystyle H(X|Y)}
can never exceed
H
(
X
)
{\displaystyle H(X)}
.
References
^ Cover, Thomas M.; Thomas, Joy A. (1991). Elements of information theory (1st ed.). New York: Wiley. ISBN 0-471-06259-6 .
See also