Uniquely Decodable Codes in data compression

The average length of the code is not the only important point in designing a “good” code. Consider the following example adapted from [10]. Suppose our source alphabet consists of four letters a1, a2, a3, and a4, with probabilities P(a1)= 1/ 2 , P(a2) = 1 /4 , and P(a3) = P(a4) = 1 /8 . The entropy for this source is 1.75 bits/symbol. Consider the codes for this source in Table

LettersProbabilityCode 1Code 2Code 3Code 4
      
a1050000
a2025011001
a30125100110011
a4012510111110111
Average length1.1251.251.751.875
      
Four different codes for a four-letter
 alphabet

The average length l for for each code is given by

The average length l for for each code is given by
The average length l for for each code is given by

Leave a Comment