Shannon noiseless coding theorem says the minimum expected binary prefix-code length satisfies . Kraft and Gibbs give for every prefix code. Taking lengths satisfies Kraft because , and gives .
Equiprobability gives .
For , assign every outcome one of the -bit words. This complete fixed-length prefix code has expected length and meets the information entropy lower bound.
If two lengths differed by at least two, replacing two deepest sibling leaves by their parent and splitting a shallower leaf lowers total length, contradicting optimality. Thus lengths are and . Kraft equality gives and , hence

Articles by others on the same topic (0)

There are currently no matching articles.