[MUSIC] Welcome back. In this lecture I want to digress a little bit and talk about continued fractions. The reason continued fractions is of interest to us is because the golden ratio has a very peculiar continued fraction. That will give us some insight as to why the Fibonacci numbers might show up in the head of a sunflower. So what is a continued fraction? Here's the mathematical representation of a continued fraction. So x is a real number. We'll just consider positive numbers for convenience. a naught is an integer, a1, a2, a3 are a positive integers. So if x is a positive number, a naught then is the integer part of x. So if x is something like 2.35 then a naught will be 2. Okay? And then we go on and we can figure a1 and a2 and a3 out. So x, then is this continued fraction. If x is a rational number, so an integer divided by an integer, then the continued fraction is finite. This get truncated at a sub n and that continued fraction then can be simplified into the rational number which is x, an integer divided by an integer. If x is irrational, meaning it's not rational, it cannot be written as an integer divided by an integer. Then there's an infinite number of these a's, of these integer a's. And that all together, they converge to x. There's a short hand notation for the continued fraction, we can write it as a bracket with a naught, semicolon, and then a1, a2, a3. So this is just a convenient way of writing the continued fraction. Okay, I think the easiest way to see how continued fraction works is to do an example. So let's start with a rational number, three-fifths. So how do we write this as a continued fraction? So, the integer part is zero, so a naught is zero, okay that's trivial. And then how do we put three-fifths into the proper form? The trick is to write it as 1 over something And the thing that it should be over is the reciprocal of three-fifths. So it should be five-thirds, right? And then, what do we do? We pull out the integer part of five-thirds, so five-thirds is one plus something. So it's 1 plus two-thirds. And then we repeat the process for two-thirds. So if we repeat this process, this is 1 over 1 plus 1 over the reciprocal of two-thirds, which is three-halves. And then we pull out the integer part of three-halves. So this is 1 over 1 + 1 over 1 + 1 over 2, one-half, okay. This is a 1 up here, 1 over 2. So this is it, this is already the continued fraction. We can see this right, we can put it in the shorthand notation. a naught is 0, and then I put a semicolon. a1 is here, is 1 comma a2 is here, is also 1. And a3 is here, is two. Okay? That's the continued fraction for three-fifths, finite expansion. Okay, so this continued fraction here is exactly the same as three-fifths. What if x is an irrational number? So, as my example, I'd like to work pi. Everybody knows pi. So how can we figure out the continued fraction for pi? Well, let's see, let's try to work this out. So pi is equal to, so we can write this as the integer part which is 3 plus the fractional part, so that's our 0.1415 and so on, right? It's an irrational number, so the decimal expansion goes on non-repeating. And then we want to express this as a continued fraction, so we can write this as, 3 + 1, over 1, over this 0.1415 etc. Okay? How do we do that? Well, I have a calculator. So the easiest way is to do a calculator. I have pi in my calculator. I can subtract 3 from pi, so that becomes .14159, and then I can take the reciprocal of that. And let's see what we got here. I'll write down what we have. So we have 3 + 1 over, and this one I can put the integer part as 7, plus the fractional part, which is 0 .0625 etc. Okay? And we can keep on going, so then this is equal 3 + 1 over 7 + 1 over, and this is going to be 1 over this. So I can take the number by subtracting 7, take the reciprocal. And this denominate it here becomes 15 + 0.99 something. Okay? And then you can continue, so you can keep on doing this exercise. So what we found then is the first bit of the expansion. So we have 3 is a0, and then 7 and then 15, and keeps on going forever because it's an irrational number. Okay. These first two. Let me erase this. The first two integers in the expansion give us an approximation for pi, so pi is approximately 3, 7. Okay? And what is this? This is 3 + one-seventh. So this is 22 over 7, right? 22 over 7. I can use my calculator here. 22, 7, divide, 3.1428. Okay, which is actually already pretty good for pi. So it captures 3.14. That's a very well known approximation for pi 22 over 7. Okay, so that's our irrational number pi, what were really interested then is phi the golden ratio. So, what is the continued fraction for phi? I can do the same sort of mathematical trickery, I did to find the continued fraction for pi. But here, there's actually a rather neater way of doing it. We can remember that there's a relationship for phi, that phi is equal to 1 plus the golden ratio conjugate, which is one over five. So I can write that as phi = 1 + 1 over phi, okay? So that's the relationship satisfied by phi. This is a really nice formula for computing a continued fraction because we can take this phi here, and we can substitute in phi on the left hand side, right? So we can take the phi on the right hand side, 1 + 1 over phi and instead of phi we can put in the right hand side again, 1 + 1 over phi. Okay, so this is also an identity. But we can keep going forever right. Keep going forever, so 1 + 1 over 1 + 1 over, and then phi is 1 + 1 over, and pi is 1 plus 1 over, etc. It goes on forever, right? So what is so special about this continued fraction? Everything is 1. Yeah. Everything is 1. That's very special. The a0 is 1, the a1 is 1, the a2 is 1, the a3 is 1. We can simplify that by just putting a bar over that 1 meaning that the ones go on forever. Okay. That continued fraction for phi has a very special property, which is that it's the slowest converging continued fraction. What that means is that if you truncate the continued fraction, you don't get a very good approximation to phi. It takes a lot of ones before you start to get a good approximation to phi. We say that it has the slowest converging continued fraction, or we can also phi is a difficult number to approximate by a rational number. Right? The truncation is a rational number. So it's a very difficult irrational number to approximate by a rational number. Or maybe the most poetic way of saying this is that phi is the most irrational of the irrational numbers. Okay? That's how a physicist would talk. Phi is the most irrational of the irrational numbers. Let's just look at one more thing here. What are the rational approximations to phi? Right? The first one is 1, the second one is 1 plus 1 over 1, which is 1 plus 1, which is 2, right? The next one is 1 plus 1 over 1 plus 1 over 1, so 1 plus a half is 3 halves. The next one is 1, right, let me write down because it's hard to follow. 1 plus 1 over 1 plus 1 over 1 plus 1 over 1. So this is one-half plus 1 is three-halves. 1 over three-halves is two-thirds. 1 plus two-thirds is five-thirds, okay? 1 is the same as 1 over 1, 2 is the same as 2 over 1. 1, 1, 2, 3, 5, 8, 8, 13. Fibonacci numbers, right. You see Fibonacci numbers. So the continued fraction approximations to phi, the truncated approximations to phi, are just the ratios of the successive Fibonacci numbers. Okay? There's a cross-relationship between the continued fraction and the Fibonacci numbers. Okay, we're ready to go now, and to understand why there are Fibonacci numbers in the sunflower. I'll see you next time.