Shannon's source coding theorem

From Wikipedia, the free encyclopedia
(Redirected from Source coding theorem)
Jump to navigation Jump to search

Template:Short description Template:Information theory

Script error: No such module "about".

In information theory, Shannon's source coding theorem (or noiseless coding theorem) establishes the statistical limits to possible data compression for data whose source is an independent identically-distributed random variable, and the operational meaning of the Shannon entropy.

Named after Claude Shannon, the source coding theorem shows that, in the limit, as the length of a stream of independent and identically-distributed random variable (i.i.d.) data tends to infinity, it is impossible to compress such data such that the code rate (average number of bits per symbol) is less than the Shannon entropy of the source, without it being virtually certain that information will be lost. However it is possible to get the code rate arbitrarily close to the Shannon entropy, 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.

Note that, for data that exhibits more dependencies (whose source is not an i.i.d. random variable), the Kolmogorov complexity, which quantifies the minimal description length of an object, is more suitable to describe the limits of data compression. Shannon entropy takes into account only frequency regularities while Kolmogorov complexity takes into account all algorithmic regularities, so in general the latter is smaller. On the other hand, if an object is generated by a random process in such a way that it has only frequency regularities, entropy is close to complexity with high probability (Shen et al. 2017).[1]

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 alphabet symbols (lossless source coding) or recovered within some distortion (lossy source coding). This is one approach to data compression.

Source coding theorem

In information theory, the source coding theorem (Shannon 1948)[2] informally states that (MacKay 2003, pg. 81,[3] Cover 2006, Chapter 5[4]):

Template:Mvar i.i.d. random variables each with entropy H(X)Script error: No such module "Check for unknown parameters". can be compressed into more than N H(X)Script error: No such module "Check for unknown parameters". bits with negligible risk of information loss, as N → ∞Script error: No such module "Check for unknown parameters".; but conversely, if they are compressed into fewer than N H(X)Script error: No such module "Check for unknown parameters". bits it is virtually certain that information will be lost.

The coded sequence of length

NH(X)

represents the compressed message in a biunivocal way, under the assumption that the decoder knows the source. From a practical point of view, this assumption is not always true. Consequently, when the entropy encoding is applied, the transmitted message may need to include information characterizing the source, usually inserted at the beginning of the transmitted message.

Source coding theorem for symbol codes

Let Σ1, Σ2Script error: No such module "Check for unknown parameters". denote two finite alphabets and let ΣScript error: No such module "Su".Script error: No such module "Check for unknown parameters". and ΣScript error: No such module "Su".Script error: No such module "Check for unknown parameters". denote the set of all finite words from those alphabets (respectively).

Suppose that Template:Mvar is a random variable taking values in Σ1Script error: No such module "Check for unknown parameters". and let fScript error: No such module "Check for unknown parameters". be a uniquely decodable code from ΣScript error: No such module "Su".Script error: No such module "Check for unknown parameters". to ΣScript error: No such module "Su".Script error: No such module "Check for unknown parameters". where 2| = aScript error: No such module "Check for unknown parameters".. Let Template:Mvar denote the random variable given by the length of codeword f (X)Script error: No such module "Check for unknown parameters"..

If fScript error: No such module "Check for unknown parameters". is optimal in the sense that it has the minimal expected word length for Template:Mvar, then (Shannon 1948):

H(X)log2a𝔼[S]<H(X)log2a+1

Where 𝔼 denotes the expected value operator.

Proof: source coding theorem

Given Template:Mvar is an i.i.d. source, its time series X1, ..., XnScript error: No such module "Check for unknown parameters". is i.i.d. with entropy H(X)Script error: No such module "Check for unknown parameters". in the discrete-valued case and differential entropy in the continuous-valued case. The Source coding theorem states that for any ε > 0Script error: No such module "Check for unknown parameters"., i.e. for any rate H(X) + εScript error: No such module "Check for unknown parameters". larger than the entropy of the source, there is large enough Template:Mvar and an encoder that takes Template:Mvar i.i.d. repetition of the source, X1:nScript error: No such module "Check for unknown parameters"., and maps it to n(H(X) + ε)Script error: No such module "Check for unknown parameters". binary bits such that the source symbols X1:nScript error: No such module "Check for unknown parameters". are recoverable from the binary bits with probability of at least 1 − εScript error: No such module "Check for unknown parameters"..

