In arithmetic coding, encoding the message 'ABAC' given P(A)=0.6, P(B)=0.3, P(C)=0.1 involves narrowing an interval four times. Explain the process conceptually and why the final interval width equals the probability of the specific message.
Think about your answer, then reveal below.
Model answer: Start with [0, 1). Partition it according to symbol probabilities: A gets [0, 0.6), B gets [0.6, 0.9), C gets [0.9, 1.0). The first symbol A selects [0, 0.6). Within this interval, re-partition proportionally: A->[0, 0.36), B->[0.36, 0.54), C->[0.54, 0.6). The second symbol B selects [0.36, 0.54). Continue: within [0.36, 0.54), A selects [0.36, 0.468), then C selects [0.462, 0.468). The final interval has width 0.006 = 0.6 * 0.3 * 0.6 * 0.1 = P(ABAC). The compressed message is any binary fraction inside this interval, requiring approximately -log2(0.006) ≈ 7.38, so about 8 bits. The key insight: the interval width equals the sequence probability, so more probable sequences yield wider intervals requiring fewer bits to specify.
This is why arithmetic coding achieves entropy: the number of bits to specify a point in an interval of width w is about -log2(w) = -sum log2(p_i) = sum of self-information values. The total bits used equals the total information content of the specific message.