7

HOW LONG IS A PIECE OF STRING?

The curious world of fractals

Here are two pieces of string. Which of them is the longer?

image

You are right, this IS a trick question.

The answer is B. These are not ordinary pieces of string. String A is perfectly straight, but look at B through a magnifying glass and it looks like this:

image

B is actually made up of tiny zigzags, which make it twice as long as it first looked. But that isn’t the end of it. Zoom in on any zig or zag and it looks like this:

image

Which means that B is actually twice as long again. In fact each zig and zag on this line is itself a zigzag, which doubles the length of that line.

image

And it turns out that this goes on for ever. Which means that, depending on how far you zoom in, and what ruler you use, the length of this line can be made to keep on doubling to anything up to infinite length. How long is a piece of string? It would appear that it really can be any length that you wish.

The infinite piece of string may be theoretical fun, but it actually has practical consequences in the real world.

Early in the twentieth century, it was discovered that the Portuguese and the Spanish were making different claims about the length of their border. This wasn’t because of a dispute between the countries. Both countries happily agreed on the tortuous path that the border took, meandering for the most part along river valleys. But the measurements that they quoted in their reference books differed enormously. According to the Portuguese, the length of the border was 1,214 kilometres, while Spain claimed that it was 987 kilometres.

Discrepancies like this are commonplace. What is the length of the River Danube? Depending on which reference book you use, it might be 2,850 kilometres (Britannica), 2,706 (Pears) or 2,780 (one source on the World Wide Web). Maybe your reference book says something different again.

Why do the measurements turn out to be so variable? The answer is that the length of a river, or a coastline for that matter, depends on the accuracy of the map that you use. The more that you magnify the line, the more coves and bobbles you reveal, and within each bend there are other even smaller bends. A highly detailed surveyor’s map will show up far more of these bobbles than, say, a road map. This can lead to huge discrepancies in the length of a line, as the zigzagged piece of string showed.

How long is a piece of string?

The normal way to measure a piece of string is to pull it straight and measure the distance between the two ends. However, to measure its true length you need to run a ruler along its edge, and since its edge is not a perfect straight line even when it is pulled tight, the answer you get will depend on the accuracy of the ruler that you use, in just the same way as the length of a river depends on the scale of the map. So one answer to the question ‘How long is a piece of string?’ is ‘It depends on the ruler that you use.’ Other more facetious answers also exist, of which the most common is ‘Twice the distance from the middle to the end’.

Micro-patterns and fractals

There is something else important about the shape of a meandering river. Its winding shape looks much the same on a map of scale 1:10,000 as it does on a 1:100 map. This is similar to the zigzag string, where zooming in revealed identical zigzag shapes no matter how greatly the line was magnified.

image

Patterns that continue to reveal similar patterns on a smaller and smaller scale as you zoom in have a special name. They are known as fractals. Fractals are not dissimilar to a Russian doll, where you open up the giant doll to reveal a smaller replica, inside which is another smaller but otherwise identical doll… and so on.

Shapes that are fractal, or certainly close to fractal, appear throughout nature. One often-quoted example is a fern leaf such as bracken. The large leaf is composed of nearly identical copies of itself:

image

Broccoli is another example. Take a large head of broccoli and you will find that it is composed of several branches. Cut off one of these branches, and the result is a smaller but otherwise perfectly formed head of broccoli. This too will be composed of branches, each of which leads to a mini-broccoli.

You can often go to four stages with this, ending up with lots of cute little baby broccolis.

Shapes of this complexity can be produced from quite simple rules. Here is an example of the rules that you could use to make a treelike shape:

Start with a single vertical line (a branch), of length L:

image

The rule for adding branches is as follows:

13 along the branch, add branches length 12 L, 30° on each side.

23 along the branch, add a branch length 13 L, 30° on each side

image

After one iteration, it looks like this:

image

Now apply the same set of rules to each new branch, and then to those branches. The result bears a close resemblance to a tree.

This example shows how fractal shapes can be produced by following a sequence of simple, repetitive rules. However, the mystery of fractals deepens when it turns out that fractal shapes can sometimes be produced by apparently random sequences, too.

Here is an odd little game. Below is a triangle, with corners labelled A, B, C. The object of the game is to fill the triangle with dots.

Start by choosing a point anywhere at random inside the triangle. An example is shown at the point X, though you can choose any point you like.

image

