The source S is a first-order Markov information source outputting 0 and 1. 0 is followed by 0 with a probability of 0.9 and 1 is followed by 1 with a probability of 0.6. The following may be used. log23=1.58,log25=2.32. For the calculations, two significant digits are sufficient.
(1) Show a state transition diagram of the source S.
(2) Obtain the probability of each 0 and 1 output from the source S.
(3) Obtain the entropy of the source S.
Assume the following four methods of coding to compress the output symbols of the source S.
a. fixed-length coding of fixed-length symbol sequences
b. variable-length coding of fixed-length symbol sequences
c. fixed-length coding of variable-length symbol sequences
d. variable-length coding of variable-length symbol sequences
Consider the fixed-length symbol sequences as 00,01,10 and 11 , and the variable-length symbol sequences as 000,001,01, and 1 that are 0's run lengths up to length 3. The variable-length coding is Huffman coding consisting of 0 and 1.
(4) Obatain the probability of each of the fixed-length symbol sequences of 00,01,10, and 11.
(5) In the case b , show the Huffman code and obtain the average code length per symbol of the sources S .
(6) Obtain the probability of each of the variable-length symbol sequences of 000,001,01, and 1.
(7) In the case c , obtain the average code length per symbol of the source S .
(8) Show the Huffman code for the case d and obtain the average code length per symbol of the source S.
(9) Arrange the methods of a , b , c , and d from the shortest to the longest in terms of the average code length.
For continuous, non-overlapping parsing into these phrases, the phrase boundaries have a different stationary distribution. Let q be the probability that the symbol immediately before a phrase is 0. A phrase ends in 0 exactly when it is 000, so
q=0.93q+0.4(0.9)2(1−q),q=595324.
The probability that the next phrase begins in 0 is then
a=0.9q+0.4(1−q)=11980.
Consequently the long-run phrase probabilities for continuous compression are
Under continuous parsing, the mean number of source symbols in a phrase is
E[ℓ]=5953(324+36)+2(40)+195=119271.
Case c uses two bits per phrase, giving
Lc=E[ℓ]2=271238≃0.88bit/symbol.
If each phrase is instead independently started with the source's stationary symbol distribution, the probabilities in the first line of (6) give 2/2.52≃0.79 bit/symbol for that model.