Uniform-source Huffman length distribution (source code)

= Uniform-source Huffman length distribution
{title2=$s=\lceil\log_2m\rceil$}

For $m\ge2$ equiprobable symbols, the maximum <codeword length> of a binary <Huffman code> is $s=\lceil\log_2m\rceil$. Exactly $2^s-m$ codewords have length $s-1$ and $2m-2^s$ have length $s$. The <balancing exchange for a uniform optimal prefix code> restricts the depths to these two levels; counting leaves and using equality in the <Kraft inequality> determine the numbers.

// Target: probability-and-statistics.bigb