# Pretty maths

Bear with this post as it goes through some equations at the beginning, but it is worth it. We’ll be doing some of the calculations to get this picture:

This is the set of numbers “c” such that  is bounded. These z are complex numbers, which we’ll ignore for now. It is much easier to understand if we look at some examples:

Let’s say c = -1.

We start with $z_0 = 0$

$z_1 = z_0^2 + c = 0^2 - 1 = -1$

$z_2 = z_1^2 + c = (-1)^2 - 1 = 0$

$z_3 = z_2^2 + c = (0)^2 - 1 = -1$

This is repeating, and the numbers are bounded.

Let’s now try c = 0.5.

We start with $z_0 = 0$

$z_1 = z_0^2+c = 0^2 + 0.5 = 0.5$

$z_2 = z_1^2 +c = (0.5)^2 + 0.5 = 0.75$

$z_3 = z_2^2+c = (0.75)^2 + 0.5 = 1.0625$

$z_4 = z_3^2 + c = (1.0625)^2 + 0.5 = 1.62890625$

$z_5 = z_4^2 + c = (1.62890625)^2 + 0.5 = 3.15333557129$

$z_6 = ...$

We can see that these numbers are getting bigger and bigger, and it is not bounded.

One more: c=-1.9

$z_0 = 0$

$z_1 = z_0^2 + c = 0^2 - 1.9 = -1.9$

$z_2 = z_1^2 + c = (-1.9)^2 - 1.9 = 1.71$

$z_3 = z_2^2 + c = (1.71)^2 - 1.9 = 1.0241$

$z_4 = z_3^2 + c = (1.0241)^2 - 1.9 = -0.85121919$

$z_5 = z_4^2 + c = (-0.85121919)^2 - 1.9 = -1.17542589058$

$z_6 = ...$

It bounces around a lot, never getting very big or very small, so it is bounded. It is kinda fun to sit with a calculator and try this.

Mathematicians call this kind of system “chaos”, as it is very sensitive to the starting conditions. Sometimes this is called the butterfly effect. Note that chaotic is not the same as random: in chaotic systems if you know everything about the initial conditions you know what will happen, whereas in random systems even if you knew everything about the initial conditions you wouldn’t know what was going to happen.

Benoit Mandelbrot was one of the first mathematicians to have access to a computer. Hopefully you can also see now why Benoit Mandelbrot needed a computer to work these out. He repeated this for lots of values of c. The pretty picture we started with is really a plot of the set of c (called the Mandelbrot set), where the colours indicate what happens to the sequence (eg how quickly it converges, if it does).

You can zoom into the colourised picture to see how complex this is here. Lots of people (me included) think it is pretty cool. It is really worth taking a look to appreciate the complexity.

## Other than being pretty, why does this matter?

Stepping back: This picture is made from the formula . This is so simple, and yet gives rise to infinite complexity. In the words of Jonathan Coulton,

Infinite complexity can be defined by simple rules

Benoit Mandelbrot went on to apply this to the behaviour of economic markets, among other things. Later people have applied this to fluid dynamics (video), medicine, engineering, and many other areas. Apparently there is even a Society for Chaos Theory in Psychology & Life Sciences..!

Orley Ashenfelter, an economist at Princeton, wanted to guess the prices that different vintages of Bordeaux wine would have. This prediction would be most useful at the time of picking, so that investors can buy the young wine and allow it to come of age. In his own words:

The goal in this paper is to study how the price of mature wines may be predicted from data available when the grapes are picked, and then to explore the effect that this has on the initial and final prices of the wines.

For those of you not so au-fait with wine, prices vary a lot. At auction in 1991, a dozen bottles from Lafite vineyard were bought for:

• \$649 for a 1964 vintage
• \$190 for a 1965 vintage
• \$1274 for a 1966 vintage

Wines from the same location can vary by a factor of 10 between different years. Before Ashenfelter’s paper, people predicted wine quality by experts, who tasted the wine and then guessed how good it would be in future. Ashenfelter’s great achievement was to bring some simple science to this otherwise untapped field (no pun intended).

He started by using the things that were “common knowledge”: in particular that weather affects quality and thus selling price. He checked this by looking at the historical data:

In general, high quality vintages for Bordeaux wines correspond to the years in which August and September are dry, the growing season is warm, and the previous winter has been wet.

Ashenfelter showed that 80% of price variation could be down to weather, and the remaining 20% down to age. With the given inputs, the model he built was:

log(Price) = Constant + 0.238 x Age + 0.616 x Average growing season temperature (April-September) -0.00386 x August rainfall + 0.001173 x Prior rainfall (October-March)

As it turned out, this simple model was better at guessing quality than the “wine expert”: a success for science against pure intuition. The smart part of his approach was getting insight in to the things people felt mattered (weather) and checking that wisdom. Here, he showed that yes it is quite appropriate to use weather and age to model wine prices.

Through the age variable, it also gives an average 2-3% annual return on investment [1] (note this is pre-2008 so is unlikely to behave like this today[2]).

Should I buy wine? Quite possibly, as long as I don’t drink it all.