Every binary prefix code has expected length at least its source entropy; Shannon lengths achieve expected length strictly below .
For a complete binary prefix code with lengths , the Kraft inequality is an equality: . Put . The difference between expected codeword length and Shannon entropy is
The Kullback-Leibler divergence is nonnegative and vanishes exactly when . Hence a complete code is entropy-tight exactly for its dyadic matching source. For example, lengths match probabilities . Being an optimal prefix code among symbol-by-symbol codes is a weaker condition and does not imply this equality.
For a discrete memoryless source of entropy , every uniquely decodable binary code has expected length at least . Shannon code lengths satisfy , and block coding can make the expected length per source symbol arbitrarily close to .

Articles by others on the same topic (0)

There are currently no matching articles.