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?
A variant of Huffman code
lchen
- 367
- 4
- 12