Skip to main content
3 of 4
deleted 22 characters in body
lchen
  • 367
  • 4
  • 12

A variant of Huffman code

Given an alphabet of $n$ symbols with probabilities $p_i$ for symbol $i$, we need to encode the symbols (in a prefix-free way) to minimize the expression $$a(1-a)L,$$ where $L$ is the average code length for a symbol, and $a$ is the relative frequency of $1$s in all codewords. Apparently Huffman code is not optimal in this particular context. Is there a way to find the optimal code?

lchen
  • 367
  • 4
  • 12