The Collatz Map in Binary
Strip the zeros, then watch a carry ripple: the most famous open problem in arithmetic is a statement about bit-strings.
The Collatz map is defined by
and the Collatz problem asks: does every positive integer, iterated under , eventually reach the trivial cycle ?
Nobody knows. But the problem changes texture if you stop thinking of as arithmetic on numbers and start thinking of it as an operation on binary strings. Division by two, the part that feels dynamical, becomes trivial, and everything interesting concentrates in a single carry chain.
Start with seven. In binary it is : three ones, nothing else. Everything that follows is an operation on this string.
Seven is odd, so the map adds the string to a copy of itself shifted up one place, with a carry seeded at the bottom. The sum always ends in a zero, which falls off immediately. That takes to , then to . The string is getting longer.
One more odd step takes to , an even number at last. The even branch does no arithmetic at all: the trailing zero, marked in red, is simply deleted, and what remains is , thirteen. In binary, halving is not dynamics, it is deletion.
From the odd branch gives , which is : two zeros at the bottom this time. Both vanish at once and the string collapses to , five. The string only shrinks when zeros reach the bottom edge.
Five is odd, and one more carry chain produces , which is . Three trailing zeros, three deletions, and we land on . The deletions win, this time.
That is the whole game: the odd branch grows the string and stirs it with carries, while the even branch deletes zeros off the bottom. For seven, the deletions won after five odd steps. Nobody has ever found a starting value that escapes, and nobody has proved that none does.
An accelerated map
First, compress the boring steps. Let be the exponent of the largest power of two dividing , and define
This is the standard “accelerated” Collatz map: it does all consecutive halvings at once (note is always even when is odd, so the odd branch can safely include one halving).
In binary, the even branch is not arithmetic at all. Dividing by
just deletes the trailing zeros from the representation.
Writing bits least-significant first, the even case is “strip leading
0s”: pure string surgery.
So all the depth of the Collatz problem lives in the odd branch. What does do to a bit-string?
Unpacking the odd branch
Write an odd as a list of bits, least significant first, so
(the first bit is 1 because is odd).
Since , and in this representation is just
1 : x (shift left, set the low bit), we have
where add is ordinary binary addition. Here is the addition algorithm,
bits-first, with an explicit carry; maj is the majority function that
decides when a carry propagates:
add :: [Bool] -> [Bool] -> [Bool]
add xs ys = adder xs ys False
where
adder (x : xs) (y : ys) c = (x ⊕ y ⊕ c) : adder xs ys (maj x y c)
adder [] (y : ys) c = (y ⊕ c) : adder [] ys (y && c)
adder (x : xs) [] c = (x ⊕ c) : adder xs [] (x && c)
adder [] [] True = [True]
adder [] [] False = []
maj x y z = fromEnum x + fromEnum y + fromEnum z >= 2
x ⊕ y = x /= y
Now run adder on and by hand. The two inputs are the same
string, offset by one position, so bit of the sum combines ,
, and the incoming carry. The first additions look like:
Bit 0 of the sum is 0; that is the guaranteed factor of two, and the
deletes it. What remains is the new odd-branch output:
What this buys you
Seen this way, one step of the accelerated Collatz map is:
- XOR the string with itself shifted by one, perturbed by a carry that ripples from the bottom, then
- strip the trailing zeros that the XOR produced.
The mystery is gone; in its place is a question about how a
self-similar carry chain interacts with zero-stripping. An output bit is 0
exactly where : where the string’s disagreement
with its own shift matches the incoming carry. Zeros at the bottom of the
string get deleted and the number shrinks; everywhere the carry chain and
the shift pattern fail to cancel, ones survive and the number stays large.
That is the Collatz problem restated: does this carry process always eventually manufacture enough cancellation at the bottom of the string that the deletions win? Phrased over bit-strings it looks less like dynamics and more like a problem about a one-dimensional cellular automaton. No closer to solved, but a much stranger and more concrete thing to stare at.