Information Theory 定理总结及推导

information_theory

Chapter 1 Information Theory for Discrete Variables

(1) Message Sets

What is a message? Shannon suggested that a message has to do with choice and sets. In his words: The significant aspect is that the actual message is one selected from a set of possible messages.

(2) Measuring Choice

Shannon was interested in defining a quantity that will measure, in some sense, how much information is “produced” by choosing messages. He suggested that the logarithm of the number of elements in the message set can be regarded as a measure of the information produced when one message is chosen from the set, all choices being equally likely.

For example, consider a fair coin that takes on values in $\left\{Heads,Tails\right\}$$\{Heads, Tails\}$ and suppose we flip the coin $n$$n$ times. The string of coin flips takes on one of ${2}^{n}$$2^n$ values, all equally likely, and the information produced is $\log_2{2^n}=n \ bits.$

For non-equally likely choices, Shannon developed a measure that has the same form as the entropy in statistical mechanics. For example, consider a biased coin that takes on the value Heads with probability $p$$p$ and Tails with probability $1-p$$1-p$. The string of coin flips takes on $\left(\genfrac{}{}{0}{}{n}{np}\right)$$n\choose np$ values (since the expected number of Heads is $np$$np$). Shannon proposed that the information produced when flipping the coin $n$$n$ times is

(3) Entropy

Let $supp\left(f\right)$$supp(f)$ be the support set of the function $f$$f$, i.e., the set of $a$$a$ such that $f\left(a\right)>0$$f(a) > 0$. We define the entropy or uncertainty of the discrete random variable $X$$X$ as

$\begin{array}{}& H\left(X\right)=\sum _{a\in supp\left({P}_{X}\right)}-{P}_{X}\left(a\right){\mathrm{log}}_{2}{P}_{X}\left(a\right)=E\left[-{\mathrm{log}}_{2}{P}_{X}\left(X\right)\right]\end{array}$

Example 1.1

The entropy $H\left(X\right)$$H(X)$ depends only on the probability distribution ${P}_{X}\left(\cdot \right)$$P_X(\cdot)$， and not on the letters $a$$a$ in alphabet of $X$$X$. We thus have

$\begin{array}{}& H\left(X\right)=H\left(g\left(X\right)\right)\end{array}$

for any invertible or bijective function $g\left(\cdot \right)$$g(\cdot)$, since $g\left(\cdot \right)$$g(\cdot)$ simply relabels the letters in the alphabet. Examples include $Y={2}^{X}$$Y=2^X$.

Example 1.2

Consider the Bernoulli distribution that has an alphabet $\left\{0,1\right\}$$\{0,1\}$ and ${P}_{X}\left(1\right)=p$$P_X(1)=p$. The entropy of $X$$X$ is

$\begin{array}{}& {H}_{2}\left(p\right)=-p{\mathrm{log}}_{2}p-\left(1-p\right){\mathrm{log}}_{2}\left(1-p\right)\end{array}$

and ${H}_{2}\left(\right)$$H_2()$ is called the binary entropy function.

Theorem 1.1

$\begin{array}{}& 0\le H\left(X\right)\le {\mathrm{log}}_{2}|X|\end{array}$

with equality on the left iff. there is one letter $a$$a$ in $X$$X$ with ${P}_{X}\left(a\right)=1$$P_X(a)=1$, and with equality on the right iff. ${P}_{X}\left(a\right)=\frac{1}{|X|}$$P_X(a)=\frac{1}{|X|}$ for any $a\in X$$a\in X$, i.e., $X$$X$ in uniformly distributed.

Proof. of right equality

$\begin{array}{rcl}{\mathrm{log}}_{2}\left(x\right)& =& \mathrm{ln}\left(x\right){\mathrm{log}}_{x}\left(2\right)\le \left(x-1\right){\mathrm{log}}_{2}\left(e\right)\\ H\left(X\right)& =& E\left[{\mathrm{log}}_{x}\frac{1}{|X|{P}_{X}\left(X\right)}\right]+{\mathrm{log}}_{2}|X|\\ & \le & E\left[\frac{1}{|X|{P}_{X}\left(X\right)}-1\right]{\mathrm{log}}_{2}\left(e\right)+{\mathrm{log}}_{2}|X|\\ & =& {\mathrm{log}}_{2}\left(e\right)\sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right)\left(\frac{1}{|X|{P}_{X}\left(X\right)}-1\right)+{\mathrm{log}}_{2}|X|\\ & =& {\mathrm{log}}_{2}\left(e\right)\left(\frac{|supp\left({P}_{X}\right)}{|X|}-1\right)+{\mathrm{log}}_{2}|X|\\ & \le & {\mathrm{log}}_{2}|x|\end{array}$

