0% found this document useful (0 votes)
104 views29 pages

Chap Gap

This document discusses continued fractions and the gaps that occur when evaluating a continued fraction at rational numbers. It defines a gap function Γx(w) that is discontinuous at every rational number p/q. It is shown that for rational p/q, the gap takes the form Γp/q(w) = w2/q2 - w + w2Tp/q(w), where the teeth Tp/q(w) are bounded. Scatter plots of Tp/q values for various rational denominators reveal curious algebraic relationships between rationals, with patterns emerging for factorials in the denominator. The distribution of Tp/q values across all rationals with denominator less than 1800 is

Uploaded by

Alyssa Vu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
104 views29 pages

Chap Gap

This document discusses continued fractions and the gaps that occur when evaluating a continued fraction at rational numbers. It defines a gap function Γx(w) that is discontinuous at every rational number p/q. It is shown that for rational p/q, the gap takes the form Γp/q(w) = w2/q2 - w + w2Tp/q(w), where the teeth Tp/q(w) are bounded. Scatter plots of Tp/q values for various rational denominators reveal curious algebraic relationships between rationals, with patterns emerging for factorials in the denominator. The distribution of Tp/q values across all rationals with denominator less than 1800 is

Uploaded by

Alyssa Vu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 29

Continued Fractions and Gaps

Linas Vepstas <[email protected]>


12 October 2004 (revised 15 November 2004)
Abstract
Given a continued fraction, we construct a certain function that is discontinu-
ous at every rational number p/q. We call this discontinuity the gap. We then try
to characterize the gap sizes, and nd, to the rst order, the size is 1/q
2
, and that,
for higher orders, the gap appears to be perfectly randomly distributed, in that it
is Cauchy-dense on the unit square, and thus, this function has a fractal measure of
exactly 2. We nd this result to be very intriguing, as we know of no other func-
tions that have this property (There are many fractal curves that have this property,
but not functions. That is, a space-lling curve can be used to enumerate R
2
by
R but such space-lling curves have locality properties induced by R that the gap
function appears not to have). When examining this function for small rationals,
some very curious algebraic relationships appear to relate various rationals.
This paper is part of a set of chapters that explore the relationship between the
real numbers, the modular group, and fractals.
1 Continued Fractions and Gaps
1.1 Denitions; Notation
Given a real number 0 x 1, a sequence of integers [a
1
, a
2
, ...] can be found that
dene its continued-fraction expansion:
x = 1/(a
1
+1/(a
2
+1/(a
3
+...))) (1)
Given any particular x, this sequence is straightforward to compute. Rational numbers
x always have a nite number of terms in the sequence. For a rational number x, there
are two distinct expansions that yield the same value:
x
+
= [a
1
, a
2
, ..., a
N
] (2)
and
x

= [a
1
, a
2
, ..., a
N
1, 1] (3)
1
In the following text, we make a simplifying notational confusion: we use the same
symbols to denote a sequence and its value when expressed as a continued fraction.
Thus, for the above sequences, we may write x =x

=x
+
. It will hopefully be obvious
which is which.
Given a rational x and an arbitrary complex number w, dene new sequences:
x
+
(w) = [a
1
, a
2
, ..., a
N
, 1/w] (4)
and
x

(w) = [a
1
, a
2
, ..., a
N
1, 1, 1/w] (5)
These two functions are analytic in w, almost trivially so, and in fact can be written as
(a +bw)/(c +dw) for some integers a, b, c, d. These integers can be readily computed
due to an interesting relationship between the Modular Group SL(2, Z) and continued
fractions. We give explicit formulas in a different chapter; see also [Cut-the-Knot-UL ].
Because of this very simple form, general analytic manipulations are perfectly well-
dened on these functions. Clearly,
lim
w0
x

(w) = lim
w0
x
+
(w) = x (6)
Differentiation w.r.t. w provides a handy tool for constructing various interesting things
and proving various limits. We give an exact expression for these derivatives below.
Although weve introduced w by appending it to the last term of a rational expansion,
we could, if we wanted, introduce w into the Nth term of an irrational expansion.
Most of the statements we make below are for rationals. This is in part because treat-
ing the irrationals is a bit harder and confusing, both in these formulas, and in their
implementation as algorithms.
There is also an even-odd symmetry for x(w) that we should be aware of, as it plays
another important role in the theory. As we point out above, for any given sequence,
there is a + and a - generalization. But what if the sequence is already x

