The Shannon-Fano lengths are
One corresponding prefix-free assignment is
Its expected word length is
The Huffman coding merges are
For example, the resulting code may be
Its expected length is
The binary entropy is
The Shannon source coding theorem requires
for the standard Shannon construction, while every prefix code obeys the lower bound. Numerically,
Thus both codes satisfy the theorem, with the Huffman code closer to the entropy lower bound.

Articles by others on the same topic (0)

There are currently no matching articles.