English

Competitive Advantage of Huffman and Shannon-Fano Codes

Information Theory 2024-04-11 v3 math.IT

Abstract

For any finite discrete source, the competitive advantage of prefix code C1C_1 over prefix code C2C_2 is the probability C1C_1 produces a shorter codeword than C2C_2, minus the probability C2C_2 produces a shorter codeword than C1C_1. For any source, a prefix code is competitively optimal if it has a nonnegative competitive advantage over all other prefix codes. In 1991, Cover proved that Huffman codes are competitively optimal for all dyadic sources, namely sources whose symbol probabilities are negative integer powers of 22. We prove the following asymptotic converse: As the source size grows, the probability a Huffman code for a randomly chosen non-dyadic source is competitively optimal converges to zero. We also prove: (i) For any non-dyadic source, a Huffman code has a positive competitive advantage over a Shannon-Fano code; (ii) For any source, the competitive advantage of any prefix code over a Huffman code is strictly less than 13\frac{1}{3}; (iii) For each integer n>3n>3, there exists a source of size nn and some prefix code whose competitive advantage over a Huffman code is arbitrarily close to 13\frac{1}{3}; and (iv) For each positive integer nn, there exists a source of size nn and some prefix code whose competitive advantage over a Shannon-Fano code becomes arbitrarily close to 11 as nn\to\infty.

Keywords

Cite

@article{arxiv.2311.07009,
  title  = {Competitive Advantage of Huffman and Shannon-Fano Codes},
  author = {Spencer Congero and Kenneth Zeger},
  journal= {arXiv preprint arXiv:2311.07009},
  year   = {2024}
}