and we
choose the - expansion? Then we get
x

= [a
1
, a
2
, ..., a
N
1, 0, 1] (7)
This expansion invokes a symmetry on x

(w):
x

(w) = [a
1
, a
2
, ..., a
N
1, 0, 1, 1/w] = x
+
(w) (8)
Thus, we see that a double-expansion is either idempotent or alternating. To be pedan-
tic, we can complete this with the other three expressions: x
++
(w) = x
+
(w) and
x
+
(w) = x
+
(w) = x

(w). In other words, a double-expansion reects back, and,


in this sense, x
+
and x

are unique.
2
If one needs to take differences, e.g. for derivatives, the even-odd expansion is
more useful: Dene x
e
(w) and x
o
(w) as follows:
x
e
(w) =
_
x
+
(w) if N even
x

(w) if N odd
(9)
and
x
o
(w) =
_
x

(w) if N even
x
+
(w) if N odd
(10)
These two have nice order-preserving properties: if w is a positive real, then
x
o
(w) < x
e
(w) (11)
and, for negative real w,
x
o
(w) > x
e
(w) (12)
These two functions also have idempotent or parity-swapping identities:
x
e+
(w) = x
e
(w) x
e
(w) = x
o
(w)
x
o+
(w) = x
o
(w) x
o
(w) = x
e
(w)
x
ee
(w) = x
e
(w) x
eo
(w) = x
o
(w)
x
oe
(w) = x
e
(w) x
oo
(w) = x
o
(w)
x
+e
(w) = x
e
(w) x
+o
(w) = x
o
(w)
x
e
(w) = x
e
(w) x
o
(w) = x
o
(w)
(13)
1.2 The Gap
Let use dene the gap as

x
(w) = x
e
(w) x
o
(w) (14)
This gap function is, of course, highly discontinuous in x and analytic in w. It is not
hard to discover that for a rational p/q reduced so that p and q are coprime (have no
common factors), and w 1, the gaps take the form

p/q
(w) =
w
q
2
_
2 w+
w
2
2
+
w
2
2
T
p/q
(w)
_
(15)
where the teeth T are bounded:

T
p/q
(w)

< 1 (when w 1). For w = 0,we have