To determine where you place your second dot, you need to choose randomly between the three corners A, B and C. One way to do this is by rolling a die. Numbers 1 and 2 represent A, 3 and 4 B, and 5 and 6 C. Suppose you choose B. The next point must be drawn exactly midway between your current position and B. In the triangle opposite, Y is the second point. Roll the die again to determine the point to follow Y.

Keep repeating this process for as long as you can, trying to be accurate with your plotting. After twenty or thirty goes, a pattern begins to emerge from the dots you have drawn, and, the longer you go on, the clearer this image becomes. Surprisingly, the pattern is not completely random. Instead, it is a series of intricately nested triangles that get smaller and smaller. This pattern is known as the Sierpinski gasket, and the shape is fractal. No matter how far you zoom in, you will find replicas of the pattern of inverted triangles.

image

The pattern was created by an apparently random process of plotting dots. However, this same pattern can be produced in a completely different way that is not random at all. Draw an equilateral triangle, and shade in an upside-down triangle in its centre, like this:

image

Now do the same thing in the three remaining white triangles. Repeat this process on all of the smaller white triangles that you create, and the result will be the gasket once more.

image

This connection between ordered rules and apparent randomness is an important feature of many fractals, and doesn’t just apply to shapes. It can apply to numbers, too.

Fractals in number patterns

What can it mean for number patterns to have fractals within them? All the examples of fractals so far, from rivers to broccoli, have been demonstrated in pictures, and the best way of seeing fractals in number patterns is to represent these as pictures, too. The most common way of representing numbers in a picture is on a graph.

If you want to know the practical applications of fractal mathematics, you should ignore what follows and jump straight to the next section. However, it is interesting to divert from everyday life for a moment to see how algebra can be intimately linked with fractals.

Before creating a fractal image, we need to generate the numbers that will go into it. There are many ways of using mathematical formulae to produce fractal shapes, and some of these are extremely complicated. What follows is one of the simplest, and you may find even this a little bit fiddly, but it’s worth working through it just to appreciate the surprising pattern in the end product.

To produce the fractal, we’re going to need to generate numbers by feeding them into a box, then take what comes out at the far end, and feed that back into the box. This is known as an iterative function.

image

Choose any decimal number D between 0 and 1, and feed it into the box. For example, the starting point for D might be 0.6. The rule for producing the new value for D is to take the current value of D and multiply it by (1 – D). In this case, 0.6 x 0.4 = 0.24.

Now feed this new value of D, 0.24, back into the box, to create the next value of D: 0.24 x (1 – 0.24) = 0.1824 . Repeat this cycle a few times, and D will rapidly decay away towards zero. In fact this will happen whatever value of D you start with. Nothing exciting so far.

Things get much more interesting, however, if another box, K, is added to the system.

image

K is like a control button on the system, and we’re going to see what happens to the final value of D as K is increased.

We already know that if K is 1, D always decays to zero. Suppose instead that K is 2, and you choose a starting value of D as 0.6 like last time.

First time through the system:

image

…feed this back through to give …

image

…feed this back to give

image

After just three loops through the system, it’s already becoming apparent that D is going to end up at 0.5. What’s more remarkable is that, if K is 2, whatever value of D you start with between 0 and 1, it will always end up at 0.5, and it will get there pretty quickly, too. Before going any further, you might care to try this out for yourself by choosing a different starting number for D. A pocket calculator would be handy.

What will happen if K is 2.5? D always ends up at 0.6, whatever value of D you start with.

If K is 3, however, something odd happens. D eventually ends up oscillating between two numbers, 0.669 and 0.664. Oscillating? How on earth has this happened? It’s very mysterious, and this is only the start of it.

When K is 3.47, D always ends up cycling around four numbers, 0.835, 0.479, 0.866 and 0.403. From here, as K increases by small increments the quantity of numbers in D’s final cycle doubles with rapidly increasing frequency. First D oscillates between eight numbers, then 16,32 and so on. This process of doubling is called bifurcation. Finally, when K gets close to 4, there seems to be no cycle at all. D just leaps in a seemingly random fashion from one number to another, never settling anywhere.

image

Here, at last, are some numbers to plot on a chart, though to produce an accurate diagram you’d need to examine every value of K between 1 and 4. This is because between areas of apparent randomness, there will occasionally be tiny zones where the number of oscillations drops to a small number again – for example, at 3.74, there are five numbers in the oscillation.

This is an impression of what the complete diagram would look like:

image

The lines represent the values that D ends up at. Notice how the single line suddenly splits into two lines when K reaches 3, and continues to split thereafter.

