 Welcome back we are in the final theme of our lecture course. The theme is entitled Continued Fractions. So these are basically fractions which are continued in some way. More precisely a continued fraction is an expression of the following form. Here these integers a i they are positive integer from a 1 onwards. So these onwards these are all positive and a 0 is just an integer. It can be 0, it can be positive or it can even be a negative integer. We have such an expression and this expression observe that it involves only finitely many integers. Such an expression is called a continued fraction. It is being called like this because it involves fractions and they are continued in some sense. So we call it continued fraction. We also saw an example in the last lecture that 15 by 11 can be written as a continued fraction in the following way. Moreover, this is not quite unique such expression because the last integer 3 can also be written as 1 by 2 plus 1 by 1. So we have some sort of nonuniqueness whenever there are rational numbers involved but the nonuniqueness would only mean that the last term where you will have an n that can also be written as n minus 1 plus 1 by 1. This is the only way by which we will have nonuniqueness for the continued fraction for rationals otherwise it is essentially unique. So before saying all these things we should also give a way to construct a continued fraction representation for a rational number and so on. We will do all these things as and when the time comes but we also noticed another thing that if you have a continued fraction then it is necessarily a rational number. Observe that a continued fraction is obtained by starting with an integer and then you write it as 1 upon a. So you have a 0 plus 1 and then you have a big horizontal line along horizontal line below that you write a1 plus 1 upon again another longer slightly shorter but along horizontal line then a2 and so on and we stop at an only finite data. So we observed it in the last lecture also that this is necessarily a rational number let us see the proof once again. So suppose theta n denotes this continued fraction then theta n is a rational number and as one would expect this proof follows by induction on n. So induction will start with n equal to 0 or n equal to 1 wherever you want. So we observe that a0 is of course a rational number. So if your n was 0 so we are done if n is 0 more over any theta n can be written as 1 a0 plus 1 upon here I will write it as theta prime n minus 1 where theta prime n minus 1 has a continued fraction expansion or here theta prime n minus 1 is a1 plus 1 upon a2 plus 1 upon dot dot dot plus 1 upon a n which we write as b0 plus 1 upon b1 plus 1 upon dot dot dot 1 upon bn minus 1 and if we assume the induction hypothesis because we are done with n equal to 0 so assuming the induction hypothesis showing the induction hypothesis theta n minus 1 prime is a rational number and then theta n a0 plus 1 upon theta n minus 1 prime also has to be a rational because once theta n minus 1 prime is rational this quantity is a rational number being reciprocal of this rational and then you are simply adding an integer so ultimately the number that you get theta n also has to be a rational number. So by the induction hypothesis whenever the result is true for n minus 1 the result is true for n once you have a continued fraction expansion a continued fraction representation having a0 a1 up to a n and if the for any a0 a1 up to a n minus 1 if you have that the corresponding number is rational then we prove that the number for a0 up to a n is also rational of course we have proved that for n equal to 0 the result holds so by the method of induction this result is now done. So every continued fraction is a rational number is the other way also true if we have a rational number is it equal to a continued fraction that is also true. So every rational number if you start with a q in rationals then it can be written as a continued fraction remember continued fraction is essentially given by the sequence a0 a1 up to a n where a0 is an integer and a1 a2 a n are natural numbers. So we want to write q a rational number in this form suppose our q has the form a by b where a is an integer and b is taken to be natural number so our b is taken to be positive and we will also have that a by b is 1 the GCD of a and b is 1 this is our standard requirement. Now a might be less than b or a might be bigger than b so what we do first of all is that we apply the division algorithm to a and b so by division algorithm a is going to be n1 plus r1 a is going to be n1 b plus r1 where your r1 is strictly less than b and of course you have that n1 is an integer. The division algorithm introduced by Euclid that we have studied in our course requires both a and b to be natural numbers but we can of course do it whenever b is a natural number and a is any integer we can of course have the corresponding result with the small change that the quotient that you had obtained that quotient can now be an integer. Earlier when we worked with a and b to be both natural numbers we had that the quotient q1 that we had obtained there was a natural number but if you have your a to be negative then it is possible that b into a negative number gives you a plus there is a remainder. So we will now take the n1 to be an integer and r1 is now a positive integer with the property that it is between 0 and b but it is not equal to b. So with this we then have a upon b equal to n1 plus r1 upon b. So we have written a by b the given rational number as an integer plus r1 upon b. Now this r1 can be 0 or it can be nonzero but it is strictly less than b. So r1 by b belongs to 0 comma open 1. Since r1 is strictly less than b r1 upon b is a rational number which is less than 1 and because r1 can be 0 you have that r1 upon b can also be 0 but it is otherwise strictly between 0 and 1. So if you take the reciprocal of r1 by b that will be a number which will be bigger than 1 we have q equal to a by b to be 1 n1 plus 1 upon b upon r1. Now r1 is less than b and so we can apply the division algorithm once again to the pair b comma r1. So we get b equal to n2 r1 plus r2 with 0 less than or equal to r2 strictly less than r1. Now all these are natural numbers because our b is a natural number r1 is a natural number so n2 is natural r2 is natural and moreover r2 lies between 0 and r1 with possible equality at 0. So this gives q equal to a by b which we have written as n1 plus 1 upon b by r1 but we once divide by r1 we get this to be n2 plus r2 by r1. Once again r2 by r1 is strictly less than 1 so you invert that and repeat the procedure you will get r3 by r2. And notice here that the denominators that you are getting at all these levels earlier we had b then we got r1 which is strictly less than b then we got r2 which is further strictly less than r1 and so on if you continue this way you are going to get denominators which are strictly decreasing and these decreasing denominators will eventually reach the number 1 which is where the Euclidean algorithm concludes to give you the GCD of a and b which is going to be 1 because we have assumed that a and b are co-prime. So once this reaches 1 then we will conclude this process so once ri becomes 0 this process concludes to give a continued fraction representation for q which is a by b. So we proved that while every continued fraction is a rational on the other hand every rational number can also be written as a continued fraction. Now the next thing we would want to do is to look at general real number and see how the continued fractions help us in approximating the real numbers. There is of course the question of uniqueness but we have already noticed that when you have the uniqueness does not hold as n is n minus 1 plus 1 upon 1 but this is the only possible such instance. That means every rational number thus every rational representations as a continued fraction different n's. So if you have a continued fraction representation for n integers involved there then you will have another with n plus 1 integer or n minus 1 integer. So this is the only difference that we will have for a continued fraction representation for a rational number. This is the small thing that we have to be careful about whenever we want to write any rational number as a continued fraction but the algorithm that we have expressed is going to give us the continued fraction for the given rational number. Note that even if you have two representation for the same continued fraction one with n integers involved and say another with n plus 1 integers the value of the continued fraction does remain the same. So unless you have to really work with the numbers which are there involved in the continued fractions unless you have to do that you do not really have to worry about this question of non uniqueness. So we would further want to see that every real number theta is a limit of continued fractions in some sense a unique way. So I expect that all of you know how the real numbers are constructed from rational numbers there is some small bit of analysis which we will have to consider here. So everybody knows that this is the set of rational numbers you have a by b where a is an integer b is a natural number and we will also assume that a by the GCD a b is 1. This is the set of rational numbers and if you have the real line then the rational numbers can be plotted on this real line you have 0 you have 1, 2, 3, minus 1, minus 2, minus 3 then you have 1 by 2 this is 3 by 2, 5 by 2, minus 1 by 2, minus 3 by 2, minus 5 by 2 and so on. We can continue this way but the distance between the 2 rational numbers will become smaller and smaller once you increase the denominator. So for instance 1 third will come somewhere here 2 thirds come somewhere here then this will be 4 thirds and this will be 5 thirds and so on and on this side there are negatives. So this is also a fact that any real number now what is the real number? So one way you can think about real numbers in an intuitive sort of way is any number which can be plotted on this real line. You take your pen and point it anywhere suppose I point it here. So I am looking at this real number anything that can be plotted. So the real number now is the quantity which is the distance of 0 to this particular point. So any such point will give us a real number once we have specified where we are putting 0 and once we define what is 1 that will decide what is the unit. Once you have that then any point on the real line gives rise to a unique real number and it is clear that any real number is always a limit of rational numbers. So this is expressed by saying that the set of rational numbers is dense in the set of real numbers. There are many ways to obtain the sequence of rational numbers converging to a given real number. What you can do is that first of all you can look at all integers. Now distance between any two integers is at most 1, any two consecutive integers is at most is equal to 1 and your real number theta has to belong to some such consecutive pair of consecutive integers. We have the whole real line which we are going to cut into several sub intervals of length 1 whose end points are integers and then your real number will have to belong to some certain n to n plus 1. Then you take the smallest one call that n that will be the first term of the sequence converging to your real number. Because once you have this integer next you can look at all the numbers whose denominators is equal to 2 and the numerator can be all integers once again. So you have the number 0 by 2 which is 0, then 1 by 2, then 2 by 2 which is 1, then 3 by 2, 4 by 2 which is 2, then 5 by 2 and so on. So once again you have an infinite set but now the distance between any two consecutive such numbers is reduced by a factor of 2. Earlier we had integers where the distance was 1, now we have these rational numbers whose denominator is 2 or 1 and so the distance between any two such numbers is equal to, any two consecutive such numbers is 1 by 2 and your theta has to belong to one such sub interval. So we will again take the one which is just preceding your theta. So you have gotten another element possibly it is the same element that you obtained in the first step but it could also be some new element. So this is your second element earlier element had the property that your theta and your earlier element were bound the distance between these two was less than or equal to 1. Now the second entry of the sequence that we are going to construct has the property that theta and this second entry the difference of the two is less than or equal to 1 by 2. Then you will go to the rational numbers whose denominators are 3. So you will have 0 by 3, 1 by 3, 2 by 3, 3 by 3 which is an integer 4 by 3, 5 by 3, 6 by 3 which is an integer same on the negative side and once again you get third entry of your sequence with the property that the distance now from theta of the third entry is less than or equal to 1 by 3. So we just continue this way and you will get some number a by n for every n you will get an a depending of course on n such that the distance of theta and a by n is less than or equal to 1 by n and a is an integer and you can also always choose a by n to be less than theta it is on the left hand side. So you when you look at mod theta minus a by n it is actually theta minus a by n that is a positive quantity because theta is bigger than a by n. So we have this difference to be less than or equal to 1 by n and this can be done for every n as you let n go to infinity we have that actually a sequence is constructed of rational numbers going to theta. Now you could have taken the numbers coming after theta and that would give you another such sequence or you could take the first term to be before theta, next one after theta, third before theta, fourth after theta and so on. So there are many ways to construct these sequences but what we want to know is whether there is a nice way to approximate real numbers by rational numbers. So what we have constructed so far has the property that theta minus a by n has distance less than 1 upon n. Now we may say that 1 upon n is a very big number we want the distance to be less than 1 upon n square. We want to have for every theta we would like to have rationals of the form p by q such that mod theta minus p by q is less than 1 upon q square we would like these rationals to come very close to our theta while keeping theta as small as possible. This is what we would want to do. So this and many other things will come in the next lecture so I hope to see you then. Thank you.