Shannon coding
   HOME

TheInfoList



OR:

In the field of
data compression In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compressio ...
, Shannon coding, named after its creator,
Claude Shannon Claude Elwood Shannon (April 30, 1916 – February 24, 2001) was an American mathematician, electrical engineer, and cryptographer known as a "father of information theory". As a 21-year-old master's degree student at the Massachusetts Inst ...
, is a
lossless data compression Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits statistic ...
technique for constructing a
prefix code A prefix code is a type of code system distinguished by its possession of the "prefix property", which requires that there is no whole code word in the system that is a prefix (initial segment) of any other code word in the system. It is trivially t ...
based on a set of symbols and their probabilities (estimated or measured). It is suboptimal in the sense that it does not achieve the lowest possible expected code word length like
Huffman coding In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding or using such a code proceeds by means of Huffman coding, an algo ...
does, and never better than but sometimes equal to the
Shannon–Fano coding In the field of data compression, Shannon–Fano coding, named after Claude Shannon and Robert Fano, is a name given to two different but related techniques for constructing a prefix code based on a set of symbols and their probabilities (estimat ...
(Fano's method). The method was the first of its type, the technique was used to prove Shannon's noiseless coding theorem in his 1948 article "A Mathematical Theory of Communication", and is therefore a centerpiece of the information age.
Shannon–Fano coding In the field of data compression, Shannon–Fano coding, named after Claude Shannon and Robert Fano, is a name given to two different but related techniques for constructing a prefix code based on a set of symbols and their probabilities (estimat ...
methods gave rise to the field of information theory and without its contributions, the world would not have any of the many successors; for example Huffman coding, or
arithmetic coding Arithmetic coding (AC) is a form of entropy encoding used in lossless data compression. Normally, a string of characters is represented using a fixed number of bits per character, as in the ASCII code. When a string is converted to arithmetic ...
. Much of our day-to-day lives are significantly influenced by digital data and this would not be possible without Shannon-Fano coding and the ongoing evolution of its methods. In Shannon coding, the symbols are arranged in order from most probable to least probable, and assigned codewords by taking the first l_i = \left\lceil -\log_2 p_i \right\rceil bits from the binary expansions of the cumulative probabilities \sum\limits_^ p_k. Here \lceil x \rceil denotes the
ceiling function In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
(which rounds x up to the next integer value).


Example

In the table below is an example of creating a code scheme for symbols ''a''1 to ''a''6. The value of ''l''''i'' gives the number of bits used to represent the symbol ''a''''i''. The last column is the bit code of each symbol.


References

Shannon, Claude Elwood
"A Mathematical Theory of Communication."
ACM SIGMOBILE mobile computing and communications review 5.1 (2001): 3-55. {{DEFAULTSORT:Shannon-Fano coding Lossless compression algorithms Claude Shannon