Arithmetic coding
Arithmetic coding is a form of data compression that encodes a sequence of symbols into a single number between 0 and 1. Instead of assigning fixed-length codes to each symbol, it represents the entire message as a fraction based on the probabilities of the symbols. This allows for more efficient encoding, especially for data with varying symbol frequencies.
In arithmetic coding, the process involves dividing the interval [0, 1) into sub-intervals that correspond to the probabilities of each symbol. As each symbol is processed, the interval is narrowed down, resulting in a final value that uniquely represents the entire sequence. This method can achieve better compression ratios compared to traditional methods like Huffman coding.