Shannon-Fano-Elias code

ID: shannon-fano-elias-code

For positive source probabilities in a fixed order, let and . The Shannon-Fano-Elias code uses the first binary digits of the midpoint , using the terminating-zero expansion at dyadic rationals. Its dyadic interval contains and has width at most , so it lies inside the probability cell . These cells are disjoint, whereas a codeword that is a prefix of another has a dyadic interval containing the other interval. The code is therefore a prefix code. Since , averaging proves . This is a direct cumulative construction and does not require sorting the probabilities or constructing a Huffman tree.

New to topics? Read the docs here!