Shannon–Fano coding
In the field of data compression, Shannon–Fano coding, named after Claude Shannon and Robert Fano, is one of two related techniques for constructing a prefix code based on a set of symbols and their probabilities (estimated or measured). Shannon's method chooses a prefix code where a source symbol i {\displaystyle i} is given the codeword length l i = ⌈ − log 2 p i ⌉ {\displaystyle l_{i}=\lceil -\log _{2}p_{i}\rceil } .