Universal integer coding — base‑2 path collection

Universal coding through
binary path collection.

Binary Equation Paths is a reversible base‑2 coding method: it walks the integer represented by a binary string, collects the utilized primary-bit path, and reconstructs the original value by arithmetic alone. No dictionaries. No training. No statistical model. The code is the path.

For every positive integer n ≥ 2, BEP applies the floor walk f(n)=⌊n/2⌋. At each step, the current least-significant base‑2 condition determines whether the primary bit is kept or flipped, and that primary bit is collected into the path. The result is a reversible path of exactly ⌊log₂ n⌋ bits: the utilized base‑2 magnitude of the value, captured as a path rather than preserved as a fixed-width byte string.

The cast-iron claim

For n ≥ 2, BEP terminates, is reversible, and collects exactly ⌊log₂ n⌋ primary-path bits.

encode step: if n is even, keep the current primary bit and set n = n / 2;
if n is odd, flip the primary bit, set n = (n − 1) / 2, then collect that path bit
decode step: start at 1; read the path;
transitions between path bits restore the odd-step adjustment, and each step doubles the value to reverse the walk
The inspiration — Collatz, 1937
A path with uncontrolled growth
n / 2       if n is even
3n + 1      if n is odd
Collatz turns parity into a path, but the odd rule multiplies by 3 before returning to division. That creates value growth, irregular path lengths, and an open convergence problem. It is fascinating mathematics, but not a stable integer coding rule.
❌  growth — irregular path length
Binary Equation Paths
A path with guaranteed shrinkage
n / 2         if n is even
(n − 1) / 2   if n is odd
Replace multiplication with subtraction. Each step consumes one utilized base‑2 position, shifts the value toward 1, and records the evolving primary bit. Odd steps flip the primary bit before the divide; even steps preserve it. The collected path is the encoded representation.
✓  strictly decreasing — exactly ⌊log₂ n⌋ steps
01
Termination
For n > 1, both rules produce a smaller positive integer: n/2 < n and (n−1)/2 < n. Therefore the path cannot loop and must reach 1.
02
Length
Each floor-walk step consumes one utilized base‑2 position. A positive integer in the range 2ᵏ ≤ n < 2ᵏ⁺¹ reaches 1 after exactly k = ⌊log₂ n⌋ steps, so the collected path length is fixed by the value’s base‑2 magnitude.
03
Reversibility
The path is reversible because primary-bit transitions identify where the odd-step subtraction occurred. Starting from 1, decompression reverses each divide-by-two step and restores the original integer exactly.
Standard byte storage preserves fixed-width binary containers.
BEP collects the ⌊log₂ n⌋ primary-bit path actually used by the value.
The code is the arithmetic route back to 1, not a copied substring of the input.
— New Dawn Data
Important boundary: Binary Equation Paths belongs in the universal integer coding conversation: it is a base‑2 path code, not a dictionary compressor or trained model. The proven core is integer-level: the floor walk strictly decreases, reaches 1, collects exactly ⌊log₂ n⌋ primary-path bits, and reverses without a table, dictionary, or statistical model. Full file compression still depends on tokenization, framing, byte alignment, and stream metadata — but the BEP representation itself is an arithmetic path, not simple leading-bit removal.