Arithmetic Coding and Nested Intervals
Represent a sequence by narrowing an interval and identify a finite binary prefix wholly contained in its final range.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Each symbol selects a subinterval
For probabilities \(3/4\) for \(a\) and \(1/4\) for \(b\), begin with \([0,1)\). Symbol \(a\) selects \([0,3/4)\). Within that interval, \(b\) selects its last quarter, giving \([9/16,3/4)\) for sequence \(ab\). Interval length equals the sequence probability under the fixed model. The same subdivisions decode if sender and receiver agree on the model and termination rule.
A binary tag names a whole interval
Bits \(101\) identify \([5/8,3/4)\), entirely contained in the final interval, so they can specify that range in this toy example with length known. Implementations renormalize and use documented finite precision instead of indefinitely shrinking real intervals. Entropy and cross-entropy describe log probabilities behind the cost. Huffman coding associates an integer word length with each symbol.[1]