So where is the fractal? If you zoom in to look at any part of this chart in more detail, you will find that it is made up of micro-versions of the same complex pattern.

image

The simple act of multiplying D by 1 – D has created a fractal of quite remarkable intricacy.

How fractals helped the Internet…

Now that you know that mathematical formulae can produce fractals, there may be a little question nagging away: ‘This is all very pretty, but so what?’ Fractal geometry has already found at least one valuable application to the real world. It has played a part in speeding up the transmission of pictures across the Internet.

If you are in the habit of downloading pictures from the Web, you will be well aware that this can be painfully slow. This is because the amount of information stored in a picture is huge, and transmitting details of every pixel can mean an image occupying hundreds of kilobytes. To cut down on this, programmers needed to get clever. We’ve already seen that mathematical equations or rules can create complex images. Is it possible that a picture of Buckingham Palace or Tom Cruise could be reduced to a formula, too? After all, a formula takes up far less space than the entire details of a picture. Without stretching the truth too far, this is just what has been achieved.

Look again at the image of the tree here. The slow way of reproducing this picture is to copy each point in turn. A quicker way, however, would be to recognise that the big image is really just multiple copies of one of the smaller branches. To rebuild the image, all you need is one small section, and instructions on where to copy this in order to create the whole image.

Exactly the same principle applies with more complex pictures. All published images are really a combination of tiny coloured dots, most easily seen if you study a photograph in a newspaper. A crude image of Tom Cruise can be created using big coloured dots, and a fine image by using tiny dots. If you search for long enough, you will find that patterns in the crude image can be found in tiny sections of the fine image. For example, the crude image of Tom Cruise’s nose could be exactly the same as a tiny portion in the fine image of his earlobe.

By searching through the image, it’s possible to find close matches between every large part and some corresponding tiny fragment. With the appropriate instructions (for example ‘rotate by 45 degrees and shrink by a factor of 10’), and after several iterations, the crude picture can be used to rebuild the much higher-quality picture. This is no more than a glimpse at the extremely involved mathematical and computational work required.

…and how fractals could earn another fortune

There is one other area where understanding the maths behind fractals could lead to even more of a fortune.

If you are a shareholder, you probably take an interest in the Dow Jones Index or the FTSE 100. Every day the index moves up and down, and every week, every year, and so on. Predicting the movement in the price of shares is a lucrative business if you get it right, so not surprisingly city analysts have spent millions upon millions trying to come up with ways of forecasting which way the prices will go. The trouble with most forecasts, however, is that they only seem to work after the event. A perfect model can be produced that exactly mimics what happened in the past, but try extrapolating it to predict the future and the results are often little better than sticking a pin into the page at random. (A very believable story did the rounds a few years ago that a group of economists and a group of housewives were challenged to forecast growth in the next year based on a graph of the last five years. The economists used detailed mathematical models, while the housewives sketched in the line that looked most sensible. The housewives won.)

The problem with stocks and shares is that, while their longterm trends seem to be reasonably steady, their short-term movements have always appeared random. But the growing interest in fractals has led analysts to take another look at the patterns of moving share prices. Like meandering rivers, the patterns of share prices show signs of being fractal.

Take a look at the price of a particular share over the course of a year:

image

Here is the same share price viewed over shorter time intervals during a week:

image

And this is what it looks like measured in the course of a single day:

image

The shapes are all very similar. It’s as if we are zooming in on a fractal line.

However, observing a pattern is one thing, making use of it is quite another. Can the knowledge that share prices are fractal help you to forecast what will happen to a share in a year’s time? If the graphs of share prices really are fractal, then maybe a formula for that graph can be extracted. Some analysts have suggested this might be possible, though we are not aware of any such formula being published. Of course, if there really is a way of using fractals to predict share prices, then the people who have found it will want to keep pretty quiet about it.

The fluctuation of share prices is just one of several occurrences of seeming randomness in this chapter. The meandering of a river and the oscillations produced by a simple number function were two others. This randomness associated with fractals has a special name. It is called chaos, and deserves a chapter of its own …

An infinite boundary around a finite space

image

The perimeter around this 5 x 5 square is made of fractal zigzag lines of infinite length, like those at the start of the chapter. However, the area of the square is not infinite. Every bit of area lost to a ‘down’zig is compensated for by an ‘up’zig of the same size. So the area is 25cm2. Here, then, is an apparent paradox: it is possible for a shape to have a finite area, even though its perimeter is infinitely long.