I Hike Gryke

Here are the simplified fractions in order of increasing denominator and numerator:

1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8, 1/9, 2/9, 4/9, 5/9, 7/9, 8/9, 1/10, 3/10, 7/10, 9/10, 1/11, 2/11, 3/11, 4/11, 5/11, 6/11, 7/11, 8/11, 9/11, 10/11, 1/12, 5/12, 7/12, 11/12, 1/13, 2/13, 3/13, 4/13, 5/13, 6/13, 7/13, 8/13, 9/13, 10/13, 11/13, 12/13, …

You get 1/4 and 5/12, but no 2/4 or 3/12 and so on, because the fractions are simplified and 2/4 = 1/2 and 3/12 = 1/4. Now suppose you map those simplified fractions on a graph of x = y = 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, … The graph is obviously just a straight line at 45°:

Graph of x = y = 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, …


But suppose you adjust some of the simplified fractions for y, so that the list looks like this (adjusted fractions appear in red):

1/2, 1/3, 2/3 → 1/3, 1/4, 3/4 → 1/4, 1/5, 2/5, 3/5 → 2/5, 4/5 → 1/5, 1/6, 5/6 → 1/6, 1/7, 2/7 → 3/7, 3/7 → 2/7, 4/7 → 2/7, 5/7 → 3/7, 6/7 → 1/7, 1/8, 3/8, 5/8 → 3/8, 7/8 → 1/8, 1/9, 2/9 → 4/9, 4/9 → 2/9, 5/9 → 2/9, 7/9 → 4/9, 8/9 → 1/9, 1/10, 3/10, 7/10 → 3/10, 9/10 → 1/10, 1/11, 2/11 → 5/11, 3/11 → 4/11, 4/11 → 3/11, 5/11 → 2/11, 6/11 → 2/11, 7/11 → 3/11, 8/11 → 4/11, 9/11 → 5/11, 10/11 → 1/11, 1/12, 5/12, 7/12 → 5/12, 11/12 → 1/12, 1/13, 2/13 → 6/13, 3/13 → 4/13, 4/13 → 3/13, …

What does the graph for straight x and adjusted y look like? Much more interesting:

Graph of x = 1/2, 1/3, 2/3, …, y = contfrac_rev(1/2), contfrac_rev(1/3), contfrac_rev(2/3), …


That graph is what you could call a fractional fractal, because it uses fraction to create a fractal where parts resemble the whole and parts of the parts resemble the whole, down and down for ever (as I’ll show). I call it a limestone fractal or gryke fractal, because it looks like the fissured limestone pavements in the Yorkshire Dales, where the fissures are called grykes:

Fissured limestone pavement, Yorkshire Dales (Wikipedia)


A closer look at a limestone pavement (Dales Rocks)


As you plot the fractions for x and adjust the fractions for y, the gryke graph grows like this:

The gryke graph grows (animated at ezGif)


But how were the fractions for y adjusted to create the gryke fractal? With a very simple function called contfrac_rev(a/b). The function takes what’s called the continued fraction of a/b, then reverses it to derive a new fraction (sometimes it’s new, at least). For example, here’s the continued fraction of 13/17 and how you use the continued fraction to reconstruct 13/17:

continued_fraction(13/17) = [1,3,4] = cf(13/17)

fr = 0
1/4 = 1/(fr + 4) = 1/(0 + 4)
4/13 = 1/(fr + 3) = 1/(1/4 + 3)
13/17 = 1/(fr + 1) = 1/(4/13 + 1)

13/17 = 0.764705882352941176470588…

The continued fraction, [1,3,4], is read from right to left when the original fraction is being reconstructed. So reversing the continued fraction means reading it from left to right, like this:

fr = 0
1 = 1/(fr + 1) = 1/(0 + 1)
1/4 = 1/(fr + 3) = 1/(1 + 3)
4/17 = 1/(fr + 4) = 1/(1/4 + 4)

4/17 = 0.235294117647058823529411…