(5) Conditional Entropy

Consider the joint distribution ${P}_{XY}\left(\right)$$P_{XY}()$ where $X$$X$ and $Y$$Y$ are discrete random variables.

Focusing on one line of the table of joint distribution, we get the conditional entropy of $X$$X$ given the event $Y=b$$Y=b$ with $Pr\left[Y=b\right]>0$$Pr[Y=b]>0$ is

$\begin{array}{rcl}H\left(X|Y=b\right)& =& \sum _{a\in supp\left({P}_{X|Y}\left(\cdot |b\right)\right)}-{P}_{X|Y}\left(a|b\right){\mathrm{log}}_{2}{P}_{X|Y}\left(a|b\right)\\ & =& E\left[-{\mathrm{log}}_{2}{P}_{X|Y}\left(X|Y=b\right)\right].\end{array}$

Similarly,

$\begin{array}{}& 0\le H\left(X|Y=b\right)\le {\mathrm{log}}_{2}|X|\end{array}$

with equality on the left iff. ${P}_{X|Y}\left(a|b\right)=1$$P_{X|Y}(a|b)=1$ for some $a$$a$, and with equality on the right iff. ${P}_{X|Y}\left(a|b\right)=\frac{1}{|X|}$$P_{X|Y}(a|b)=\frac{1}{|X|}$ for any $a\in X$$a\in X$.

We average the conditional entropy on all $b\in Y$$b\in Y$ and get the conditional entropy of $X$$X$ given $Y$$Y$

$\begin{array}{rcl}H\left(X|Y\right)& =& \sum _{b\in supp\left({P}_{Y}\right)}{P}_{Y}\left(b\right)H\left(X|Y=b\right)\\ & =& \sum _{\left(a,b\right)\in supp\left({P}_{XY}\right)}-{P}_{XY}\left(a,b\right){\mathrm{log}}_{2}{P}_{X|Y}\left(a|b\right)\\ & =& E\left[-{\mathrm{log}}_{2}{P}_{X|Y}\left(X|Y\right)\right].\end{array}$

Also,

$\begin{array}{}& 0\le H\left(X|Y\right)\le {\mathrm{log}}_{2}|X|\end{array}$

with equality on the left iff. there is one $a$$a$ such that ${P}_{X|Y}\left(a|b\right)=1$$P_{X|Y}(a|b)=1$ for every $b$$b$. And with equality on the right iff. ${P}_{X|Y}\left(a|b\right)=\frac{1}{|X|}$$P_{X|Y}(a|b)=\frac{1}{|X|}$ for any $a\in X$$a\in X$ and for every $b$$b$.

Example 1.3

We say that $Y$$Y$ essentially determines $X$$X$ if $H\left(X|Y\right)=0$$H(X|Y)=0$).

Recall Example 1.1, $g\left(X\right)$$g(X)$ is invertible, $H\left(X\right)=H\left(g\left(X\right)\right)$$H(X)= H(g(X))$. $X$$X$ determines $g\left(X\right)$$g(X)$ and $g\left(X\right)$$g(X)$ determines $X$$X$

$\begin{array}{}& H\left(g\left(X\right)|X\right)=H\left(X|g\left(X\right)\right)=0.\end{array}$

For a non-invertible function $f\left(X\right)$$f(X)$, $H\left(X\right)\ne H\left(f\left(X\right)\right)$$H(X)\neq H(f(X))$ since the probability distribution of $X$$X$ and $f\left(X\right)$$f(X)$ might be different. $X$$X$ still determines $f\left(X\right)$$f(X)$ but $f\left(X\right)$$f(X)$ no longer determines $X$$X$

$\begin{array}{}& \begin{array}{c}H\left(f\left(X\right)|X\right)=0\\ H\left(X|f\left(X\right)\right)\ne 0.\end{array}\end{array}$

Examples include $Y=|X|$$Y=|X|$ and $Y=cosX$$Y=cosX$.

(6) Joint Entropy

The joint entropy of $X$$X$ and $Y$$Y$ is defined by considering the concatenation (not multiplication!) $XY$$XY$ of $X$$X$ and $Y$$Y$ as a new discrete random variable, i.e., we have

$\begin{array}{}& H\left(XY\right)=\sum _{\left(a,b\right)\in supp\left({P}_{XY}\right)}-{P}_{XY}\left(a,b\right){\mathrm{log}}_{2}{P}_{XY}\left(a,b\right)=E\left[-{\mathrm{log}}_{2}{P}_{XY}\left(X,Y\right)\right]\end{array}$

and

