What is Kraft inequality?
The inequality Σ 2^(−lᵢ) ≤ 1, the necessary and sufficient condition for a binary prefix code with code lengths l₁, l₂, …, lₙ to exist. It is easy to understand by noting that using one codeword of length l rules out every bit string that begins with it, taking up 2^(−l) of the whole. For example, lengths 1, 2, 3, 3 give a sum of exactly 1 and can be realized as 0, 10, 110, 111. Every uniquely decodable code satisfies this inequality (McMillan's theorem), so when choosing code lengths it is enough to look among prefix codes.
Japanese name: クラフトの不等式
Kraft inequality appears in 2 practice questions across 1 topic, including Information Theory and Coding Basics.