Huffman Encoding Symbol Probability

238 Views Asked by At

Prove for two symbols a and b, if p(a) >= p(b), then according to Huffman encoding algorithm, the resultant code length L(a) <= L(b).

I did several examples of this and it is true. But how can I prove this?

1

There are 1 best solutions below

0
On

Assume for the sake of a contradiction that this were not the case. Then you can show that your Huffman code was not chosen correctly --- either that there exists a code with a shorter average code length (but Huffman coding is optimal!) or that the Kraft inequality is not satisfied (but this shouldn't happen either!).