$\begin{array}{}& max\left(H\left(X\right),H\left(Y\right)\right)\le H\left(XY\right)\le {\mathrm{log}}_{2}\left(|X|\cdot |Y|\right)\end{array}$

with equality on the left iff. $X$$X$ essentially determines $Y$$Y$, or $Y$$Y$ essentially determines $X$$X$, or both. And with equality on the right iff. ${P}_{XY}\left(a,b\right)=\frac{1}{|X||Y|}$$P_{XY}(a,b)=\frac{1}{|X||Y|}$ for all $\left(a,b\right)$$(a,b)$.

Example 1.5

$\begin{array}{}& H\left(XY|Z\right)\ge H\left(X|Z\right).\end{array}$

Proof.

$\begin{array}{}& H\left(XY|Z\right)=H\left(X|Z\right)+H\left(Y|XZ\right)\ge H\left(X|Z\right).\end{array}$

Example 1.6

Using conclusions about conditional entropy in Example 1.3, we study the joint distribution $H\left(Xf\left(X\right)\right)$$H(Xf(X))$ and $H\left(Xg\left(X\right)\right)$$H(Xg(X))$.

For a invertible function $g\left(X\right)$$g(X)$,

$\begin{array}{}& \begin{array}{c}H\left(g\left(X\right)|X\right)=H\left(X|g\left(X\right)\right)=0\\ H\left(Xg\left(X\right)\right)=H\left(X\right)=H\left(g\left(X\right)\right).\end{array}\end{array}$

For a non-invertible function $f\left(X\right)$$f(X)$,

$\begin{array}{}& \begin{array}{c}H\left(f\left(X\right)|X\right)=0\\ H\left(X|f\left(X\right)\right)\ne 0\\ H\left(Xf\left(X\right)\right)=H\left(X\right)\ge H\left(f\left(X\right)\right).\end{array}\end{array}$

(7) Information Divergence / Kullback-Leibler Distance

The informational divergence between ${P}_{X}\left(\cdot \right)$$P_X (\cdot)$ and ${P}_{Y}\left(\cdot \right)$$P_Y (\cdot)$ is defined as

$\begin{array}{}& \begin{array}{c}D\left({P}_{X}\parallel {P}_{Y}\right)=\sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right){\mathrm{log}}_{2}\frac{{P}_{X}\left(a\right)}{{P}_{Y}\left(a\right)}\\ =E\left[{\mathrm{log}}_{x}\frac{{P}_{X}\left(X\right)}{{P}_{Y}\left(X\right)}\right]\end{array}\end{array}$

We define $D\left({P}_{X}\parallel {P}_{Y}\right)=\mathrm{\infty }$$D(P_X\parallel P_Y ) = \infin$ if ${P}_{Y}\left(a\right)=0$$P_Y (a) = 0$ for some $a\in supp\left({P}_{X}\right)$$a\in supp(P_X)$.

Observe that the definition is not symmetric in ${P}_{X}$$P_X$ and ${P}_{Y}$$P_Y$ , i.e., we have $D\left({P}_{X}\parallel {P}_{Y}\right)\ne D\left({P}_{Y}\parallel {P}_{X}\right)$$D(P_X\parallel P_Y ) \neq D(P_Y\parallel P_X )$ in general.

To avoid the case $D\left({P}_{X}\parallel {P}_{Y}\right)=\mathrm{\infty }$$D(P_X\parallel P_Y ) = \infin$ we introduce the notation ${P}_{Y}\gg {P}_{X}$$P_Y\gg P_X$ to mean that ${P}_{Y}\left(a\right)=0⇒{P}_{X}\left(a\right)=0$$P_Y(a)=0 \Rightarrow P_X(a)=0$ for all $a\in X$$a\in X$. In other words, ${P}_{Y}\gg {P}_{X}$$P_Y\gg P_X$ implies that $supp\left({P}_{X}\right)\subseteq supp\left({P}_{Y}\right)$$supp(P_X)\subseteq supp(P_Y)$, or $D\left({P}_{X}\parallel {P}_{Y}\right)<\mathrm{\infty }$$D(P_X\parallel P_Y ) < \infin$ for finite sets.

Given a third discrete random variable $Z$$Z$, we define the conditional information divergence between ${P}_{X|Z}\left(\cdot \right)$$P_{X|Z}(\cdot)$ and ${P}_{Y|Z}\left(\cdot \right)$$P_{Y|Z}(\cdot)$ as