(Technical note: The reversed fraction of cf_rev(a/b) is always < 1/2, except for cf_rev(1/2) = 1/2. That's why the gryke graph above actually represents 0 to 1 on the x-axis and 0 to 0.5 on the y-axis.)

Now let's look at how the fractal in the graph can be magnified for ever and always yield new versions of the original graph. You can call it hiking the gryke, because you hike or increase the resolution of the graph to reveal the finer details. The first step is to mark the gryke site to be hiked. Here's the full graph, with a green square showing the section to be hiked or magnified or zoomed:

Gryke to hike

↓

Gryke hiked


You can combine the zoom-to-be and the zoomed section in a single image, where the full fractal is on the left and the zoomed section on the right:

Gryke-to-hike and Gryke-hiked (click for larger)


Here are more hikes of the gryke, or zooms of the full fractal:

Zoom #2


Zoom #3


Zoom #4


Zoom #5


Zoom #5+1


Zoom #5+2


Zoom #6


And here’s an animated gryke-hike or zoom into a single section of the fractal:

Hiking the Gryke (animated at ezGif)


Previously Pre-Posted…

• I Like Gryke — a first look at the gryke fractal
• Worms in Terms of Perms — permutating the gryke fractal

When Pyramids Decay

What’s the point of writing 2/10? It’s equal to 1/5, just as 4/10 = 2/5, 6/10 = 3/5 and 8/10 = 4/5. But there are times when the full-fat form can be mathematically — and æsthetically — appropriate. For example, you get a nice series of triangular waves — and an optical illusion — when you use all the rational fractions to create a graph representing the size of the fraction, a/b, as 0 < a/b < 1. If the even denominators are in white and the odd denominators in red, the graph looks like this:

Graph of 1/2, 1/3, 2/3, 1/4, 2/4, 3/4, 1/5, 2/5, …
(click for larger)


The optical illusion is that the lines of waves appear to sink from left to right. Otherwise the graph has no complexity. But suppose you take the continued fraction of a/b, reverse it, and calculate a new fraction from the reversal. If you use the fractions in simplest form, you get this graph:

Graph of a2/b2 = reversed(contfrac(a1/b1)) for 1/2, 1/3, 2/3, 1/4, 3/4, …


But if you use all the rational fractions, simplified and unsimplified, you get a graph with pyramids and ships, like this:

Graph of a2/b2 = reversed(contfrac(a1/b1)) for 1/2, 1/3, 2/3, 1/4, 2/4, 3/4, …


The full pyramids are few, alas. But the other ones decay in interesting ways.

A FracTeasel on a Fract-L

Here are two new fractals, both of which remind me of the seedheads of the wildflower known as a teasel, Dipsacus fullonum:

A FracTeasel fractal


Dried seedheads of teasel, Dipsacus fullonum (Wikipedia)


Another FracTeasel fractal (embedded in the first)


Flowering seedhead of teasel, Dipsacus fullonum (Wikipedia)


How do you create the two FracTeasels? Let’s look first at the fractal they’re inspired by. In “Back to Frac’” I talked about this fractional fractal, a variant of what I call the limestone fractal:

Variant of a limestone fractal or gryke fractal


It’s a fractal on a fract-L, that is, the x and y co-ordinates of the red L represent pairs of fractions generating decimals between 0 and 1. The x represents the fractions a1/b1 = 1/n to (n-1)/n in simplest form: 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8,…

And what about the y? It represents the fraction found by taking the continued fraction of a1/b1, reversing it, and generating a new fraction, a2/b2, from the reversal. For example, here’s the continued fraction of a1/b1 = 3/23 = 0.1304347826…:

contfrac(3/23) = 7,1,2

The continued fraction of a1/b1 = 3/23 is used like this to reconstruct a1/b1:

7,1,2

0 → 1 / (0 + 2) = 1/2 → 1 / (1/2 + 1) = 2/3 → 1 / (7 + 2/3) = 3/23

Now reverse the continued fraction, 7,1,2 → 2,1,7, and generate a2/b2:

2,1,7

0 → 1 / (0 + 7) = 1/7 → 1 / (1/7 + 1) = 7/8 → 1 / (2 + 7/8) = 8/23 = 0.3478260869565…

The limestone fractal above appears when a1/b1 → a2/b2 for a1/b1 = 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8,… But you can do other things to contfrac(a1/b1) beside just reversing it. What about the permutations of contfrac(a1/b1), for example? If length(contfrac(a1/b1)) = n, the permutations can generate up to n! (factorial n) new a2/b2 for the y co-ordinate (if all the numbers of contfrac(a1/b1) are different, you’ll get n! permutations). The resultant fractal is the first of the FracTeasels above (note that a2/b2 isn’t multiplied by two):

FracTeasel #1 from fract-L for y = perm(contfrac(a1/b1))


If you think about it, you’ll see that the fractal from permed contfrac(a1/b1) contains the fractal from reversed contfrac(a1/b1). It also contains the second FracTeasel:

FracTeasel #2


How so? Because the second FracTeasel — let’s call it the stemmed FracTeasel — is created by shifting some numbers in contfrac(a1/b1) and leaving others alone. For example:

contfrac(940/1089) = 1, 6, 3, 4, 5, 2 → 1, 4, 3, 2, 5, 6 = contfrac(1008/1243)

So the function is finding one particular permutation of contfrac(a1/b1) to generate a2/b2, not all permutations. And so the function creates the stemmed FracTeasel, which carries an infinite number of seedheads on the same stem. To show that, here’s an animated gif zooming in on the bend of the fract-L for the stemmed FracTeasel:

Zooming the FracTeasel (animated at ezGif)


Elsewhere Other-Accessible…

• I Like Gryke — a first look at the limestone fractal
• Lime Time — more on the limestone fractal