simons blog

Infinite binary strings

We call B={0,1} the binary alphabet. B∞ is the set of infinite binary strings ω=ω1:∞=ω1ω2ω3... with ωi∈B.

We can identify each of these strings with a number in the unit interval [0,1] in the following way:

f(ω1:∞)=∑k=1∞ωk2k

This maps each infinite binary string to the real number with binary expansion 0.ω1ω2ω3... .

We can draw a similarity between infinite binary trees and the task of finding the binary expansion of a number:

The tree corresponding to finding one of the binary expansions of 14 would look as follows:

Screenshot 2025-06-09 at 09

... at the end means that we infinitely expand the tree further down.

In the picture we just show one possible path to obtain 14=0.01000...

Note that this picture already hints at the fact that the binary expansion is not injective. We can read off two possible binary expansions of 14:

14=0.01000....=f(010∞)14=0.00111...=f(0.001∞)

The function is f is surjective because for every number in the interval [0,1] we can apply the above algorithm to find an infinite binary expansion that will match it.

The real numbers R have geometrical representation of a straight line.

We can similarly visualise B* using the cylinder sets.

Γx={xω|ω∈B∞}

Here x∈B*, i.e. a finite binary string.

We can than visualise Γx as the interval f(Γx), for example Γϵ will correspond to the whole unit interval, Γ1 to the interval [12,1], Γ11 to the interval [34,1], Γ000 to the interval [0,18] etc.

We call x∈B* a prefix of y∈B* if we have xz=y for z∈B*.

Let's prove that Γy⊂Γx iff x is a prefix of y.

→: We have for arbitrary α∈Γy that α∈Γx. That implies that for each yω we can find xω′ such that yω=xω′. We have l(x)≤l(y) because if l(x)>l(y) we would have elements in Γy that are not in Γx. We can than compare the substrings (yω)1:l(x)=y1:l(x) and (xω′)1:l(x)=x. They need to be equal and from here it follows that x is a prefix of y.

←: We have that xz=y but than we can write yω=xzω and hence every element of Γy is in Γx.

This concludes the proof and can be geometrically interpreted as the fact that iff x is a prefix of y than f(Γy) is a subinterval of f(Γx).