◂ the notebook

phycists.desmondbrown.me

Other projections⟨dev|Desmond⟩⟨ee|Desmond⟩⟨academic|Desmond⟩

No. 0922 February 2026.
Probability and statistics, MT2204. Code on GitHub.

A message is an interval: arithmetic coding

Arithmetic coding gives every symbol a slice of [0, 1) as wide as its probability, zooms into the slice, and repeats. The seven letters of my name leave an interval about five millionths wide. Naming one number inside it takes 18 bits. The entropy of the letters says 17.65 bits is the floor.

startDEMNOS[0.0000000, 1.0000000)DDEMNOS[0.0000000, 0.2857143)EDEMNOS[0.0816327, 0.1224490)SDEMNOS[0.1166181, 0.1224490)MDEMNOS[0.1191170, 0.1199500)ODEMNOS[0.1197120, 0.1198310)NDEMNOS[0.1197800, 0.1197970)Dfinal interval, 4.86 × 10⁻⁶ wide[0.1197800, 0.1197849)
startDEMNOSDDEMNOSEDEMNOSSDEMNOSMDEMNOSODEMNOSNDEMNOSDfinal interval, 4.86 × 10⁻⁶ wide

Encoding DESMOND with symbol counts taken from the message itself, the fixed model my encoder uses. Each row zooms into the highlighted slice of the row above. Computed on this page.

what I don’t understand yet

My encoder holds the interval as a 28-digit decimal, and it collapses after a few dozen symbols. Real coders use integers and renormalise as they go. I want to derive why that loses nothing.