E → N: Events as Natural Numbers

fig-20260131_2-03 | The fundamental bijection underlying information measurement

Core principle: Every event space E has a bijection to an initial segment of N. This is what makes information countable and measurable.

Simple Event Space

Event Space E (Vowels) a e i o u |E| = 5 φ bijection Natural Numbers N 0 1 2 3 4 5 6 ... φ(E) = {0, 1, 2, 3, 4} ⊂ N

Vowels biject to {0,1,2,3,4}. Information content: log₂(5) = 2.32 bits per vowel.

Factored Space: E₁ × E₂ → N

E = ES × Within Digits Vowels Whitespace 0 1 2 3 4 5 6 7 8 9 a e i o u ␣ ↵ ⇥ ... (showing 3 of 5 ESs) φ Mixed-Radix Encoding to N n = within_id + offset[ES_id] offset[Digits] = 0 offset[Vowels] = 10 offset[Whitespace] = 15 offset[Punct] = 19 offset[Other] = 51 Digits 0 10 Vow 15 WS 19 Punct 51 Other (205) 256 Examples: φ('5') = 0 + 5 = 5 φ('e') = 10 + 1 = 11 φ(' ') = 15 + 0 = 15 φ('t') = 51 + 83 = 134

The factored space maps to N via mixed-radix encoding. Each ES occupies a contiguous segment.

Why this matters: The bijection φ: E → N lets us:
  • Count events: |E| = max(φ(E)) + 1
  • Measure information: I(e) = log₂(φ(e) + 1) bits
  • Compare factorizations: Different φ give same |E| but different structure

Joint Space: E₁ × E₂ → N (Cantor-style)

ES_prev × ES_next (5×5 = 25 events) D V W P O D V W P O 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 φ(W→V) = 5·2 + 1 = 11 φ N (row-major encoding) D→* V→* W→* P→* O→* 0 5 10 15 20 25 Row-Major Encoding φ(i, j) = i · |E₂| + j φ(ES_prev, ES_next) = ES_prev · 5 + ES_next Information: I(E₁ × E₂) = log₂|E₁| + log₂|E₂| = log₂(5) + log₂(5) = 4.64 bits per ES-pair

The joint ES×ES space bijects to {0,...,24} via row-major encoding. Each cell is one joint event.

Complete Mapping: Byte → N

ES Members |ES| N range Bits
Digits 0-9 10 [0, 9] 3.32
Vowels a, e, i, o, u 5 [10, 14] 2.32
Whitespace space, \n, \t, \r 4 [15, 18] 2.00
Punctuation . , ! ? : ; etc. 32 [19, 50] 5.00
Other consonants, etc. 205 [51, 255] 7.68
Total all bytes 256 [0, 255] 8.00

The bijection φ: E → N is not unique. Different orderings give different φ but preserve:

The choice of φ is a modeling decision. Our ES-based ordering groups related bytes together, making patterns more local in N-space. A frequency-based ordering would put common bytes first (lower N), enabling shorter codes.
I(event e) = log₂(φ(e) + 1) ≈ log₂|E| bits
The position in N determines the "cost" of specifying the event

Reproduction

Theory: CMP paper §2 (Event spaces and the E→N bijection)

ESs: From ./hutter es (Digits, Vowels, Whitespace, Punct, Other)

Encoding: Mixed-radix for factored spaces, row-major for products