Proof of Achievability. Fix some ε > 0Script error: No such module "Check for unknown parameters"., and let

p(x1,,xn)=Pr[X1=x1,,Xn=xn].

The typical set, AScript error: No such module "Su".Script error: No such module "Check for unknown parameters"., is defined as follows:

Anε={(x1,,xn) : |1nlogp(x1,,xn)Hn(X)|<ε}.

The asymptotic equipartition property (AEP) shows that for large enough Template:Mvar, the probability that a sequence generated by the source lies in the typical set, AScript error: No such module "Su".Script error: No such module "Check for unknown parameters"., as defined approaches one. In particular, for sufficiently large Template:Mvar, P((X1,X2,,Xn)Anε) can be made arbitrarily close to 1, and specifically, greater than 1ε (See AEP for a proof).

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

2n(H(X)+ε)p(x1,,xn)2n(H(X)ε)


  • The probability of a sequence (X1,X2,Xn) being drawn from AScript error: No such module "Su".Script error: No such module "Check for unknown parameters". is greater than 1 − εScript error: No such module "Check for unknown parameters"..
  • |Anε|2n(H(X)+ε), which follows from the left hand side (lower bound) for p(x1,x2,xn).
  • |Anε|(1ε)2n(H(X)ε), which follows from upper bound for p(x1,x2,xn) and the lower bound on the total probability of the whole set AScript error: No such module "Su".Script error: No such module "Check for unknown parameters"..

Since |Anε|2n(H(X)+ε),n(H(X)+ε) 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 n(H(X) + ε)Script error: No such module "Check for unknown parameters". digit number. As long as the input sequence lies within the typical set (with probability at least 1 − εScript error: No such module "Check for unknown parameters".), the encoder does not make any error. So, the probability of error of the encoder is bounded above by Template:Mvar.

Proof of converse: the converse is proved by showing that any set of size smaller than AScript error: No such module "Su".Script error: No such module "Check for unknown parameters". (in the sense of exponent) would cover a set of probability bounded away from 1Script error: No such module "Check for unknown parameters"..

Proof: Source coding theorem for symbol codes

For 1 ≤ inScript error: No such module "Check for unknown parameters". let siScript error: No such module "Check for unknown parameters". denote the word length of each possible xiScript error: No such module "Check for unknown parameters".. Define qi=asi/C, where Template:Mvar is chosen so that q1 + ... + qn = 1Script error: No such module "Check for unknown parameters".. Then

H(X)=i=1npilog2pii=1npilog2qi=i=1npilog2asi+i=1npilog2C=i=1npilog2asi+log2Ci=1nsipilog2a=𝔼Slog2a

where the second line follows from Gibbs' inequality and the fifth line follows from Kraft's inequality:

C=i=1nasi1

so log C ≤ 0Script error: No such module "Check for unknown parameters"..

For the second inequality we may set

si=logapi

so that

logapisi<logapi+1

and so

asipi

and

asipi=1

and so by Kraft's inequality there exists a prefix-free code having those word lengths. Thus the minimal Template:Mvar satisfies

𝔼S=pisi<pi(logapi+1)=pilog2pilog2a+1=H(X)log2a+1

Extension to non-stationary independent sources

Fixed rate lossless source coding for discrete time non-stationary independent sources

Define typical set AScript error: No such module "Su".Script error: No such module "Check for unknown parameters". as:

Anε={x1n : |1nlogp(X1,,Xn)Hn(X)|<ε}.

Then, for given δ > 0Script error: No such module "Check for unknown parameters"., for Template:Mvar large enough, Pr(AScript error: No such module "Su".) > 1 − δScript error: No such module "Check for unknown parameters".. 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 2n(Hn(X)+ε). Thus, on an average, Hn(X) + εScript error: No such module "Check for unknown parameters". bits suffice for encoding with probability greater than 1 − δScript error: No such module "Check for unknown parameters"., where Template:Mvar and Template:Mvar can be made arbitrarily small, by making Template:Mvar larger.

See also

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".
  2. C.E. Shannon, "A Mathematical Theory of Communication Template:Webarchive", Bell System Technical Journal, vol. 27, pp. 379–423, 623-656, July, October, 1948
  3. David J. C. MacKay. Information Theory, Inference, and Learning Algorithms Cambridge: Cambridge University Press, 2003. Template:ISBN
  4. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".