The Kraft inequality states that the lengths of the codewords of
a
-ary
prefix-free code, where
, satisfy
Conversely, every finite or countable sequence of positive integer lengths satisfying this inequality
is the sequence of lengths of some -ary prefix-free code. The inequality follows by associating
codewords with disjoint cylinders in the infinite
-ary tree.