If you've ever been bored in math class (which I don't think is too uncommon for most readers of this blog), you've probably doodled a lot of things in your notebook. Some people like visual things, like fractals or knots or knotted fractals. Others doodle with numbers, shuffling them around and making sequences with them. There's one such way to doodle that brings numbers and shapes together (and makes cool-looking pictures, too): Continued fractions.
To explain what a continued fraction is, let's start with an example, say
25/18
Now, let's write that as a mixed number. (If the fraction is less than 1, put a 0 after it.)
1+7/18
Then, take the inverse of the fractional part.
1+1/(18/7)
After that, write the fraction as a mixed number again.
1+1/(2+4/7)
Invert the fraction:
1+1/(2+1/(7/4))
Repeat the process of writing the fraction as a mixed number and then inverting it.
1+1/(2+1/(1+3/4))
1+1/(2+1/(1+1/(4/3)))
1+1/(2+1/(1+1/(1+1/3)))
Notice how the 1/3 can't really be inverted, so the process ends there.
Now, ignore all of the "+1/"s and you're left with
1 2 1 1 3
Put that in square brackets and separate the numbers with commas,
[1, 2, 1, 1, 3]
and you've got the continued fraction expansion!
Okay, those were the numbers. On to the visuals!
Start with some graph paper.
To explain what a continued fraction is, let's start with an example, say
25/18
Now, let's write that as a mixed number. (If the fraction is less than 1, put a 0 after it.)
1+7/18
Then, take the inverse of the fractional part.
1+1/(18/7)
After that, write the fraction as a mixed number again.
1+1/(2+4/7)
Invert the fraction:
1+1/(2+1/(7/4))
Repeat the process of writing the fraction as a mixed number and then inverting it.
1+1/(2+1/(1+3/4))
1+1/(2+1/(1+1/(4/3)))
1+1/(2+1/(1+1/(1+1/3)))
Notice how the 1/3 can't really be inverted, so the process ends there.
Now, ignore all of the "+1/"s and you're left with
1 2 1 1 3
Put that in square brackets and separate the numbers with commas,
[1, 2, 1, 1, 3]
and you've got the continued fraction expansion!
Okay, those were the numbers. On to the visuals!
Start with some graph paper.
Draw a rectangle on it, so that the lengths of the sides are integers. I'll use 18 and 25 for the sides, just like before, and you'll see why soon.
Now, fit the biggest square you can inside of it, as many times as you can, and note how many times you can fit it in. In this case, there can only be 1 square, and there isn't enough room for another.
Now, repeat the process with the remaining rectangle: fit in as many squares as possible. Now, 2 squares can fit.
Keep doing this, continuing in a spiral fashion. 1 square can go in this time.
1 square again.
Now, you can see that there are 3 cells left. Let's just fill them in and end it.
This makes a cool-looking modern-art-esque design. Maybe color the squares in and get something like Mondrian. Or draw a spiral going from diagonal to diagonal.
(Side note: The size of the last square drawn, 1 in this case, is the same as the GCF, the greatest common factor, of the original two numbers, 25 and 18.)
Let's see how these doodle games are related!
From the first game, the sequence was 1, 2, 1, 1, 3. Now, let's look at the second game. First, 1 square would fit, then 2, then 1, then 1, and finally, 3. It yields the same sequence.
Let's try it with some irrational numbers.
Tau (2*pi) and e, being defined by means other than continued fractions, have essentially random numbers for their expansions.
(Side note: The size of the last square drawn, 1 in this case, is the same as the GCF, the greatest common factor, of the original two numbers, 25 and 18.)
Let's see how these doodle games are related!
From the first game, the sequence was 1, 2, 1, 1, 3. Now, let's look at the second game. First, 1 square would fit, then 2, then 1, then 1, and finally, 3. It yields the same sequence.
Let's try it with some irrational numbers.
Tau (2*pi) and e, being defined by means other than continued fractions, have essentially random numbers for their expansions.
For the 1-by-tau rectangle, approximately [6, 3, 1, 1, 7], the square with the thick upper border is actually a bunch of small squares that are completely filled in by their own outlines.
e is a little bit more pleasing, but there is one number that's defined to be great for this game - the golden ratio.
The golden ratio, also known as phi, is defined as
(1+sqrt(5))/2
where sqrt() means "square root". Its continued fraction expansion is
[1, 1, 1, 1, ...
forever. When the game is played with phi, an infinite spiral of squares is created.
The golden ratio, also known as phi, is defined as
(1+sqrt(5))/2
where sqrt() means "square root". Its continued fraction expansion is
[1, 1, 1, 1, ...
forever. When the game is played with phi, an infinite spiral of squares is created.
And when the diagonals of the squares are connected, the golden spiral appears.
Mathematics is full of connections that you wouldn't expect. Who knew that Pascal's Triangle modulo 2 gives Sierpinski's Triangle? Or that a coefficient in the j-function is the same as the size of the Monster group? Or that additive cellular automata can produce intricate fractal structures? I could go on and on. The point is, these connections are what gives math its true beauty - and maybe you should stop doodling and listen to the teacher for a bit.