0 T
p/q
(0) 1. A derivation of these results are given in the next section.
The teeth at rst appear to be random: below follows a scatter-plot showing T for
a thousand randomly generated small-ish rationals.
3
However, closer examination reveals some surprising details. Heres the same pic-
ture, but this time showing only the rationals p/q = [1..719]/720 (all rationals with
numerator between 1 and 719 and denominator of 720:
4
Note that 720 = 6! (six factorial) and that similar but denser images appear for
higher factorials: Heres one for 7! that is, p/q = [1..5039]/5040:
5
Notice that a Moire pattern of fringes seems to be forming at x = 1/2. The ap-
pearance of various parabolas at various locations seems to indicate that there are some
sort of curious algebraic relationships between the rationals that are worth exploring.
The factorial in the denominator seems important: the picture for the denominator
2 3 5 7 11 = 2310 blurs out the features, and mostly looks much more random, as
shown below:
Now that we know what sort of pattern to look for, we can nd the cross-bars in
this picture, for a denominator of 1024:
6
The analogous picture for a denominator consisting of powers of 3 is less dis-
tinct. Pictures for prime denominators appear considerably more random, although
containing hints of a different kind of structure. For example, here is a picture with
denominator 1023:
7
The next picture below is a scatter-plot showing all rationals with denominators
less than 200. This now clearly exhibits a fantastic self-similar fractal latticework:
8
We will recognize in later chapters that these curves correspond to hyperbolic
maps of the unit interval back onto itself, generated by elements of the modular group
SL(2, Z) acting on binary trees. It would be interesting to specify the shapes of all
the various bifurcating curves that seem to appear in this latticework, and to give the
algebraic equations whose solutions are plotted above. Note that because a curve can
seemingly bifurcate into another curve in many places, enumerating all of them would
be a trick.
There are more interesting things to be seen, but rst we should provide a simpler
expression for T
p/q
(w) at w = 0. Recall that for any xed rational p/q, that T
p/q
(w) is
of the form (a+bw)/(c+dw) for some positive integers a, b, c, d. For any given, xed
p/q, there exists an > 0 such that there are no poles in T
p/q
(w) in the disk of radius
around w = 0 (Homework: prove this), and thus its analytic on this disk. This justi-
es an expansion in w; well give an exact expression in a later section, showing that
these manipulations are safe. For the continued fraction x
+
(w) = [a
1
, a
2
, ...a
N
, 1/w] we
write the kth partial convergent as r
k
(w) = s
k
+wt
k
+w
2
u
k
+w
3
v
k
+... which obeys
the recurrence relation r
k1
(w) = a
k1
+1/r
k
(w) . Substituting, we get the explicit
9
recurrence relations for each term:
s
k1
= a
k1
+1/s
k
(16)
t
k1
=
t
k
s
2
k
(17)
u
k1
=
u
k
s
2
k
+
t
2
k
s
3
k
(18)
v
k1
=
v
k
s
2
k
+2
t
k
u
k
s
3
k
+
t
3
k
s
4
k
(19)
which are numerically quite tractable. The boundary conditions are given by r
+,N
(w) =
a
N
+w for the x
+
expansion, and r
,N
(w) =a
N
w+w
2
w
3
for the x

expansion. We
add a
0
0 to terminate at the other end. Dening even and odd variants as before, we
equate the gap

p/q
(w) = w(t
e
0
t
o
0
) +w
2
(u
e
0
u
o
0
) +w
3
(v
e
0
v
o
0
) (20)
Its becomes straightforward to numerically verify that t
e
0
t
o
0
= 2/q
2
and u
e
0
u
o
0
=
1/q
2
as weve noted before (Homework: provide a general proof). Far, far more
curious is T
p/q
(0) = 2q
2
_
v
e
0
v
o
0
_
1, of which we drew some pictures above. The
pictures below will provide some more surprises. The rst is a scatter-plot color-coded
as a measure: it shows the distribution of T
p/q
T
p/q
(0) for all rationals with denomi-
nator q 1800. Black indicates that there were few or no hits to that pixel, then blue,
green, yellow and red to denote lots of points hit that pixel. Just as the earlier graphs,
shown is a perfect unit square.
10
For reference, overdrawn over the image is the parabola. The vertical black stripes
occur at the Farey numbers, and appear to be ordered in size according to the Farey
tree (i.e. the largest stripe is at x = 1/2, the next largest at x = 1/3, x = 2/3 and the
next smaller ones at x =1/4 and x =2/5 etc.). The progression of the horizontal bands
are clearly related to the Farey tree through the parabola. Since the parabola gives a
rational out when fed one in, we see that weve discovered a different tree of rationals
thats related to the Farey tree. One can see that any ratio of polynomials will this
give a tree of rationals. We discuss the Farey Tree (or Stern-Brocot Tree) in a different
chapter.
The ligree pattern exists only for small rationals. If we start sampling larger ratio-
nals, the distribution becomes smooth. The picture below shows a random sampling of
rationals with denominators less than 2 million. The image is a bit grainy because the
sample size is not large enough; the graininess goes away with larger sample sizes.
11
This picture tells us something that is surprising: this function is space-lling and
dense; it has no holes or islands; it has a fractal measure of 2.0. Even in the land of
fractals, this is fairly unusual, as this function is, after all, not some self-similar curve,
but rather a plain-old map from the unit interval to the unit interval. By dense, I
mean the traditional Cauchy-sequence notion of density: for any real values x, y [0, 1]
and positive >0, we can nd a rational p/q such that |x p/q| < and

y T
p/q

<
. Of course, a computer generated picture is not a proof, but a proof is straight-forward,
and is discussed below. I am not aware of any other map that has this property.
The distribution of the gaps y = T
p/q
can be easily found to be 1/2

y which is
sharply peaked at y = 0: this is the thin red stripe at the bottom of the above picture.
This distribution is due to the Jacobean of a parabola, which we derive below.
1.3 The Gap for Finite w
One can get a better idea of the behavior of x
e
(w) by graphing it, as a function of w, for
a number of representative values of x. From the above analysis, we should suspect that
for x = p/q, the leading w terms are of magnitude 1/q
2
which would make it hard to
12
directly compare different values of x. So instead, we introduce a normalized variant:

e
(x = p/q, w) = x +q
2
[x
e
(w) x] and similarly
o
(x, w). This is done below, for 200
evenly spaced values of x. On the horizontal axis is x running from 0 to 1, and along
the vertical axis, w, from 0 at bottom to 1 at top:
Clearly, it can be seen that
e
(x, w) is a monotonically increasing function of w,
which follows easily by examining the partial sums: if w < z then
r
N
(w) = a
N
+w < r
N
(z) = a
N
+z (21)
and
r
N1
(w) = a
N1
+1/r
N
(w) > r
N1
(z) = a
N1
+1/r
N
(z) (22)
Each iteration will reverse the inequality; but
e
by denition has an even number of
terms, and thus
e
(w) <
e
(z). QED. Note this would be extremely non-obvious if one
just considered that is a rational polynomial.
One nds a mirror symmetry between the even and odd forms:
o
(x, w) =
e
(1
x, w), which is also not quite obvious, given the construction. Its is clear from this
13
picture that the leading w and w
2
terms dominate. We can guess at the form of these
terms: we dene
e
(x, w) =
e
(x, w) w+w
2
w
3
/2 and graph it below, exposing the
randomness of the cubic and higher terms directly.
The seeming parallel-ness of some trajectories is an optical illusion, due to the pix-
elization of the picture. There are more pictures, with a greater number of strands, at the
Gap Roomhttp://www.linas.org/art-gallery/farey/gap-room/gap-room.html.
1.4 Exact Expressions for the Gap Size
The size of the gap can be given an exact expression in terms of the convergents of
the continued fraction. Performing this exercise will help explain some of the fractal
behavior seen in the previous sections.
One gets the convergent of a continued fraction by evaluating the fraction only up
to the nth term, and expressing it as a ratio p
n
/q
n
. The convergents can be expressed
recursively:
p
n
= a
n
p
n1
+ p
n2
(23)
14
and
q
n
= a
n
q
n1
+q
n2
(24)
where we anchor the iteration by dening p
2
= 0 and p
1
= 1 and q
2
= 1 and
q
1
= 0. Iterating, the next few terms are p
0
= a
0
and p
1
= a
0
a
1
+1 and q
0
= 1 and
q
1
= a
1
. Here we adopted a slightly extended notation from before, dening a
0
as the
integer part of the fraction; i.e. x = a
0
+1/(a
1
+1/(a
2
+...)) [a
0
; a
1
, a
2
, ...]. We then
have the convergent:
[a
0
; a
1
, a
2
, ..., a
N
] =
p
N
q
N
(25)
Note also that for any y R, we have
[a
0
; a
1
, a
2
, ..., a
N
, y] =
p
N
y + p
N1
q
N
y +q
N1
(26)
Note that the convergents have the property q
n
p
n1
p
n
q
n1
= (1)
n
. We can use the
above to provide exact expressions for x
+
(w) and x

(w). These are:


x
+
(w) =
p
N
q
N
+(1)
N
w
q
2
N
(1 +wq
N1
/q
N
)
(27)
and
x

(w) =
p
N
q
N
(1)
N
w
q
2
N
(1 +w(1 q
N1
/q
N
))
(28)
We can then compute the gap explicitly as

x
(w) = x
e
(w) x
o
(w) =
w
q
2
N
_
_
2 +w
1 +w+w
2
q
N1
q
N
_
1
q
N1
q
N
_
_
_
(29)
where no approximation has been made. Expanding the denominator, we get
T
p/q
(0) = 1 4
q
N1
q
N
_
1
q
N1
q
N
_
(30)
From this expression, the boundedness of T follows immediately; this comes from the
fact that 2q
N1
q
N
(which in turn follows from 2 a
N
for the last term a
N
).
The distribution density 1/2

T of the gaps on the unit square can now be un-


derstood in terms of the above parabolic formula, as a change-of-variable from the
underlying distribution of R
p/q
q
N1
/q
N
. Numerically, we can conrm that this dis-
tribution is, in a certain sense, perfectly uniform on the half-unit square. Now that we
understand that the more fundamental quantity with regard to distributions is R
p/q
, lets
repeat some of the earlier graphs. These are shown in 1 and 2. Visually, they dont
differ much from thier earlier analoguous, except for an effective rescaling of 1/2

T.
Nonetheless, they are presented here for reference.
15
Figure 1: Ratio of Convergents for Small Rationals
The gure above shows the distribution of the ratio of the nal two convergent de-
nominators q
N1
/q
N
for all rationals with denominators less than 200. Note that the
scale along the x-axis runs from 0 to 1 but along the y axis, from 0 to 1/2. To create
this distribution, we create an empty grid that is MxM=600x600 pixels in size. We
then consider a fraction x = p/q and its denominator ratio y = q
N1
/q
N
. If we have
that i Mx < i +1 and j My < j +1 for some integers i, j, then we increment the
value at pixel (i, j) by one. When we are done, we visualize the grid by assigning
black to empty pixels, blue to pixels with a very small count, green to pixels with a
medium-small count, yellow to pixels with a medium count, and red to pixels with a
large count.
16
Figure 2: Ratio of Convergents
The gure above shows the distribution of the ratio of the nal two convergent denom-
inators q
N1
/q
N
for all rationals with denominators less than 1800. Note that the scale
along the x-axis runs from 0 to 1 but along the y axis, from 0 to 1/2. Thus, the largest
horizontal line is at q
N1
/q
N
= 1/3, with the remaining lines distributed at the Farey
Fractions. The uniform blue color indicates a fairly even distribution, with the coloring
as before: red indicating an excess, and black a decit. As one goes to larger denomi-
nators, the uniformity domintes, with the distribution tending towards even-ness.
17
Figure 3: Ratio of pre-nal Convergents
The gure above shows the distribution of the ratio of the pre-nal two convergent de-
nominators q
N2
/q
N1
for all rationals with denominators less than 1800. Note that
the scale along the x and y-axis runs from 0 to 1. Note that this gure is fundamentally
different, in a certain sense, than the previous gures. Here, as one goes to the higher
denominators, one seems to develop both a uniform background, and a ligree super-
imposed on top. This behaviour is qualitatively different than what one sees when one
just considers the nal ratios.
18
Figure 4: High-order pre-nal convergents
The gure above shows the distribution of the ratio of the pre-nal two convergent
denominators q
N2
/q
N1
for all rationals with denominators less than 16200. The
uniform distrubtion,with a pattern overlay persists to high orders.
19
Figure 5: Second Convergents
The gure above shows the distribution of the ratio of the two convergent denominators
q
1
/q
2
for all rationals with denominators less than 1800, and which have at least two
terms (so that q
2
= q
1
).
20
Figure 6: Third Convergents
The gure above shows the distribution of the ratio of the two convergent denominators
q
2
/q
3
for all rationals with denominators less than 1800, and which have at least three
terms (so that q
3
= q
2
).
21
Figure 7: Fourth Convergents
The gure above shows the distribution of the ratio of the two convergent denominators
q
3
/q
4
for all rationals with denominators less than 1800, and which have at least four
terms (so that q
4
= q
3
).
22
Figure 8: Fifth Convergents
The gure above shows the distribution of the ratio of the two convergent denominators
q
4
/q
5
for all rationals with denominators less than 1800, and which have at least ve
terms (so that q
5
= q
4
).
23
1.5 Other Convergents
It is of some interest to examine distribution of other convergents. This section reviews
some of these.
1.6 Relationship to the Modular Group
The relationship between convergents q
n
p
n1
p
n
q
n1
= (1)
n
implies that the matrix
_
p
n
p
n1
q
n
q
n1
_
S

L(2, Z) (31)
where S

L(2, Z) is the special linear group of two-by-two matrices over the integers,
with determinant equal to plus or minus one. The star on the S is to distinguish it from
SL(2, Z), the subgroup having determinant plus one.
1.7 Structure and Randomness
The computer efforts at rst seem to paint two contradicting interpretations about the
distribution of the gaps. For small denominators, there seems to be a detailed and ne
structure; yet, for large denominators, this structure seems to blur away, and one gets
the impression of a perfectly uniform distribution. In fact, both conclusions are cor-
rect. Each of the pictures above and below were created with a uniform pixel size:
600 pixels dividing up the interval 0 to 1. For small denominators, each pixel may
contain only one gap, and maybe none; for large denominators, each pixel may repre-
sent the average of dozens or hundreds of gaps. It seems reasonable to conclude that
the structure of horizontal and vertical bars is in fact scale-invariant, and persists down
to innitesimal scales. Looking at large-denominator distributions with only 600x600
pixels effectively blurs all the structure away. Thus, on a coarse-grain, the distribution
of the gaps appears to be perfectly random; a ner choice of binning, while holding
denominators xed, would lead to pictures of detailed structures at ner levels, and so
on.
Thus, in order to talk about the gaps for all rationals, one has two competing
limits that give different answers. In one case, we take the size of the pixels smaller
and smaller, and nd, for any xed scale of denominators, that there is a highly fractal
ligree. In the other case, we hold the size of the pixels xed, and take the limit of larger
and larger denominators, and nd a perfectly uniformdistribution. It seems impossible
to dene the distribution in and of itself without resorting to talking about pixels at
some point.
Conjecture: The distribution of the ratio of the partial convergents R
p/q
q
N1
/q
N
is
perfectly uniformon the half-unit square, using conventional notions of measure,
density and distribution, when we consider all possible rationals, rather than
rationals with small denominators.
Proof: None (currently) supplied.
24
Its not clear how to start on this proof without rst developing tools that deal with the
scaling relationship of the structures. Blurriness presumably sets in when there are
two or three gaps per pixel; thus one will see structure whenever the denominators are
at about the same scale as the pixel widths. Thus, the two scale parameters are the
pixel size, and the ratio of pixel size to typical denominator magnitude. A proof of
uniformity then becomes (presumably) an argument about the mean-square variations
of the distribution as a function of the pixel/denom ratio. We expect the mean-square
variations to be independent of the pixel size; i.e. scale-independent, and to depend
only on this ratio.
1.8 Proof that Gaps are Cauchy-dense on the Unit Square
The incredible randomness of the distribution, as well as its Cauchy-sequence-density
on the unit square can now be easily understood. To do this, consider the iteration of
the map
h(x) =
1
x

_
1
x
_
(32)
This map has the property that lops off the leading term of the continued fraction:
h([a
1
, a
2
, ...]) = [a
2
, a
3
, ...] . Iterating this map clearly gets one further and further into
the continued fraction, and it is clear that two points that start arbitrarily close together
will have orbits under this map that eventually become uncorrelated. That is, this map
clearly has a positive Lyapunov exponent for all irrationals.
Homework: Compute the Lyapunov exponent for this map.
We can gain some intuition by comparing this map to the Bernoulli map
b(x) = 2x 2x (33)
which has the property of lopping off the leading digit of a binary expansion of x.
Again, two random irrationals that start out arbitrarily close together will eventually
have binary expansions that are uncorrelated and completely random. Even though
one may know the rst N digits of the expansion, one cannot predict the next digit
of the expansion; and this is what we mean when we say random or uncorrelated.
The only problem with this is that the language used in the last two sentances is com-
pletely loaded. If we know the number x, then we know the Nth digit in its binary
expansion; thus, how can it be random and uncorrelated? This is a paradox of
deterministic chaos that is worth exploring.
Lets try to restate the paradox. We would like to be able to say, that, when consid-
ering the entire set of reals on the unit interval, that, when examining the Nth binary
digit in the expansion, that Nth digit is completely random, and is uniformly dis-
tributed (equipartition of probability), with the probability of the digit being 0 being
1/2 and the probability of it being 1 is also 1/2. But of course, this statement is patently
false, and therein lies the paradox. We can, of course, trivially and exactly predict
the Nth digit, as the Bernoulli process is completely deterministic. The Nth digit is
25
trivially e
N
(x) =
_
2
N
x
_
2
_
2
N1
x
_
and the graph of e
N
(x) is a square-toothed comb.
One has this problem even for N getting very large, and approaching innity: the comb
remains uniform and entirely predictable no matter how large N gets.
I suppose there are two ways out of this paradox. One way out is to say something
like Yea, Verily, Chooseth two Irrationals whose Binary Expansions are Completely
Uncorrelated, which sounds like an invocation of the Axiom of Choice. Indeed, the
set of computable numbers is countable, and is of measure zero on the real number line.
In order to compute the Nth digit of x, one must somehow already know x. Since
the set of of unknowable numbers has measure one on the unit interval of reals, one
arguably must choose if one is to get a truly random number. Thus, we can anchor
the concept of randomness of bit-sequences of the binary expansion of real numbers in
the concept of Turing-uncomputable numbers and the Axiom of Choice for choosing
one of these unknowable numbers. This is cleary dangerous territory, and somewhat
tangled as a denition of randomness.
The other way out of the paradox is far more mundane, and seems constructive,
and that is to apply shop-worn statistical methods. After all, chaos occurs in numerical
simulations, on nite and computable sets, and not in set-theoretical limits. Chaos is a
computational phenomenon. What we can say is that for any given real y and >0 and
> 0, one can always nd an integer N such that the average value of e
N
approaches
1/2 on the interval: that is, there exists an integer N such that

1
2

_
y+
y
e
N
(x)dx

< (34)
holds true for all real y and >0 and >0. This is a constructive denition of random-
ness on the real number line that does not require an appeal to the Axiom of Choice or
to the choosing of uncomputable (unknowable) numbers as a basis for the randomness
of bit-sequences in the binary expansion of a real number. We can approach random-
ness through traditional delta-epsilon proofs on the expectation values of well-dened
quantities. For the following, we are interested in random continued fractions, and
by analogy, we extend the above denition of randomness to the sequence of digits
in a continued fraction expansion.
Now, to move the conversation back to the iterated continued fraction map, and that
proof.
Theorem: For any real values x [0, 1] and y [0, 1/2] and positive , > 0, we can
nd a rational p/q such that |x p/q| < and |y q
N1
/q
N
| < .
Proof: (partial sketch) Start by picking

< and some rational p

/q

such that |x
p

/q

| <

. Develop the continued fraction expansion of this rational as p

/q

=
[a
1
, a
2
, ..., a
N2
]. Then we need to show that we can always pick a positive in-
teger k such that the rational p

/q

= [a
1
, a
2
, ..., a
N2
, a
N1
] satises |p

/q

/q

| <

or, equivalently, |p

/q

x| < whenever a
N1
k. Next, we
note that if we pick a
N1
> k (strictly greater than this time) and any a
N
N,
then p/q = [a
1
, a
2
, ..., a
N2
, a
N1
, a
N
] satises |p/q x| < . Next, we notice
that this freedom to pick a
N1
and a
N
allows us to jigger around the value of
26
q
N1
/q
N
to satisfy the desired result for many values of y. That is, we use the
recurrence relation q
N
= a
N
q
N1
+q
N2
to deduce that
q
N1
q
N
=
1
a
N
_
1
q
N2
q
N
_
(35)
and thus
q
N1
q
N
=
1
a
N
_
1
1
a
N
a
N1
+1 +a
N
q
N3
/q
N2
_
(36)
and rearranging,
q
N1
q
N
=
1
a
N
+1/(a
N1
+r)
(37)
In this expression, the value of q
N3
/q
N2
r was xed by our initial choice
of p

/q

. However, we are free to pick any a


N1
> k and any a
N
. Note that
by picking a
N
= 2 and a
N1
very large, we can approach the upper limit of the
interval, and by picking a
N
very large, we can approach the lower limit of the
interval. We see that for values of y close to 1/m for some positive integer m, we
can also approach arbitrarily close, thus completing the proof for these values.
However, there are still holes that cannot be approached without jiggering the
value of r. For that, we need to adjust our initial pick of p

/q

to get the r that we


want. We then nd that we have to apply induction, in reverse, to get to there. I
believe this completes the proof.
To-Do: The above proof still involves some hand-waving, and thus needs to be tight-
ened up. In particular, there are some values of y that are hard, requiring the
inductive step to be invoked. These seem to correspond to the holes in the holes
in the lattice for small denominators. Its not obvious that the inductive step is
watertight; although the computer work shows it should be doable.
We will study the iterated map h(x) in great detail in later chapters, where we shall nd
that it is deeply related to the Modular Group SL(2, Z) and thus to the theory of the
symmetry of fractals, and to a variety of fascinating topics in number theory, as well as
to the celebrated Riemann Hypothesis.
1.9 Contrast to Space-Filling Curves
The work of Cantor shows that the cardinality of R
2
is the same as that of R, namely

1
. This implies that the points of R
2
can be enumerated by R. Space-lling curves
such as those of Peano or Hilbert can be used to develop that enumeration. However,
these curves have a locality property, in that if two points are close to each other in
R, then the points that they enumerate in R
2
are also close to each other. This is
by construction, of course: the curves of peano or Hilbert are inherently continuous.
We can, for example, graph the distance of the Hilbert curve from the the x-axis as
27
a function of the parameter that takes us along the curve. By construction, this is a
continuous curve, and it is *not* space-lling.
By contrast, the gap function is not a curve; by construction, it seems to be discon-
tinuous everywhere.
1.10 The Parabolas in the Distribution
The cause of the principal parabola seen in the pictures is now also clear. Blah Blah
Blah write this section too.
The main parabola that is visible is at T
p/q
(0) = 4(x 1/2)
2
, which we can solve
for directly to obtain x = q
N1
/q
N
and x = 1q
N1
/q
N
. Recalling that by denition,
x p/q p
N
/q
N
, we nd that the rationals on the main parabola are given by p
N
=
q
N1
and p
N
= q
N
q
N1
. Blah blah blah solve these equations.
Homework: There are other parabolas visible as well, offset on other fractions. De-
scribe these as well. Why are these rationals interesting?
The correct avenue for describing the multitude of the parabolas is to pin down the
self-symmetry relationships of the gaps. We already know from the study of continued
fractions and Farey Fractions that the relevant symmetry group is the Modular Group
SL(2, Z). (See the other papers in this series, duhh). Thus, we should start by reporting
on how the gaps transform under the action of the Modular Group elements.
1.11 The Hyperbolic Maps in the Distribution
Exploring the shapes of the hyperbolic maps seen in the pictures requires the develop-
ment of the theory of these maps as the hyperbolic rotations of a binary tree, through
the action of the Modular Group. The development of this theory is done in a later
section. We only quote the results xxx here. Blah Blah Blah. What rational numbers
show up on which curves? The families of the curves. Write this. So this is another
to-do; maybe its own chapter. Again, a deep relationship to the modular group.
1.12 Conclusion
The seemingly pure randomness of the gap sizes is quite intriguing, and suggests pos-
sible relationships to similar phenomena in other areas. The (Big and little) Picard
theorems comes to mind. The little theorem states that an entire function will attain all
possible values, save one or two. The Big Picard theorem states that a function with
an essential singularity will attain all possible values (with one or two exceptions), in-
nitely often, within a nite domain of the singularity. Although the gap isnt analytic,
I still nd the Picard theorems suggestive. We will develop the tools to analyze the gap
in later chapters; in the meanwhile, we note that h(x), or, if you prefer, sin(1/x), has
an essential singularity at zero, and is instrumental in the construction and description
of continued fractions.
We also are reminded that cryptographic hashes depend on the ability to distribute
points randomly on the unit square, although they do so only on a nite-sized (but large)
28
lattice. We know that the modular group is central to the study of chaotic dynamical
systems and fractals; we nd it intriguing that the modular group also underpins the
study of elliptic curves, which lead to concepts of elliptic-curve cryptography. Perhaps
the seemingly inherent orderly randomness seen in each are different manifestations of
the very complex and surprising structure of the modular group.
Id like to go so far as to propose the Fundamental Theorem of Cryptography:
Since the gaps are Cauchy-dense on the unit interval, one is always free to pick any
sequence of points p/q that one may possibly wish, and then use the R
p/q
as their
cryptographic encoding. That is, the sequence of p/q is the plain-text, whereas the
sequence R
p/q
is the crypt-text. This encoding is provably unbreakable for any plain-
text because there exist an innite number of possible alternate decodings of R
p/q
that
come arbitrarily close to the cryptext, but are arbitrarily distant from the plaintext p/q;
indeed, this is what it means for a set of points to be Cauchy-dense on a plane. What
is truly remarkable here is that R
p/q
is a function, and not some fractal, space-lling
curve.
As a nal bit of madness, let us note that the gap contains all possible stochas-
tic processes on the unit interval. That is, given a stochastic process, and the usual
, > 0, one can nd a sequence of strictly (monotonically) increasing rationals p/q
that encode the information in that stochastic sequence to some arbitrarily accurate
level. But, by construction, this sequence inherits the modular group symmetry of
the continued fractions. Thus, in a certain sense, one might say that stochastic pro-
cesses have a (perfectly) hidden modular group symmetry. The symmetry is revealed
only when one tries to construct things out of the the stochastic sequence; taking, for
example, Diffusion Limited Aggregation (DLA). The self-similarity and scaling prop-
erties become manifest. In the case of DLA, the dendrites are inherently self-similar.
By decoding a pair of dendrites to their representative rationals, one then has a map
between the two dendrites, given by the modular group, explicitly exhibiting their self-
similarity (to within the , of the decoding). One could thus hand-wavingly say, the
perfectly randomdistribution of the gaps is the reason why self-similarity and scaling
appears in systems constructed out of randomnumbers. The self-similarity and scaling
are really just a manifestation of the deeper (fractal, modular group) symmetry of the
rationals themselves.
References
[Cut-the-Knot-UL ] Alexander Bogomolnys Cut-the-Knot: Continued Fractions on
the Stern-Brocot Tree http://www.cut-the-knot.org/blue/
ContinuedFractions.shtml provides a good elementary intro-
duction to continued fractions.
[Khi64] Aleksandr Yakovlevich Khinchin, Continued Fractions (1964),
Dover Publications, Mineola NY.
29

You might also like