Shannon's source coding theorem

From Wikipedia, the free encyclopedia

(Redirected from Source coding theorem)
Jump to: navigation, search

In information theory, Shannon's source coding theorem (or noiseless coding theorem) establishes the limits to possible data compression, and the operational meaning of the Shannon entropy.

The source coding theorem shows that (in the limit, as the length of a stream of i.i.d. data tends to infinity) no compression of the data is possible into a shorter message length than the total Shannon entropy, without it being virtually certain that information will be lost. But compression arbitrarily close to the Shannon entropy is possible, with negligible probability of loss.

The source coding theorem for symbol codes places an upper and a lower bound on the minimal possible expected length of codewords as a function of the entropy of the input word (which is viewed as a random variable) and of the size of the target alphabet.

Contents

[edit] Statements

Source coding is a mapping from (a sequence of) symbols from an information source to a sequence of alphabet symbols (usually bits) such that the source symbols can be exactly recovered from the binary bits (lossless source coding) or recovered within some distortion (lossy source coding). This is the concept behind data compression.

[edit] Source coding theorem

In information theory, the source coding theorem (Shannon 1948) informally states that:

"N i.i.d. random variables each with entropy H(X) can be compressed into more than NH(X) bits with negligible risk of information loss, as N tends to infinity; but conversely, if they are compressed into fewer than NH(X) bits it is virtually certain that information will be lost." (MacKay 2003).

[edit] Source coding theorem for symbol codes

Let <math>\Sigma_1</math>, <math>\Sigma_2</math> denote two finite alphabets and let <math>\Sigma_1^*</math> and <math>\Sigma_2^*</math> denote the set of all finite words from those alphabets (respectively).

Suppose that X is a random variable taking values in <math>\Sigma_1</math> and let f be a decipherable code from <math>\Sigma_1^*</math> to <math>\Sigma_2^*</math> where <math>|\Sigma_2|=a</math>. Let S denote the random variable given by the wordlength f(X).

If f is optimal in the sense that it has the minimal expected wordlength for X, then

<math> \frac{H(X)}{\log_2 a} \leq \mathbb{E}S < \frac{H(X)}{\log_2 a} +1 </math>

(Shannon 1948)

[edit] Proof: Source coding theorem

Given <math>X</math> is an i.i.d. source, its time series X1, ..., Xn is i.i.d. with entropy H(X) in the discrete-valued case and differential entropy in the continuous-valued case. The Source coding theorem states that for any <math> \epsilon > 0 </math> for any rate larger than the entropy of the source, there is large enough <math> n </math> and an encoder that takes <math> n </math> i.i.d. repetition of the source, <math> X^{1:n} </math>, and maps it to <math> n.(H(X)+\epsilon) </math> binary bits such that the source symbols <math> X^{1:n} </math> are recoverable from the binary bits with probability at least <math> 1 - \epsilon </math>.

Proof for achievablity

Fix some for any <math> \epsilon > 0 </math>. The typical set,<math>A_n^\epsilon</math>, is defined as follows:

<math> A_n^\epsilon =\; \left\{x_1^n : \left|-\frac{1}{n} \log p(X_1, X_2, ..., X_n) - H_n(X)\right|<\epsilon \right\}</math>

AEP shows that for large enough n, the probability that a sequence generated by the source lies in the typical set,<math>A_n^\epsilon</math>, defined as approaches one. In particular there for large enough n, <math>P(A_n^\epsilon)>1-\epsilon</math> (See AEP for a proof):

The definition of typical sets implies that those sequences that lie in the typical set satisfy:

<math>

2^{-n(H(X)+\epsilon)} \leq p(x_1, x_2, ..., x_n) \leq 2^{-n(H(X)-\epsilon)} </math>