$\begin{array}{rcl}D\left({P}_{X|Z}\parallel {P}_{Y|Z}|{P}_{Z}\right)& =& \sum _{c\in supp\left({P}_{Z}\right)}{P}_{Z}\left(c\right)D\left({P}_{X|Z}\left(\cdot |c\right)\parallel {P}_{Y|Z}\left(\cdot |c\right)\right)\\ & =& \sum _{c\in supp\left({P}_{Z}\right)}{P}_{Z}\left(c\right)D\left({P}_{X|Z}\left(\cdot |c\right)\parallel {P}_{Y|Z}\left(\cdot |c\right)\right)\\ & =& \sum _{c\in supp\left({P}_{Z}\right)}{P}_{Z}\left(c\right)\sum _{a\in supp\left({P}_{X|Z}\left(\cdot |c\right)\right)}{P}_{X|Z}\left(a|c\right){\mathrm{log}}_{2}\frac{{P}_{X|Z}\left(a|c\right)}{{P}_{Y|Z}\left(a|c\right)}\\ & =& \sum _{\left(a,c\right)\in supp\left({P}_{XZ}\right)}{P}_{XZ}\left(a,c\right){\mathrm{log}}_{2}\frac{{P}_{X|Z}\left(a|c\right)}{{P}_{Y|Z}\left(a|c\right)}\\ & =& E\left[lo{g}_{2}\frac{{P}_{X|Z}\left(X|Z\right)}{{P}_{Y|Z}\left(X|Z\right)}\right]\end{array}$

Theorem 1.2

$\begin{array}{}& D\left({P}_{X}\parallel {P}_{Y}\right)\ge 0\end{array}$

with equality iff. ${P}_{X}\left(a\right)={P}_{Y}\left(a\right)$$P_X (a) = P_Y (a)$ for all $a\in supp\left({P}_{X}\right)$$a\in supp(P_X)$.

Proof.

$\begin{array}{rl}{\mathrm{log}}_{2}\left(x\right)& =\mathrm{ln}\left(x\right){\mathrm{log}}_{x}\left(2\right)\le \left(x-1\right){\mathrm{log}}_{2}\left(e\right)\\ -D\left({P}_{X}\parallel {P}_{Y}\right)& =E\left[{\mathrm{log}}_{2}\frac{{P}_{Y}\left(X\right)}{{P}_{X}\left(X\right)}\right]\\ & \le E\left[\frac{{P}_{Y}\left(X\right)}{{P}_{X}\left(X\right)}-1\right]{\mathrm{log}}_{2}\left(e\right)\\ & =\sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right)\left[\frac{{P}_{Y}\left(a\right)}{{P}_{X}\left(a\right)}-1\right]{\mathrm{log}}_{2}\left(e\right)\\ & \le 0\end{array}$

Example 1.7

If ${P}_{Y}\left(\cdot \right)$$P_Y(\cdot)$ is uniform on X, for $a\in supp\left({P}_{X}\right)$$a\in supp(P_X)$, ${P}_{Y}\left(a\right)=\frac{1}{|X|}$$P_Y(a)=\frac{1}{|X|}$

$\begin{array}{rcl}D\left({P}_{X}\parallel {P}_{Y}\right)& =& \sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right){\mathrm{log}}_{2}\frac{{P}_{X}\left(a\right)}{{P}_{Y}\left(a\right)}\\ & =& \sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right){\mathrm{log}}_{2}{P}_{X}\left(a\right)-\sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right){\mathrm{log}}_{2}{P}_{Y}\left(a\right)\\ & =& -H\left(X\right)+{\mathrm{log}}_{2}|X|\end{array}$

Example 1.8

If ${P}_{X}\left(\cdot \right)$$P_X(\cdot)$ is uniform on X, for $a\in supp\left({P}_{X}\right)$$a\in supp(P_X)$, ${P}_{X}\left(a\right)=\frac{1}{|X|}$$P_X(a)=\frac{1}{|X|}$

$\begin{array}{rcl}D\left({P}_{X}\parallel {P}_{Y}\right)& =& \sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right){\mathrm{log}}_{2}\frac{{P}_{X}\left(a\right)}{{P}_{Y}\left(a\right)}\\ & =& \sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right){\mathrm{log}}_{2}{P}_{X}\left(a\right)-\sum _{a\in supp\left({P}_{X}\right)}{P}_{X}\left(a\right){\mathrm{log}}_{2}{P}_{Y}\left(a\right)\\ & =& -lo{g}_{2}|X|-\frac{1}{|X|}\sum _{a\in supp\left({P}_{X}\right)}{\mathrm{log}}_{2}{P}_{Y}\left(a\right)\end{array}$

Example 1.9

If ${P}_{X}\left(a\right)=1$$P_X(a)=1$ for some $a\in X$$a\in X$,

$\begin{array}{}& D\left({P}_{X}\parallel {P}_{Y}\right)=-{\mathrm{log}}_{2}{P}_{Y}\left(a\right)\end{array}$