Let X X X and Y Y Y be two discrete random variables.
Relative Entropy
Given a distribution p p p , if we encode it with a distribution q q q (with the same support), the expected coding length is roughly
∑ i p i log 1 q i
\sum_i p_i \log \frac{1}{q_i}
i ∑ p i log q i 1 The cost over the optimal coding is given by
D ( p ∣ ∣ q ) ≐ ∑ i p i log 1 q i − ∑ i p i log 1 p i = ∑ i p i log p i q i
\mathbf{D} (p || q) \doteq \sum_i p_i \log \frac{1}{q_i} - \sum_i p_i \log \frac{1}{p_i} = \sum_i p_i \log \frac{p_i}{q_i}
D ( p ∣∣ q ) ≐ i ∑ p i log q i 1 − i ∑ p i log p i 1 = i ∑ p i log q i p i By definition, we know that this gap is always non-negative.
We can prove it rigorously algebraically. We show two different approaches here.
By that f ( x ) = x log x f(x) = x \log x f ( x ) = x log x is convex for x ≥ 0 x \ge 0 x ≥ 0 , we haveD ( p ∣ ∣ q ) = ∑ i p i log p i q i = ∑ i q i ⋅ p i q i log p i q i ≥ ( ∑ i q i ⋅ p i q i ) log ( ∑ i q i ⋅ p i q i ) = 0
\begin{aligned}
\mathbf{D}(p || q) &= \sum_i p_i \log \frac{p_i}{q_i} \\
&= \sum_i q_i \cdot \frac{p_i}{q_i} \log \frac{p_i}{q_i} \\
&\ge \left( \sum_i q_i \cdot \frac{p_i}{q_i} \right) \log \left( \sum_i q_i \cdot \frac{p_i}{q_i} \right) \\
&= 0
\end{aligned}
D ( p ∣∣ q ) = i ∑ p i log q i p i = i ∑ q i ⋅ q i p i log q i p i ≥ ( i ∑ q i ⋅ q i p i ) log ( i ∑ q i ⋅ q i p i ) = 0
By that f ( x ) = − log x f(x) = -\log x f ( x ) = − log x is convex (for x ≥ 0 x \ge 0 x ≥ 0 ), we haveD ( p ∣ ∣ q ) = ∑ i − p i log q i p i ≥ − log ( ∑ i p i ⋅ q i p i ) = 0
\begin{aligned}
\mathbf{D}(p || q) &= \sum_i - p_i \log \frac{q_i}{p_i} \\
&\ge -\log \left( \sum_i p_i \cdot \frac{q_i}{p_i} \right) \\
&= 0
\end{aligned}
D ( p ∣∣ q ) = i ∑ − p i log p i q i ≥ − log ( i ∑ p i ⋅ p i q i ) = 0
Theorem (Maximum Value). Let X X X be a random variable taking values in an alphabet Ω \Omega Ω . Then
H ( X ) ≤ log ∣ Ω ∣
\mathbf{H}(X) \le \log | \Omega |
H ( X ) ≤ log ∣Ω∣ The inequality is saturated if and only if X X X is a uniform random variable on Ω \Omega Ω .
Proof. Let U U U be a uniform random variable on Ω \Omega Ω .
Then
D ( X ∥ U ) = ∑ p ( x ) log p ( x ) 1 / ∣ Ω ∣ = log ∣ Ω ∣ − H ( x ) ≥ 0.
\mathbf{D}( X \Vert U ) = \sum p(x) \log \frac{ p(x) }{ 1 / | \Omega | } = \log | \Omega | - \mathbf{H}(x) \ge 0.
D ( X ∥ U ) = ∑ p ( x ) log 1/∣Ω∣ p ( x ) = log ∣Ω∣ − H ( x ) ≥ 0. □ \square □
Joint Entropy
Definition. The joint entropy of X X X and Y Y Y is
H ( X , Y ) = ∑ x , y p ( x , y ) log 1 p ( x , y )
\mathbf{H}(X, Y) = \sum_{x, y} p(x, y) \log \frac{1}{ p(x, y) }
H ( X , Y ) = x , y ∑ p ( x , y ) log p ( x , y ) 1
If X X X and Y Y Y are independent, then
H ( X , Y ) = H ( X ) + H ( Y ) .
\mathbf{H}(X, Y) = \mathbf{H}(X) + \mathbf{H}(Y).
H ( X , Y ) = H ( X ) + H ( Y ) . Conditional Entropy
Definition. The conditional entropy of X X X given Y = y Y = y Y = y is the entropy of the probability distribution p ( X ∣ Y = y ) p(X \mid Y = y) p ( X ∣ Y = y )
H ( X ∣ Y = y ) = ∑ x p ( x ∣ y ) log 1 p ( x ∣ y )
\mathbf{H}(X \mid Y = y) = \sum_x p(x \mid y) \log \frac{1}{ p(x \mid y) }
H ( X ∣ Y = y ) = x ∑ p ( x ∣ y ) log p ( x ∣ y ) 1
Definition. The conditional entropy of X X X given Y Y Y , is the average, over y y y , the conditional entropy of X X X given y y y
H ( X ∣ Y ) = ∑ y p ( y ) H ( X ∣ Y = y ) = ∑ x , y p ( x , y ) log 1 p ( x ∣ y ) .
\mathbf{H}(X \mid Y) = \sum_y p(y) \mathbf{H}(X \mid Y = y) = \sum_{x, y} p(x , y) \log \frac{1}{ p(x \mid y) }.
H ( X ∣ Y ) = y ∑ p ( y ) H ( X ∣ Y = y ) = x , y ∑ p ( x , y ) log p ( x ∣ y ) 1 .
Theorem (Zero Conditional Entropy). Suppose that X X X and Y Y Y have the same support. H ( X ∣ Y ) = 0 \mathbf{H}(X \mid Y) = 0 H ( X ∣ Y ) = 0 if and only if X X X is a function of Y Y Y .
Proof. If
H ( X ∣ Y ) = ∑ y p ( y ) H ( X ∣ Y = y ) = 0.
\mathbf{H}(X \mid Y) = \sum_y p(y) \mathbf{H}(X \mid Y = y) = 0.
H ( X ∣ Y ) = y ∑ p ( y ) H ( X ∣ Y = y ) = 0. Then either p ( y ) = 0 p(y) = 0 p ( y ) = 0 or H ( X ∣ Y = y ) = 0 \mathbf{H}(X \mid Y = y) = 0 H ( X ∣ Y = y ) = 0 for all y y y .
On the other hand, for each y y y , if p ( y ) > 0 p(y) > 0 p ( y ) > 0 , then
H ( X ∣ Y = y ) = ∑ x p ( x ∣ y ) log 1 p ( x ∣ y ) = 0 ,
\mathbf{H}(X \mid Y = y) = \sum_x p(x \mid y) \log \frac{1}{ p(x \mid y) } = 0,
H ( X ∣ Y = y ) = x ∑ p ( x ∣ y ) log p ( x ∣ y ) 1 = 0 , Then either p ( x ∣ y ) = 0 p(x \mid y) = 0 p ( x ∣ y ) = 0 or log 1 p ( x ∣ y ) = 0 \log \frac{1}{ p(x \mid y) } = 0 log p ( x ∣ y ) 1 = 0 .
It follows that there is a unique x x x , for which p ( x ∣ y ) = 1 p(x \mid y) = 1 p ( x ∣ y ) = 1 .
Conversely, if X X X is a function of Y Y Y , for each y y y such that p ( y ) > 0 p(y) > 0 p ( y ) > 0 , there is a unique x x x such that p ( x ∣ y ) = 1 p(x \mid y) = 1 p ( x ∣ y ) = 1 .
Hence, H ( X ∣ Y = y ) = 0 \mathbf{H}(X \mid Y = y) = 0 H ( X ∣ Y = y ) = 0 and H ( X ∣ Y ) = 0 H(X \mid Y) = 0 H ( X ∣ Y ) = 0 .
□ \square □
Definition. The mutual information between X X X and Y Y Y is
I ( X ; Y ) = E p ( x , y ) [ log p ( x , y ) p ( x ) p ( y ) ] = D ( p ( x , y ) ∥ p ( x ) p ( y ) ) .
I(X; Y) = \mathbb{E}_{p(x, y) } \left[ \log \frac{ p(x, y)}{p(x) p(y) } \right] = \mathbf{D}( p(x, y) \Vert p(x) p(y) ).
I ( X ; Y ) = E p ( x , y ) [ log p ( x ) p ( y ) p ( x , y ) ] = D ( p ( x , y ) ∥ p ( x ) p ( y )) .
The definition is symmetric and it holds that I ( X ; Y ) = I ( Y ; X ) I(X; Y) = I(Y; X) I ( X ; Y ) = I ( Y ; X ) .
If we know p ( x , y ) p(x,y) p ( x , y ) , we use in expectation E p ( x , y ) [ log 1 p ( x , y ) ] \mathbb{E}_{p(x, y) } \left[ \log \frac{1} { p(x, y)} \right] E p ( x , y ) [ log p ( x , y ) 1 ] bits to describe them.
If we know only p ( x ) p(x) p ( x ) and p ( y ) p(y) p ( y ) , the mutual information measures the bits we waste.
∑ p ( x , y ) log p ( x , y ) p ( x ) p ( y ) = ∑ p ( x , y ) ( log 1 p ( x ) + log 1 p ( y ) − log 1 p ( x , y ) ) = H ( X ) + H ( Y ) − H ( X , Y ) \small
\begin{aligned}
&\sum p(x, y) \log \frac{ p(x, y)}{p(x) p(y) } \\
=& \sum p(x, y) \left( \log \frac{ 1 }{p(x)}
+ \log \frac{ 1 }{p(y)}
- \log \frac{ 1 }{p(x, y)} \right) \\
=& \mathbf{H} ( X ) + \mathbf{H} ( Y ) - \mathbf{H} ( X, Y )
\end{aligned}
= = ∑ p ( x , y ) log p ( x ) p ( y ) p ( x , y ) ∑ p ( x , y ) ( log p ( x ) 1 + log p ( y ) 1 − log p ( x , y ) 1 ) H ( X ) + H ( Y ) − H ( X , Y ) Further, mutual information measures the average reduction of randomness of X X X that results from learning the value of Y Y Y .
∑ p ( x , y ) log p ( x , y ) p ( x ) p ( y ) = ∑ p ( x , y ) log p ( x ∣ y ) p ( x ) = H ( X ) − H ( X ∣ Y ) . \small
\begin{aligned}
\sum p(x, y) \log \frac{ p(x, y)}{p(x) p(y) }
&=\sum p(x, y) \log \frac{ p(x | y)}{p(x) } \\
&= \mathbf{H} ( X ) - \mathbf{H} ( X \mid Y).
\end{aligned}
∑ p ( x , y ) log p ( x ) p ( y ) p ( x , y ) = ∑ p ( x , y ) log p ( x ) p ( x ∣ y ) = H ( X ) − H ( X ∣ Y ) . In this sense, the mutual information quantifies the dependence between X X X and Y Y Y .
It measures how much knowing one random variable reduces the uncertainty about the other random variable.
Similarly, we can prove that
∑ p ( x , y ) log p ( x , y ) p ( x ) p ( y ) = ∑ p ( x , y ) log p ( x ∣ y ) p ( x ) = H ( Y ) − H ( X ∣ Y ) . \small
\begin{aligned}
\sum p(x, y) \log \frac{ p(x, y)}{p(x) p(y) }
&=\sum p(x, y) \log \frac{ p(x | y)}{ p(x) } \\
&=\mathbf{H} ( Y ) - \mathbf{H} ( X \mid Y).
\end{aligned}
∑ p ( x , y ) log p ( x ) p ( y ) p ( x , y ) = ∑ p ( x , y ) log p ( x ) p ( x ∣ y ) = H ( Y ) − H ( X ∣ Y ) .
I ( X ; Y ) ≥ 0 \mathbf{I}(X; Y) \ge 0 I ( X ; Y ) ≥ 0 .
Proof.
I ( X ; Y ) = D ( p ( x , y ) ∣ p ( x ) p ( y ) ) ≥ 0
\mathbf{I}(X; Y) = \mathbf{D}( p(x, y) \mid p(x) p(y) ) \ge 0
I ( X ; Y ) = D ( p ( x , y ) ∣ p ( x ) p ( y )) ≥ 0 Or
∑ p ( x , y ) log p ( x , y ) p ( x ) p ( y ) = − ∑ p ( x , y ) log p ( x ) p ( y ) p ( x , y ) ≥ − log ∑ p ( x , y ) p ( x ) p ( y ) p ( x , y ) = 0
\begin{aligned}
\sum p(x, y) \log \frac{ p(x, y)}{p(x) p(y) }
&= -\sum p(x, y) \log \frac{p(x) p(y) }{ p(x, y)} \\
&\ge - \log \sum p(x, y) \frac{p(x) p(y) }{ p(x, y)} \\
&=0
\end{aligned}
∑ p ( x , y ) log p ( x ) p ( y ) p ( x , y ) = − ∑ p ( x , y ) log p ( x , y ) p ( x ) p ( y ) ≥ − log ∑ p ( x , y ) p ( x , y ) p ( x ) p ( y ) = 0 □ \square □
Corollary. H ( Y ) − H ( X ∣ Y ) = H ( X ) − H ( X ∣ Y ) ≥ 0 \mathbf{H} ( Y ) - \mathbf{H} ( X \mid Y) = \mathbf{H} ( X ) - \mathbf{H} ( X \mid Y) \ge 0 H ( Y ) − H ( X ∣ Y ) = H ( X ) − H ( X ∣ Y ) ≥ 0 .
Theorem. The entropy H ( X ) \mathbf{H}(X) H ( X ) is concave in the probability density p ( x ) p(x) p ( x ) .
Proof.
Let λ 1 , λ 2 ∈ [ 0 , 1 ] \lambda_1, \lambda_2 \in [0, 1] λ 1 , λ 2 ∈ [ 0 , 1 ] such that λ 1 + λ 2 = 1 \lambda_1 + \lambda_2 = 1 λ 1 + λ 2 = 1 .
Suppose that Z 1 , Z 2 Z_1, Z_2 Z 1 , Z 2 are random variables with density functions p 1 ( z ) p_1(z) p 1 ( z ) and p 2 ( z ) p_2(z) p 2 ( z ) respectively.
Define the random variable
Y = { 1 , w.p λ 1 , 2 , w.p λ 2 ,
Y = \begin{cases}
1, &\text{w.p } \lambda_1,\\
2, &\text{w.p } \lambda_2,
\end{cases}
Y = { 1 , 2 , w.p λ 1 , w.p λ 2 , and let X = Z Y X = Z_Y X = Z Y .
Then
H ( X ) = H ( λ 1 p 1 + λ 2 p 2 )
\mathbf{H}(X) = \mathbf{H}( \lambda_1 p_1 + \lambda_2 p_2)
H ( X ) = H ( λ 1 p 1 + λ 2 p 2 ) On the other hand,
H ( X ∣ Y ) = λ 1 H ( p 1 ) + λ 2 H ( p 2 ) .
\mathbf{H}(X \mid Y) = \lambda_1 \mathbf{H}( p_1 ) + \lambda_2 \mathbf{H}( p_2 ).
H ( X ∣ Y ) = λ 1 H ( p 1 ) + λ 2 H ( p 2 ) . We finish the proof by observing that H ( X ) ≥ H ( X ∣ Y ) \mathbf{H}(X) \ge \mathbf{H}(X \mid Y) H ( X ) ≥ H ( X ∣ Y ) .
□ \square □
Definition. Let X X X be a Bernoulli random variable with mean p ∈ [ 0 , 1 ] p \in [0, 1] p ∈ [ 0 , 1 ] . Denote H ( p ) = H ( X ) = p log 1 p + ( 1 − p ) log 1 1 − p \mathbf{H}(p) = \mathbf{H}(X) = p \log \frac{1}{p} + (1 - p) \log \frac{1}{1 - p} H ( p ) = H ( X ) = p log p 1 + ( 1 − p ) log 1 − p 1 .
Corollary. H ( p ) \mathbf{H}(p) H ( p ) is concave in p p p .
Definition. The conditional mutual information between X X X and Y Y Y given Z = z Z = z Z = z is the mutual information between the random variables X X X and Y Y Y in the joint ensemble Pr ( X , Y ∣ Z = z ) \Pr (X, Y | Z = z) Pr ( X , Y ∣ Z = z ) ,
I ( X ; Y ∣ Z = z ) = H ( X ∣ Z = z ) − H ( X ∣ Y , Z = z )
I(X ; Y \mid Z = z) = \mathbf{H}(X \mid Z = z) - \mathbf{H}(X \mid Y, Z = z)
I ( X ; Y ∣ Z = z ) = H ( X ∣ Z = z ) − H ( X ∣ Y , Z = z )
Definition. The conditional mutual information between X X X and Y Y Y given Z Z Z is average over z z z of I ( X ; Y ∣ Z = z ) I(X; Y \mid Z = z) I ( X ; Y ∣ Z = z ) ,
I ( X ; Y ∣ Z ) = H ( X ∣ Z ) − H ( X ∣ Y , Z ) = H ( Y ∣ Z ) − H ( Y ∣ X , Z ) = H ( X ∣ Z ) + H ( Y ∣ Z ) − H ( X , Y ∣ Z ) = E X , Y , Z log p ( X , Y ∣ Z ) p ( X ∣ Z ) ⋅ p ( Y ∣ Z ) .
\begin{aligned}
I(X; Y \mid Z)
&= \mathbf{H}(X \mid Z) - \mathbf{H}(X \mid Y, Z) \\
&= \mathbf{H}(Y \mid Z) - \mathbf{H}(Y \mid X, Z) \\
&= \mathbf{H}(X \mid Z) + \mathbf{H}(Y \mid Z) - \mathbf{H}(X, Y \mid Z) \\
&= \mathbb{E}_{X, Y, Z} \log \frac{ p(X, Y \mid Z )}{ p(X \mid Z) \cdot p(Y \mid Z)}.
\end{aligned}
I ( X ; Y ∣ Z ) = H ( X ∣ Z ) − H ( X ∣ Y , Z ) = H ( Y ∣ Z ) − H ( Y ∣ X , Z ) = H ( X ∣ Z ) + H ( Y ∣ Z ) − H ( X , Y ∣ Z ) = E X , Y , Z log p ( X ∣ Z ) ⋅ p ( Y ∣ Z ) p ( X , Y ∣ Z ) .
Conditional Relative Entropy
Definition (Conditional Relative Entropy).
D ( p ( y ∣ x ) ∣ ∣ q ( y ∣ x ) ) ≐ E p ( x , y ) [ log p ( Y ∣ X ) q ( Y ∣ X ) ] = ∑ x ∑ y p ( y ∣ x ) log p ( y ∣ x ) q ( y ∣ x )
\begin{aligned}
\mathbf{D}( p(y \mid x) || q(y \mid x) ) &\doteq \mathbb{E}_{p(x, y) } \left[ \log \frac{ p(Y \mid X) }{ q(Y \mid X) } \right]\\
&=\sum_{x} \sum_{ y } p(y \mid x) \log \frac{ p(y \mid x) }{ q(y \mid x) }
\end{aligned}
D ( p ( y ∣ x ) ∣∣ q ( y ∣ x )) ≐ E p ( x , y ) [ log q ( Y ∣ X ) p ( Y ∣ X ) ] = x ∑ y ∑ p ( y ∣ x ) log q ( y ∣ x ) p ( y ∣ x )
Lemma. Relative entropy D ( p ∣ ∣ q ) \mathbf{D}( p || q ) D ( p ∣∣ q ) is convex in the pair ( p , q ) (p, q) ( p , q ) : if there are two distribution pairs ( p 1 , q 1 ) (p_1, q_1) ( p 1 , q 1 ) and ( p 2 , q 2 ) (p_2, q_2) ( p 2 , q 2 ) , then for α 1 , α 2 ∈ [ 0 , 1 ] \alpha_1, \alpha_2 \in [0, 1] α 1 , α 2 ∈ [ 0 , 1 ] , s.t., α 1 + α 2 = 1 \alpha_1 + \alpha_2 = 1 α 1 + α 2 = 1 , it holds that
D ( α 1 p 1 + α 2 p 2 ∣ ∣ α 1 q 1 + α 2 q 2 ) ≤ α 1 D ( p 1 ∣ ∣ q 1 ) + α 2 D ( p 2 ∣ ∣ q 2 )
\mathbf{D}( \alpha_1 p_1 + \alpha_2 p_2 || \alpha_1 q_1 + \alpha_2 q_2 ) \le \alpha_1 \mathbf{D}( p_1 || q_1 ) + \alpha_2 \mathbf{D}( p_2 || q_2 )
D ( α 1 p 1 + α 2 p 2 ∣∣ α 1 q 1 + α 2 q 2 ) ≤ α 1 D ( p 1 ∣∣ q 1 ) + α 2 D ( p 2 ∣∣ q 2 )
Proof.
For any fix value x x x , let s ( x ) s(x) s ( x ) be a shorthand for α 1 p 1 ( x ) + α 2 p 2 ( x ) \alpha_1 p_1(x) + \alpha_2 p_2(x) α 1 p 1 ( x ) + α 2 p 2 ( x ) .
It holds that
s ( x ) log s ( x ) α 1 q 1 ( x ) + α 2 q 2 ( x ) = − s ( x ) log α 1 q 1 ( x ) + α 2 q 2 ( x ) s ( x ) = − s ( x ) log ( α 1 p 1 ( x ) s ( x ) α 1 q 1 ( x ) α 1 p 1 ( x ) + α 2 p 2 ( x ) s ( x ) α 2 q 2 ( x ) α 2 p 2 ( x ) ) ≤ − α 1 p 1 ( x ) log q 1 ( x ) p 1 ( x ) − α 2 p 2 ( x ) log q 2 ( x ) p 2 ( x ) \small
\begin{aligned}
s(x) \log \frac{ s(x) }{ \alpha_1 q_1(x) + \alpha_2 q_2(x) }
&=-s(x) \log \frac { \alpha_1 q_1(x) + \alpha_2 q_2(x) } { s(x) } \\
&= -s(x) \log \left( \frac { \alpha_1 p_1(x) } { s(x) } \frac { \alpha_1 q_1(x) } { \alpha_1 p_1(x) } + \frac { \alpha_2 p_2(x) } { s(x) } \frac { \alpha_2 q_2(x) } { \alpha_2 p_2(x) } \right) \\
&\le -\alpha_1 p_1(x) \log \frac { q_1(x) } { p_1(x) } - \alpha_2 p_2(x) \log \frac { q_2(x) } { p_2(x) }
\end{aligned}
s ( x ) log α 1 q 1 ( x ) + α 2 q 2 ( x ) s ( x ) = − s ( x ) log s ( x ) α 1 q 1 ( x ) + α 2 q 2 ( x ) = − s ( x ) log ( s ( x ) α 1 p 1 ( x ) α 1 p 1 ( x ) α 1 q 1 ( x ) + s ( x ) α 2 p 2 ( x ) α 2 p 2 ( x ) α 2 q 2 ( x ) ) ≤ − α 1 p 1 ( x ) log p 1 ( x ) q 1 ( x ) − α 2 p 2 ( x ) log p 2 ( x ) q 2 ( x ) □ \square □
Chain Rules
Chain Rule for Information Content
log 1 p ( x , y ) = log 1 p ( x ) + log 1 p ( y ∣ x ) \log \frac{1}{ p(x, y) } = \log \frac{1}{p(x) } + \log \frac{1}{p(y | x) } log p ( x , y ) 1 = log p ( x ) 1 + log p ( y ∣ x ) 1 .
Chain Rule for Entropy
Let X 1 , … , X n X_1, \ldots, X_n X 1 , … , X n be random variables whose density function is p ( x 1 … , x n ) p(x_1 \ldots, x_n) p ( x 1 … , x n ) .
H ( X 1 , … , X n ) = ∑ i = 1 n H ( X i ∣ X 1 , … , X i − 1 ) \mathbf{H}(X_1, \ldots, X_n) = \sum_{i = 1}^n \mathbf{H}(X_i \mid X_1, \ldots, X_{i - 1}) H ( X 1 , … , X n ) = ∑ i = 1 n H ( X i ∣ X 1 , … , X i − 1 )
Proof.
H ( X 1 , … , X n ) = ∑ x 1 … , x n p ( x 1 … , x n ) log 1 ∏ i = 1 n p ( x i ∣ x 1 , … , x i − 1 ) = ∑ x 1 … , x n p ( x 1 … , x n ) ∑ i = 1 n log 1 p ( x i ∣ x 1 , … , x i − 1 ) = ∑ i = 1 n H ( X i ∣ X 1 , … , X i − 1 ) \small
\begin{aligned}
\mathbf{H}(X_1, \ldots, X_n)
&= \sum_{x_1 \ldots, x_n} p(x_1 \ldots, x_n) \log \frac{1}{\prod_{i = 1}^n p(x_i \mid x_1, \ldots, x_{i - 1}) } \\
&= \sum_{x_1 \ldots, x_n} p(x_1 \ldots, x_n) \sum_{i = 1}^n \log \frac{1}{ p(x_i \mid x_1, \ldots, x_{i - 1}) } \\
&=\sum_{i = 1}^n \mathbf{H}(X_i \mid X_1, \ldots, X_{i - 1}) \\
\end{aligned}
H ( X 1 , … , X n ) = x 1 … , x n ∑ p ( x 1 … , x n ) log ∏ i = 1 n p ( x i ∣ x 1 , … , x i − 1 ) 1 = x 1 … , x n ∑ p ( x 1 … , x n ) i = 1 ∑ n log p ( x i ∣ x 1 , … , x i − 1 ) 1 = i = 1 ∑ n H ( X i ∣ X 1 , … , X i − 1 ) □ \square □
Corollary .
$
\mathbf{H} ( X_1, \ldots, X_n) \le \sum_{i = 1}^n \mathbf{H}(X_i).
$
□ \square □
I ( Y ; X 1 , … , X n ) = ∑ i = 1 n I ( Y ; X i ∣ X 1 , … , X i − 1 ) \mathbf{I}(Y; X_1, \ldots, X_n) = \sum_{i = 1}^n \mathbf{I}( Y; X_i \mid X_1, \ldots, X_{i - 1}) I ( Y ; X 1 , … , X n ) = ∑ i = 1 n I ( Y ; X i ∣ X 1 , … , X i − 1 )
Proof 1.
I ( X 1 , … , X n ; Y ) = H ( X 1 , … , X n ) − H ( X 1 , … , X n ∣ Y ) = ∑ i = 1 n H ( X i ∣ X 1 , … , X i − 1 ) − ∑ i = 1 n H ( X i ∣ X 1 , … , X i − 1 , Y ) = ∑ i = 1 n I ( X i ; Y ∣ X 1 , … , X i − 1 ) \small
\begin{aligned}
\mathbf{I}(X_1, \ldots, X_n; Y)
&= \mathbf{H}(X_1, \ldots, X_n) - \mathbf{H}(X_1, \ldots, X_n \mid Y) \\
&= \sum_{i = 1}^n \mathbf{H}(X_i \mid X_1, \ldots, X_{i - 1}) - \sum_{i = 1}^n \mathbf{H}(X_i \mid X_1, \ldots, X_{i - 1}, Y) \\
&= \sum_{i = 1}^n \mathbf{I}(X_i ; Y\mid X_1, \ldots, X_{i - 1})
\end{aligned}
I ( X 1 , … , X n ; Y ) = H ( X 1 , … , X n ) − H ( X 1 , … , X n ∣ Y ) = i = 1 ∑ n H ( X i ∣ X 1 , … , X i − 1 ) − i = 1 ∑ n H ( X i ∣ X 1 , … , X i − 1 , Y ) = i = 1 ∑ n I ( X i ; Y ∣ X 1 , … , X i − 1 ) □ \square □
Proof 2.
I ( Y ; X 1 , … , X n ) = D ( p ( x 1 , … , x n , y ) ∥ p ( x 1 , … , x n ) p ( y ) ) = ∑ x 1 , … , x n , y p ( x 1 , … , x n , y ) log p ( x 1 , … , x n , y ) p ( x 1 , … , x n ) p ( y ) = ∑ x 1 , … , x n , y p ( x 1 , … , x n , y ) ( log 1 p ( x 1 , … , x n ) − log 1 p ( x 1 , … , x n ∣ y ) ) = ∑ x 1 , … , x n , y p ( x 1 , … , x n , y ) log 1 p ( x 1 ) ⋅ p ( x 2 ∣ x 1 ) ⋅ … ⋅ p ( x n ∣ x 1 , … , x n − 1 ) − ∑ x 1 , … , x n , y p ( x 1 , … , x n , y ) log 1 p ( x 1 ∣ y ) ⋅ p ( x 2 ∣ x 1 , y ) ⋅ … ⋅ p ( x n ∣ x 1 , … , x n − 1 , y ) = ∑ x 1 , … , x n , y p ( x 1 , … , x n , y ) ( ∑ i ∈ [ n ] log p ( x i ∣ x 1 , … , x i − 1 , y ) p ( x i ∣ x 1 , … , x i − 1 ) ) = ∑ i = 1 n I ( Y ; X i ∣ X 1 , … , X i − 1 ) \small
\begin{aligned}
\mathbf{I}( Y ; X_1, \ldots, X_n )
&= \mathbf{D} ( p(x_1, \ldots, x_n, y) \Vert p(x_1, \ldots, x_n) p(y)) \\
&= \sum_{x_1, \ldots, x_n, y } p(x_1, \ldots, x_n, y) \log \frac{ p( x_1, \ldots, x_n, y) }{ p( x_1, \ldots, x_n ) p(y) } \\
&= \sum_{x_1, \ldots, x_n, y } p(x_1, \ldots, x_n, y) \left( \log \frac{1}{ p(x_1, \ldots, x_n) } - \log \frac{1}{ p(x_1, \ldots, x_n \mid y ) } \right) \\
&= \sum_{x_1, \ldots, x_n, y } p(x_1, \ldots, x_n, y) \log \frac{1}{ p(x_1) \cdot p(x_2 \mid x_1) \cdot \ldots \cdot p(x_n \mid x_1, \ldots, x_{n - 1} ) } \\
& - \sum_{x_1, \ldots, x_n, y } p(x_1, \ldots, x_n, y) \log \frac{1}{ p(x_1 \mid y) \cdot p(x_2 \mid x_1, y) \cdot \ldots \cdot p(x_n \mid x_1, \ldots, x_{n - 1}, y ) } \\
&= \sum_{x_1, \ldots, x_n, y } p(x_1, \ldots, x_n, y) \left( \sum_{i \in [n] } \log \frac{ p(x_i \mid x_1, \ldots, x_{i - 1}, y) }{ p(x_i \mid x_1, \ldots, x_{i - 1}) } \right) \\
&= \sum_{i = 1}^n \mathbf{I}( Y ; X_i \mid X_1, \ldots, X_{i - 1})
\end{aligned}
I ( Y ; X 1 , … , X n ) = D ( p ( x 1 , … , x n , y ) ∥ p ( x 1 , … , x n ) p ( y )) = x 1 , … , x n , y ∑ p ( x 1 , … , x n , y ) log p ( x 1 , … , x n ) p ( y ) p ( x 1 , … , x n , y ) = x 1 , … , x n , y ∑ p ( x 1 , … , x n , y ) ( log p ( x 1 , … , x n ) 1 − log p ( x 1 , … , x n ∣ y ) 1 ) = x 1 , … , x n , y ∑ p ( x 1 , … , x n , y ) log p ( x 1 ) ⋅ p ( x 2 ∣ x 1 ) ⋅ … ⋅ p ( x n ∣ x 1 , … , x n − 1 ) 1 − x 1 , … , x n , y ∑ p ( x 1 , … , x n , y ) log p ( x 1 ∣ y ) ⋅ p ( x 2 ∣ x 1 , y ) ⋅ … ⋅ p ( x n ∣ x 1 , … , x n − 1 , y ) 1 = x 1 , … , x n , y ∑ p ( x 1 , … , x n , y ) ( i ∈ [ n ] ∑ log p ( x i ∣ x 1 , … , x i − 1 ) p ( x i ∣ x 1 , … , x i − 1 , y ) ) = i = 1 ∑ n I ( Y ; X i ∣ X 1 , … , X i − 1 ) □ \square □
Convexity of Relative Entropy.
D ( p ( x , y ) ∣ ∣ q ( x , y ) ) = D ( p ( x ) ∣ ∣ q ( x ) ) + D ( p ( y ∣ x ) ∣ ∣ q ( y ∣ x ) ) .
\mathbf{D}( p(x, y) || q(x, y) ) = \mathbf{D}( p(x) || q(x) ) + \mathbf{D}( p(y \mid x) || q(y \mid x) ).
D ( p ( x , y ) ∣∣ q ( x , y )) = D ( p ( x ) ∣∣ q ( x )) + D ( p ( y ∣ x ) ∣∣ q ( y ∣ x )) .
Proof.
D ( p ( x , y ) ∣ ∣ q ( x , y ) ) = ∑ x , y p ( x , y ) log p ( x ) p ( y ∣ x ) q ( x ) q ( y ∣ x ) = ∑ x , y p ( x , y ) log p ( x ) q ( x ) + ∑ x , y p ( x , y ) log p ( y ∣ x ) q ( y ∣ x ) = D ( p ( x ) ∣ ∣ q ( x ) ) + D ( p ( y ∣ x ) ∣ ∣ q ( y ∣ x ) )
\begin{aligned}
\mathbf{D}( p(x, y) || q(x, y) )
&= \sum_{x, y} p(x, y) \log \frac{ p(x) p(y \mid x) }{q(x) q (y \mid x) }
\\
&= \sum_{x, y} p(x, y) \log \frac{ p(x) }{q(x) } + \sum_{x, y} p(x, y) \log \frac{ p(y \mid x) }{ q (y \mid x) }
\\
&= \mathbf{D}( p(x) || q(x) ) + \mathbf{D}( p(y \mid x) || q(y \mid x) )
\end{aligned}
D ( p ( x , y ) ∣∣ q ( x , y )) = x , y ∑ p ( x , y ) log q ( x ) q ( y ∣ x ) p ( x ) p ( y ∣ x ) = x , y ∑ p ( x , y ) log q ( x ) p ( x ) + x , y ∑ p ( x , y ) log q ( y ∣ x ) p ( y ∣ x ) = D ( p ( x ) ∣∣ q ( x )) + D ( p ( y ∣ x ) ∣∣ q ( y ∣ x )) □ \square □
← Back to all notes Back to top ↑