Note that:

  • The probability of a sequence from <math>X</math> being drawn from <math>{A_\epsilon}^{(n)}</math> is greater than <math>1-\epsilon</math>
  • <math>\left| {A_\epsilon}^{(n)} \right| \leq 2^{n(H(X)+\epsilon)}</math> since the probability of the whole set <math>{A_\epsilon}^{(n)}</math> is at most one.
  • <math>\left| {A_\epsilon}^{(n)} \right| \geq (1-\epsilon)2^{n(H(X)-\epsilon)}</math>. For the proof, use the upper bound on the probability of each term in typical set and the lower bound on the probability of the whole set <math>{A_\epsilon}^{(n)}</math>.

Since <math>\left| {A_\epsilon}^{(n)} \right| \leq 2^{n(H(X)+\epsilon)}, n.(H(X)+\epsilon)\; </math> bits are enough to point to any string in this set.

The encoding algorithm: The encoder checks if the input sequence lies within the typical set; if yes, it outputs the index of the input sequence within the typical set; if not, the encoder outputs an arbitrary <math> n.(H(X)+\epsilon) </math> digit number. As long as the input sequence lies within the typical set (with probability at least <math>1-\epsilon</math>), the encoder doesn't make any error. So, the probability of error of the encoder is bounded above by <math>\epsilon</math>

Proof for converse The converse is proved by showing that any set of size smaller than <math>A_n^\epsilon</math> (in the sense of exponent) would cover a set of probability bounded away from 1.

[edit] Proof: Source coding theorem for symbol codes

Let <math>s_i</math> denote the wordlength of each possible <math>x_i</math> (<math>i=1,\ldots,n</math>). Define <math>q_i = a^{-s_i}/C</math>, where C is chosen so that <math> \sum q_i = 1</math>.

Then

<math>

\begin{matrix} H(X) &=& - \sum_{i=1}^n p_i \log_2 p_i \\ && \\ &\leq& - \sum_{i=1}^n p_i \log_2 q_i \\ && \\ &=& - \sum_{i=1}^n p_i \log_2 a^{-s_i} + \sum_{i=1}^n \log_2 C \\ && \\ &\leq& - \sum_{i=1}^n - s_i p_i \log_2 a \\ && \\ &\leq& - \mathbb{E}S \log_2 a \\ \end{matrix} </math>

where the second line follows from Gibbs' inequality and the third line follows from Kraft's inequality: <math>C = \sum_{i=1}^n a^{-s_i} \leq 1</math> so <math>\log C \leq 0</math>.

For the second inequality we may set

<math>s_i = \lceil - \log_a p_i \rceil </math>

so that

<math> - \log_a p_i \leq s_i < -\log_a p_i + 1 </math>

and so

<math> a^{-s_i} \leq p_i</math>

and

<math> \sum a^{-s_i} \leq \sum p_i = 1</math>

and so by Kraft's inequality there exists a prefix-free code having those wordlengths. Thus the minimal S satisfies

<math>

\begin{matrix} \mathbb{E}S & = & \sum p_i s_i \\ && \\ & < & \sum p_i \left( -\log_a p_i +1 \right) \\ && \\ & = & \sum - p_i \frac{\log_2 p_i}{\log_2 a} +1 \\ && \\ & = & \frac{H(X)}{\log_2 a} +1 \\ \end{matrix} </math>

[edit] Extension to non-stationary independent sources

[edit] Fixed Rate lossless source coding for discrete time non-stationary independent sources

Define typical set <math>A_n^\epsilon</math> as:

<math> A_n^\epsilon =\; \{x_1^n : \left|-\frac{1}{n} \log p(X_1, X_2, ..., X_n) - \bar{H_n}(X)\right|<\epsilon \}</math>

Then, for given <math>\delta>0</math>, for n large enough, <math>\Pr(A_n^\epsilon)> 1-\delta </math>. Now we just encode the sequences in the typical set, and usual methods in source coding show that the cardinality of this set is smaller than <math>2^{n(\bar{H_n}(X)+\epsilon)}</math>. Thus, on an average, <math>\bar{H_n}(X)+\epsilon</math> bits suffice for encoding with probability greater than <math>1-\delta</math>, where <math>\epsilon\; \mbox{ and }\; \delta</math> can be made arbitrarily small, by making n larger.

[edit] See also

it:Primo teorema di Shannon

Views
Personal tools

Toolbox