
Kraft's inequality
Kraft's inequality is a mathematical rule used in data compression and coding theory. It provides necessary and sufficient conditions for a set of codeword lengths to be assigned in a way that enables the creation of a prefix-free code—meaning no codeword is a prefix of another, which allows immediate decoding. The inequality states that the sum of 2 raised to the negative power of each codeword length must be less than or equal to 1. If this condition is met, a suitable prefix-free code exists; if not, such a code cannot be formed.