 Welcome back, we are looking at continued fractions and we would like to approximate every real number by continued fractions. But to begin with we were looking at towards the end of our last lecture, we were looking at approximating real numbers by means of rational numbers. Of course, we know that every rational is a continued fraction and so it is clear that every real number can be approximated by continued fractions. But what we would want to have is that the continued fractions that you get to approximate any real theta is obtained just by adding one last entry at each level. That is the expansion that is the limit of that is the sequence that we would like to construct to approximate any real theta. So we are not just looking at any set of any limit of continued fractions approximating a given real number theta but we would like to have this continued fractions to be related to each other in the sense that the nth continued fraction is obtained from the n minus 1 only by adding one last entry at the last level. So this is how we would want to do and as you see on the slide we would call such an expansion to be a continued fraction expansion of theta of course we still have to construct such an expansion. We still have to construct the sequence of continued fractions which converge to any given real number theta we would have for theta we would construct a sequence of continued fractions converging to theta in a very special way. So the sequence is going to be a very special sequence. But before that before even we go to the continued fraction expansion you all must have known that there is a decimal expansion for theta. Every real number has a decimal expansion what is a decimal expansion how do we define it let us spend some time and understand what the decimal expansion is this is something that we have been using right from our school and we found it very useful many times we find this decimal expansion quite useful especially when it is a finite decimal expansion. We need some notations so for any real number theta the square bracket theta is the greatest integer less than or equal to theta. So what we have is that this greatest integer theta has the property that it is less than or equal to theta and theta is strictly less than the greatest integer less equal theta plus 1. This is called floor function we also sometimes use this symbol to denote it there is another way which is called ceiling function which is the smallest integer less than or equal to theta smallest integer bigger than or equal to theta. So this will have the property that minus 1 is less than theta which is less than or equal to the ceiling function for theta whenever we have a list of marks obtained by our students and if the list involves some fractions in the end we convert every fraction to a full number. So we call it rounding up when you go to buy vegetables you do also rounding up but in the other direction if the bill comes out to be 503 you will simply say that Pansol alone. So that is the floor function that we are applying in some sense and when we round up the marks obtained by our students we take the ceiling function. So this is called the floor function and this is called the ceiling function. So these are two very important functions we are not going to discuss about the ceiling function at all in this course this is the only function that we are going to look at the floor function and our notation therefore is the square bracket theta. Remember it is the integer so you take all integers which are less than or equal to your theta and take the greatest one among them that is how we construct it. So let us look at some examples. If I have this 2.71828 if you remember this is the expansion for E the Euler number where it does not stop at the 8 that we have given but it goes beyond the floor function for this is equal to 2 because 2 is less than this number and 3 is not less than this number. So the greatest integer less than or equal to this quantity is 2. If you have your number to be 0.123 of course it is clear that the floor function now gives you the value 0. If you have an integer the floor function will return the same integer if the floor function of 2020 is 2020. A very important example coming up if you have the number minus 1.2 its floor function will give you minus 2 because minus 1 is not less than minus 1.2 minus 1 is bigger than minus 1.2. In fact if you plot them on the real line you will see that you have 0 then you go to left hand side you have minus 1 and then you go a little bit further 1 fifth of an integer and you will have minus of 1.2. So it is on the left hand side of your minus 1 therefore minus 1 is not less than that the greatest integer less than or equal to minus 1.2 is minus 2. So the floor function of minus 1.2 is minus 2 and finally the floor function of pi is 3. So remember that pi has this expansion 3.14 something something and therefore its floor function will give you the number 3. Now of course when you take any real number theta and look only at the floor functions applied to it then you have only integer and somehow you do not want to miss out on the information of theta. So we would also like to keep track of the fact the difference between your number theta and the floor function applied to theta and there is a notation for that this is denoted by curly bracket theta. By definition this is theta minus square bracket theta while talking we will call this to be the integral part of theta and this will be called the fractional part of theta. So for every real number we have these 2 things we have the integral part of theta which is an integer we have the fractional part of theta which is between 0 and 1 it can be 0 but it is not equal to 1 and your theta happens to be integral part of theta plus fractional part of theta. So these are functions and the integral part of theta fractional parts of theta so both these parts are uniquely determined by the given real number. So with this notations it is easy to describe the decimal expansion but I will not go into construction of these let me just tell you what we mean by decimal expansion. So decimal expansion of any real number theta is a sequence of integers a i which are sequence which are from 0 to 9 and with the property that summation a i 10 power minus i is theta. So where does this i here i should not be from 0 to 1 but it will be from some quantity onwards so i is going to be bigger than or equal to some minus n onwards. So we have this expansion which will be a minus n 10 power n plus a minus n minus 1 10 power n minus 1 plus dot dot dot plus a 0 into 10 power 0 which is just 1 plus a 1 into 10 power minus 1 plus dot dot dot this is our expression for theta. So for instance if you have the number 304.2397 this will be 3 into 10 power 2 plus 0 into 10 power 1 so I just ignore that 4 into 10 power 0 plus 2 into 10 power minus 1 plus 3 into 10 power minus 2 plus 9 into 10 power minus 3 plus 7 into 10 power minus 4 and we stop here because our number has a finite decimal expansion it is true that for any real n any real theta we would have such an expansion where your i will go up to infinity and this is again easy to construct because remember the sequence of rationals that we had constructed in last lecture. Here what we do is that you first of all look at the largest integer bigger less than or equal to your theta the integral part this integral part can be of course written as a sum of certain powers of 10 multiplied by some integers from 0 to 9 just as here in the example we have written 304 to be 3 into 100 plus 4 into 1 so once you do it for integer part now you have the remaining things so what we are doing is that we are constructing a sequence of rationals converging to your number theta in the following way we looked at the integer first that would give you that it is less than the distance between theta and your number is less than 1 then we would divide this in the interval the integral part of theta to integral part of theta plus 1 into 10 equal parts and we will see which of these so the interval of length 1 has now been divided into 10 sub intervals of length 1 upon 10 and your number theta has to belong to one such sub interval you take the beginning point the initial point of that sub interval here that sub interval would begin at 2 so from 304 to 305 we have exactly 10 parts the first one will begin at 304 next one begins at 304.1 the next one which begins at 304.2 that until 304.3 your number theta the number theta that we have here on in the slide belongs to that particular sub interval of length 1 by 10 then once you have found a sub interval of length 1 by 10 you divide that sub interval into 10 equal sub intervals that would give you the next decimal number in the expansion and so on so this is the way we would construct the expansion the sequence here the properties that the nth term of the sequence is less than or equal to your number theta by the distance at most equal to 1 upon 10 power n and as n goes to infinity this 1 upon 10 power n goes to 0 so you have that your sequence converges to the number theta so this is the decimal expansion that we have constructed we of course will take it for granted that such an expansion exists for every real number but note that we do not always have uniqueness of these decimal expansions there is this instance where 1 is equal to 0.999 and so on if you sum this up this is a geometric series and if you obtain the sum of this geometric series you will see that it is indeed equal to 1 so whenever you have a finite decimal expansion you have another decimal representation for the same number involving some sequence of integers ultimately ending with 9s so if you have the earlier example that we had taken if the last number was 3 then that 3 can be replaced by 2999999 so 0.3 is equal to 0.2999999 one way to understand this would be that the distance from 0.3 to 0.29 is 0.01 if you add one more 9 now the distance is 0.001 and you keep adding the 9s and your distance keeps reducing so when you go to infinity ultimately the distance goes to 0 so these two decimal expansions give you the same number now there are many differences between the decimal expansions and the continued fractions expansions that we are going to study so both have their applications the decimal expansions they seem quite useful in analysis for instance if you have seen the Cantor's proof which proves that the set of real numbers is uncountable this is called the diagonal argument of Cantor this proof uses decimal expansion on the other hand if we take the continued fraction expansions which we are going to study in this theme they seem more useful in arithmetic so as far as arithmetic is concerned we are going to see that continued fraction expansions are more useful this is something that we are going to see that the continued fraction expansions of real number of the given real number theta will provide good rational approximations so I told you in the last lecture that we are interested in finding p by q such that the distance of theta and p by q is less than 1 upon q square we are not happy with the distance being less than 1 upon q we want it to be less than 1 upon q square and we would call such rationales to give good approximation to theta and of course again there are many such approximations to theta which are good but if you impose one more condition then we will see later perhaps a few lectures later that the continued fraction expansions give you the only such nice approximations so this is something that we will see later but I must also tell you that there is this Brahmagupta pale equations which are x square minus n y square equal to 1 and you let n go to n vary over integers we are going to construct explicit solutions to such equations so the point is that n is given n is a fixed natural number and we consider the equation x square minus n y square equal to 1 and the question is to determine the set of integers x comma y satisfying this property if you look at rational numbers then this is some certain curve which we can easily draw if you are looking at real numbers then this is these are the points on some certain curve which we can easily draw but we are looking at integer solutions to this and so this is what is known as a Diphantine equation the solution to such equations forms the study of Diphantine equation which is initiated by the Greek mathematician Diphantas so this is an instance which we are going to study soon in our coming lectures but the point right now we want to understand is what is a good approximation and does there exist at least one such good approximation to a given real theta so that can be solved that has an affirmative answer by this theorem proved by the mathematician Dirichlet so let me recall the statement of the theorem let us understand the statement of the theorem we have a real number theta and we are looking at any integer bigger than 1 we fix any integer q bigger than 1 then we say that there are integers p comma q with the property that the denominator is less than q and this difference is at most 1 by capital Q this is the result that we want to prove so we want to say that there are these numbers p by q with the property that the denominator q I am calling q as the denominator and the reason for that will be clear very soon so this denominator is a positive quantity which is strictly between 0 and q and moreover mod q theta minus p is less than or equal to 1 upon capital Q the integer we started with so this proof involves one small trick consider the q plus 1 real numbers 0 1 fractional part of theta fractional part of 2 theta so on up to fractional part of q minus 1 into theta notice that these are indeed q plus 1 real numbers here we have first multiple of theta second multiple of theta until q minus 1 multiple of theta so these are q minus 1 numbers and we have 0 and 1 so once we add these we get q plus 1 numbers in all moreover these numbers are in the set 0 1 because we have observed that fractional parts of any real number is between 0 and 1 it is never equal to 1 but it is it can be equal to 0 so it is in closed 0 open 1 and here we have also taken 0 and 1 so we have these q plus 1 integers these q plus 1 real numbers and we will put them in these q sub intervals similar to what we had seen in the decimal expansion where we had divided each subsequent interval into 10 equal parts here we are dividing our interval 0 to 1 into q equal parts now we have q sub intervals and we have q plus 1 numbers and here is a principle which is often used in mathematics and therefore it has a name this is called pigeon hole principle which states that if you have n holes and there are n plus 1 pigeons sitting in these holes then at least one hole must contain two or more pigeons it is a very easy principle to prove but because it is used quite often it is convenient to have a name for that and simply say that we use the pigeon hole principle so here the pigeon hole principle will tell you that there will have to be at least two of these numbers that we have which will have to be in one such sub interval but those two numbers cannot be 0 and 1 because 0 is at one end and 1 is at another end so those two real numbers that you get at least one of them will have to be of the form in fractional part of m theta for some certain m so we then get not equal to n such that integral part of m theta minus fractional excuse me fractional part of m theta minus fractional part of n theta is less than or equal to 1 by q and if I now explain this notion the left hand side has notation fractional part which is nothing but m theta minus the integral part of n theta and then I have n theta minus the integral part of n theta which will now become plus this is less than 1 by q so we see that you have m minus n into theta minus some rational number let us call this rational some integer let us call that integer to be p and so we have this number here which is remember we had taken m and n from 1 to up to q minus 1 so the difference it could happen that your number that you had obtained is 0 or you may have the number that you had to be 1 and then another such number has to be some fractional part of m theta in that case m will be some number from 1 to q minus 1 if there is only one fractional part and one of the 0 and 1 you will have that the corresponding m is less than or equal to q minus 1 if you have both of those numbers to be fractional parts of m theta and n theta for different m and n then we of course know that their difference has to be again less than or equal to q so I will write it as q theta minus p to be less than or equal to 1 upon q so we have obtained our q to be some number which is less than or equal to q minus 1 which means that it is strictly less than the number capital q. So this is what we have obtained but how does it help us in getting a good approximation so let us see further this gives I will just divide by q throughout because q is strictly smaller than capital q 1 upon q is going to be strictly bigger than 1 upon capital q so hence we have obtained a rational number p by q for our real number theta satisfying this inequality. This is what we call to be a good approximation to our theta by a rational number what we have proved is that you choose any capital q for that capital q we have a good approximation where the denominator is strictly between 0 to capital q so we have a bounded denominator giving us a good approximation to our real theta. In fact, if you take this theta in fact you can choose p and q such that the integral the GCD of the p and q is 1 because if they had a GCD so if p comma q the GCD is d which is strictly bigger than 1 then mod q theta minus p which we know is less than or equal to 1 upon capital q the LHS would give you will take the GCD common and you will have q 1 theta minus p 1 less equal 1 by q which would give you mod of q 1 theta minus p 1 to be less than or equal to 1 upon d q which is of course less than 1 upon q. So, if you had a GCD non trivial GCD for p comma q you can cancel that GCD out and you have these numbers and of course we had our q to be less than small q was less than capital q and we would continue to have q 1 to also be less than capital q. So, we actually get once you have a pair of such integers p comma q giving you a good approximation you will be able to get the p and q where the GCD is 1 of course the rational number that you are going to get will be the same because p by q is now going to be equal to p 1 by q 1 but the important thing is that the denominator is further smaller. So, we are looking at smaller denominators giving you good approximations this is what we would want to do. In fact, if you have an irrational number then you have even a better such approximation. So, whatever we have proved so far for implies this corollary. So, for any real theta we have this rational number p by q with the property that the distance of theta and p by q is less than 1 upon q square and this q can in fact be chosen such that it is between 0 and capital q for any integer capital q bigger than 1 that you choose. So, the statement here given is a weaker statement we have actually proved something which is even stronger. Now, if you have an irrational number then there are infinitely many such good approximations on the other hand if your number happens to be a rational number then there are only finitely many such approximations. So, this dichotomy and further the study of continued fractions giving us such nice approximations and the remaining things will be done in the next lectures. See you then. Thank you very much.