* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download M3P14 LECTURE NOTES 11: CONTINUED FRACTIONS 1
List of important publications in mathematics wikipedia , lookup
Brouwer–Hilbert controversy wikipedia , lookup
Positional notation wikipedia , lookup
Infinitesimal wikipedia , lookup
Large numbers wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
Wiles's proof of Fermat's Last Theorem wikipedia , lookup
Vincent's theorem wikipedia , lookup
Hyperreal number wikipedia , lookup
Quadratic reciprocity wikipedia , lookup
Series (mathematics) wikipedia , lookup
Non-standard calculus wikipedia , lookup
Mathematical proof wikipedia , lookup
Georg Cantor's first set theory article wikipedia , lookup
Factorization wikipedia , lookup
Real number wikipedia , lookup
Collatz conjecture wikipedia , lookup
Division by zero wikipedia , lookup
Fundamental theorem of algebra wikipedia , lookup
Continued fraction wikipedia , lookup
M3P14 LECTURE NOTES 11: CONTINUED FRACTIONS 1. Rational Continued Fractions Given a rational number pq , we can write pq = a0 + r0 , where a0 is an integer and 0 ≤ r0 < 1 is between 0 and 1. If r0 is not zero, then we can write r10 = a1 + r1 , with a1 and integer and 0 ≤ r1 < 1. We then have: p 1 . = a0 + r0 = a0 + q a1 + r1 Continuing in this way, as long as ri is nonzero we set r1i = ai+1 + ri+1 , with ai an integer and 0 ≤ ri+1 < 1. The denominators of the ri are strictly decreasing, so eventually some rn = 0 and we have: p 1 . = a0 + 1 q a1 + a +···+ 1 2 an This expression is called the continued fraction expansion of pq . It is closely related to Euclid’s algorithm; indeed, it’s not hard to see that the ai are the quotients qi from Euclid’s algorithm applied to the pair p, q. Note that each ai is an integer and for i ≥ 1, ai ≥ 1. 2. Infinite Continued Fractions Now let α be an irrational real number. As above, we can write α = a0 + r0 , where a0 is an integer and 0 ≤ r0 < 1, and then for each i set 1 ri = ai+1 + ri+1 with ai+1 an integer and 0 ≤ ri+1 < 1. Note that unlike in the rational case, this sequence will never terminate, as ri is always irrational and thus never zero. We write: 1 α = a0 + 1 a1 + a2 +... and call this the continued fraction expansion of α. Note that so far this is just a formal expression! In fact, we can make mathematical sense of this expression, but it requires some justification. First, we introduce some useful notation: For a0 , . . . an real numbers, we define [a0 ; a1 , . . . , an ] to be the real number: a0 + 1 a1 + 1 a2 +···+ a1 n when this expression is well-defined (that is, when it does not involve a division by zero.) 1 2 M3P14 LECTURE NOTES 11: CONTINUED FRACTIONS The value of this expression can computed by a recurrence relation, as follows: Lemma 2.1. Given a0 , . . . , an real numbers, define pi , qi for 0 ≤ i ≤ n by p0 = a0 , q0 = 1, p1 = a0 a1 + a, q1 = a1 , together with the recurrences: pi = ai pi−1 + pi−2 qi = ai qi−1 + qi−2 . Then [a0 ; a1 , . . . , an ] = pn qn , assuming no qi is zero. Proof. We prove this by induction on n; the cases n = 0 and n = 1 are clear. Let p0i and qi0 be the numbers defined by the recurrence attached to the sequence a0 , a1 , . . . , an−2 , an−1 + a1n . The induction hypothesis tells us that [a0 ; a1 , . . . , an−2 , an−1 + 1 an ] = and q 0 , we have p0n−1 . 0 qn−1 By the recurrence defining the p0 (an−1 + a1n )p0n−2 + p0n−3 p0n−1 = 0 0 0 qn−1 + qn−3 (an−1 + a1n )qn−2 Since the sequences defining p0i ,qi0 and pi ,qi agree for i ≤ n − 2, the latter is equal to: (an−1 + a1n )pn−2 + pn−3 . (an−1 + a1n )qn−2 + qn−3 Multiplying both numerator and denominator by an , and using pn−1 = an−1 pn−2 + pn−3 , pn = an pn−1 + pn−2 (and similarly for qn ) we find that this expression is equal to pqnn . Thus we have: pn 1 [a0 ; a1 , . . . , an ] = [a0 ; a1 , . . . , an−2 , an−1 + ] = an qn as claimed. Note that if ai ≥ 1 for all i (as will be the case, for instance, if the ai come from taking a continued fraction expansion of some real number), then the qi are all nonzero and form a strictly increasing sequence. (Indeed, if all ai are at least one, then qi ≥ qi−1 + qi−2 ≥ 2qi−2 , so this sequence increases exponentially fast.) Now suppose we have an infinite sequence a0 , a1 , a2 , . . . , of real numbers, and assume that ai ≥ 1 for i ≥ 1. Define pi and qi by the recurrence given above. We call pqii the ith convergent to the continued fraction: a0 + 1 a1 + 1 a2 +... . Lemma 2.2. We have pn qn−1 − qn pn−1 = (−1)n−1 . M3P14 LECTURE NOTES 11: CONTINUED FRACTIONS 3 Proof. This is again by induction on n; the base case n = 1 is clear. Assume this is true for n − 1. Then by the defining recurrence for the pi and qi , we have: pn qn−1 −qn pn−1 = (an pn−1 +pn−2 )qn−1 −(an qn−1 +qn−2 )pn−1 = pn−2 qn−1 −qn−2 pn−1 = −(−1)n−2 and the claim follows. n−1 It follows that | pqnn − pqn−1 | < qn q1n−1 . Since the qn increase exponentially, pi it follows that the qi form a Cauchy sequence, and hence converge to a real number. A natural question to ask at this point is: “if the sequence a0 , a1 , . . . arises from the continued fraction expansion of an irrational number α, is the limit of the convergents pqnn equal to α?”. This is indeed the case: Lemma 2.3. Let α be an irrational real number, and let a0 , a1 , . . . be the sequence of integers arising from its continued fraction expansion. Let pqnn be the nth convergent. Then pqnn < α if n is even, and pqnn > α if n is odd. Proof. Once again we use induction on n; the case n = 0 is clear. Note that 1 [a1 ; a2 , . . . , an ] is the (n − 1)st convergent to α−a . Thus, by the induction 0 hypothesis, if n is odd we have: 1 [a1 ; a2 , . . . , an ] < α − a0 and thus 1 = [a0 ; a1 , a2 , . . . , an ]. α < a0 + [a1 ; a2 . . . , an ] If n is even the same argument works with the inequalities reversed. Corollary 2.4. Let α be an irrational real number, and let a0 , a1 , . . . be the sequence of integers arising from its continued fraction expansion. Let pqnn be the nth convergent. Then |α − pqnn | < qn q1n+1 . In particular the limit pqnn as n approaches infinity is α. Proof. Since exactly one of |α − pn qn and pn+1 qn+1 is less than α, we have pn pn+1 pn 1 |<| − |= . qn qn+1 qn qn qn+1 Since the qn increase exponentially quickly the second claim is clear. Note that since qn q1n+1 < q12 , this gives a second, completely constructive n proof of Dirichlet’s theorem on rational approximations! 3. Best Approximations In fact, there is a sense in which the convergents to the continued fraction expansion of α are the best rational approximations to α. We will make this precise below. 4 M3P14 LECTURE NOTES 11: CONTINUED FRACTIONS Fix α real and irrational, and as above define ai and ri by setting α = a0 + r0 , with a0 an integer and 0 ≤ r0 < 1, and r1i = ai+1 + ri+1 with ai+1 an integer and 0 ≤ ri+1 < 1. Define pn and qn from the sequence a0 , a1 , . . . by the recurrences of the previous section. Lemma 3.1. For all n, we have: α= pn + pn−1 rn . qn + qn−1 rn Proof. For n = 1 this is easy. Assume it is true for n − 1; that is, that we have: pn−1 + pn−2 rn−1 α= . qn−1 + qn−2 rn−1 1 1 We have rn−1 = an + rn ; substituting an +r for rn−1 in the above and using n the relations pn = an pn−1 + pn−2 , qn = an qn−1 + qn−2 yields the claimed result. Corollary 3.2. For all n, |α − pn qn | < |α − pn−1 qn−1 |. Proof. We have: | Substituting α = α− α− pn qn pn−1 qn−1 pn +pn−1 rn qn +qn−1 rn , |= qn α − p n qn−1 | |. qn qn−1 α − pn−1 we find that the right hand side is equal to: n−1 rn qn pqnn +p qn−1 +qn−1 rn − pn | |. n−1 rn qn qn−1 pqn +p − pn−1 n +qn−1 rn Simplifying, we find that this is equal to: qn−1 qn pn−1 rn − pn qn−1 rn qn−1 | |= rn < 1. qn qn−1 pn − pn−1 qn qn The claim follows. Theorem 3.3. Let h, k be integers with |k| ≤ qn . Then | hk − α| ≥ | pqnn − α|. In other words, pqnn is the best rational approximation to α with denominator at most qn . Proof. Suppose that | hk − α| < | pqnn − α|. Then by the corollary we also have n−1 | hk − α| < | pqn−1 − α|. Suppose that n is even. Then we have: pn pn−1 <α< , qn qn−1 and our inequalities then imply that we also have pn h pn−1 < < . qn k qn−1 M3P14 LECTURE NOTES 11: CONTINUED FRACTIONS 5 If n is odd the same holds with the inequalities reversed, by a similar argument. Either way we have h pn−1 pn pn−1 1 | − |<| − = . k qn−1 qn qn−1 qn qn−1 On the other hand, the left hand side of this is a positive rational number 1 with denominator kqn−1 , so must be at least kqn−1 . This is a contradiction since k ≤ qn . 4. Periodic Continued Fractions In this section we single out certain irrationals with particularly nice continued fraction expansions: Definition 4.1. The continued fraction expansion [a0 ; a1 , a2 , . . . ] of an irrational number α is eventually periodic if there exist positive integers N and d such that an = an+d for all n ≥ N . It is periodic if there exists a positive integer d such that an = an+d for all n. Definition 4.2. An irrational number α is a quadratic irrational if there is a polynomial ax2 + bx + c, with a, b, c integers, that has α as a root. We then have: Proposition 4.3. Suppose that α has an eventually periodic continued fraction expansion. Then α is a quadratic irrational. Proof. We first show this when α is periodic. We then have a d such that 1 . α = a0 + a1 + a +···+1 1 2 1 ad−1 + α Simplifying the right hand side, we find integers x, y, z, w such that xα + y α= . zα + w Then zα2 + (w − x)α − y = 0; since α is irrational z cannot be zero, so α is a quadratic irrational. If α is only eventually periodic there is a β with periodic continued fraction expansion such that we have: 1 . α = a0 + a1 + a +···+ 1 1 2 aN −1 + 1 β Then β is quadratic irrational. It thus suffices to show that if β is quadratic irrational, so is β1 and n + β for integer n. Note that if β is a root of ax2 + bx + c, then β1 is a root of a + bx + cx2 , and n + β is a root of a(x − n)2 + b(x − n) + c, so these claims are clear. In fact, all quadratic irrationals have eventually periodic continued fraction expansions, but we will not prove this.