Académique Documents
Professionnel Documents
Culture Documents
UNIT 5
1. Introduction
CONTINUED FRACTIONS
and 4 +
3+
1 1 2+ 1 1
In this unit, we shall see how a number could be changed to a continued fraction and how this method is related to the Euclidean algorithm we learnt in Unit 1. Furthermore, we will look into some properties of continued fractions.
2. Definitions
where ai > 0 for all i > 0 and a0 0 . If the series a1 , , an is finite, the above representation of x is called a finite continued fraction. If the series is not finite, it is called an infinite continued fraction. We denote the continued fraction by [a0 , a1 , K , an ] for a finite continued fraction and [a0 , a1 , K , an , K] for an infinite continued fraction.
Illustration:
1+
1 1 2+ 1 3
Page 1 of 11
Mathematical Database
1+ 2+
1 1 2+ 1 2+ 1 O
Before we proceed to the relationship between Euclidean algorithm and continued fractions, let us look at the following example.
and
11 8
Solution.
7 1 1 1 1 1 1 = 0+ = 0+ = 0+ = 0+ = 0+ = 0+ 11 4 1 1 1 1 11 1+ 1+ 1+ 1+ 1+ 7 3 1 1 7 7 1+ 1+ 1+ 4 1 4 4 1+ 3 3
7 = [0, 1, 1, 1, 3] . 11
11 3 1 1 1 1 = 1+ = 1+ = 1+ = 1+ = 1+ = [1, 2, 1, 2] . 8 2 1 1 8 8 2+ 2+ 2+ 3 1 3 3 1+ 2 2
As you may notice, the process of finding the continued fraction involves dividing the denominator by the numerator and after taking the quotient, the numerator becomes the denominator in the next step.
This is the idea of Euclidean algorithm, which has been discussed as Theorem 2.3 of Unit 1. It is stated below for reference.
Page 2 of 11
Mathematical Database
Theorem 3.1. (Euclidean algorithm) Let a and b be positive integers, a > b. Then we apply a series of divisions as follows. a = bq0 + r1 b = r1q1 + r2 r1 = r2 q2 + r3 M rn 2 = rn 1qn 1 + rn rn 1 = rn qn + rn +1 0 < r1 < b 0 < r2 < r1 0 < r3 < r2 M 0 < rn < rn1
The process of division comes to an end when rn +1 = 0 . The integer rn is the G.C.D. of a and b.
Page 3 of 11
Mathematical Database
Definition 4.1. Let x = [q0 , q1 , K , qn ] be the continued fraction representation of a rational number x. The integers q0 , q1 , , qn are called the partial quotients of x. The fractions
0 = [q0 ] = q0 , 1 = [q0 , q1 ] = q0 +
1 1 , 2 = [q0 , q1 , q2 ] = q0 + 1 q1 q1 + q2 1 , , n = [q0 , q1 , K , qn ] = q0 + 1 q1 + 1 q2 + 1 O+ 1 qn 1 + qn
1 1 3
1+
0 = 0 , 1 = 0 + = 1 , 2 = 0 +
1 1
1 1 2 , 3 = 0 + = 1 2 1 3 1+ 1+ 1 1 1+ 1 1 7 and 4 = 0 + = . 1 11 1+ 1 1+ 1 1+ 3 =
Theorem 4.1. Let x = [q0 , q1 , K , qn ] be a rational number with the i-th convergent i = [q0 , q1 , K , qi ] . Let P1 = 1 , P0 = q0 , Q1 = 0 , Q0 = 1 and define Pk = qk Pk 1 + Pk 2 and Qk = qk Qk 1 + Qk 2 for k > 0 . Then for
0in,
Pi Qi
= i .
Page 4 of 11
Mathematical Database
Pi Proof. We shall prove this theorem by mathematical induction. Let S (i ) be the statement Q = i i
P0 Q0
.
q1q0 +1 q1 1+ 0
For i = 1 , we have 1 = [q0 , q1 ] = q0 + q11 = Thus S (0) and S (1) are both true.
q1 P0 + P1 q1Q0 + Q1
P 1 Q1
Pk Qk
qk Pk 1 + Pk 2 qk Qk 1 + Qk 2
k +1 = [q0 , q1 , K , qk , qk +1 ] = q0 +
1 q1 + 1 O+ 1 qk + 1 qk +1
1 qk + Pk 1 + Pk 2 qk +1 1 = q0 , q1 , K , qk + = q + k 1 q + 1 Q + Q k k 1 k 2 qk +1 (q q + 1) Pk 1 + qk +1 Pk 2 q (q P + Pk 2 ) + Pk 1 = k k +1 = k +1 k k 1 (qk qk +1 + 1)Qk 1 + qk +1Qk 2 qk +1 (qk Qk 1 + Qk 2 ) + Qk 1 = Thus S (k + 1) is also true. This completes the induction. Q.E.D. qk +1 Pk + Pk 1 . qk +1Qk + Qk 1
With the above convergents, we can compute the continued fraction in the form of a table.
n qk Pk Qk
0 q0
1 q1 P 1 Q1
n1 qn 1 Pn 1 Qn 1
n qn Pn Qn
1 0
P0 1
Page 5 of 11
Mathematical Database
Example 4.1. Find the continued fraction and the convergents for
81 . 35
n qk Pk Qk
0 2
1 3 7 3
2 5 37 16
3 2 81 35
1 0
2 1
2 7 37 81 , , and . 1 3 16 35
Theorem 4.2. For k > 0 , the difference between consecutive convergents is k k 1 = (1) k 1 . Qk Qk 1
Pk Qk
Pk 1 Q = k 1
Pk Qk 1 Pk 1Qk Qk Qk 1
hk Qk Qk 1
, where hk = Pk Qk 1 Pk 1Qk .
Page 6 of 11
Mathematical Database
hk = Pk Qk 1 Pk 1Qk = (qk Pk 1 + Pk 2 )Qk 1 Pk 1 (qk Qk 1 + Qk 2 ) = Pk 2Qk 1 Pk 1Qk 2 = hk 1. Thus hk = (1) k h0 and we have h0 = P0Q1 P1Q0 = 1 and so hk = (1) k 1 . Finally, k k 1 = hk (1)k 1 = . Qk Qk 1 Qk Qk 1 Q.E.D.
k < x k > x
if k is even if k is odd
Corollary 4.4.
1 Let x = [q0 , q1 , K , qn ] . Then | k x | Qk Q for k > 0 . k 1
Note that since Pk Qk 1 Qk Pk 1 = hk = (1) k , ( Pk , Qk ) = 1 and hence the convergent lowest term.
Pk Qk
is in the
Theorem 4.5.
Proof. We have
Page 7 of 11
Mathematical Database
x = [q0 , q1 , K , qk 1 , qk , K , qn ] = q0 + 1 q1 + 1
O+
1 qk 1 + 1 qk + 1
O+
1 qn
= q0 +
1 q1 + 1
O+
1 qk 1 + 1 y
where
y = qk + 1 1 O+ qn
= [q0 , q1 , K , qk 1 , y ] = 1 1 y
yPk 1 + Pk 2 yQk 1 + Qk 2
qk 1 +
Pk 2 Qk 2
It has been shown that a rational number x can be expressed as a finite continued fraction and it is obvious that a finite continued fraction is a rational number. For irrational numbers, the idea of
Page 8 of 11
Mathematical Database
taking quotients can be applied and we would get an infinite continued fraction. In this section, we will see some properties of such continued fractions.
Let x = [q0 , q1 , K] be an infinite continued fraction. Then Theorem 4.5 also holds. As k , Qk as well and hence we have P P lim k k 1 = 0 . k Q k Qk 1 Also, from Corollary 4.3 and 4.4, it can be shown that
k P0 Q0
<
P2 Q2
<
P4 Q4
< L and
P 1 Q1
>
P3 Q3
>
P5 Q5
>L
Furthermore, Corollary 4.4 holds for infinite continued fraction and we can use this for writing the first few convergents of an irrational number, as well as convergents to a certain degree of accuracy. Below is an example.
Example 5.1.
Find a convergent of
Solution.
We first find the convergents of the approximate value of the required accuracy.
Page 9 of 11
Mathematical Database
0 1
1 2 3 2
2 2 7 5
3 2 17 12
4 2 41 29 and 5 =
5 2 99 70
1 0
1 1
41 29
99 70
Now we are going to show that indeed of the required accuracy. Corollary 4.4 also applies to infinite continued fractions (try to prove this yourself!) and thus for 1 k > 0 , | k x | Qk Q . k 1 Putting k = 5 , we get | 5 2 |
1 2970
< 0.001 .
6. Exercises
1. 2. Convert
14 17
and
28 9
Suppose a and b are two relatively prime positive integers. Convert 2a 2 b + a 2 + ab + 2a + 1 2ab + a + 2 into its continued fraction.
3.
Prove that there exists a unique representation for any positive rational number in the form of a continued fraction.
4.
16 27
5.
6.
(a) Determine an integer n for which the n th convergent of x = 0.5 + 7 approximates x with a maximum error of 0.005. (b) For the number n found in part (a), compute the n th convergent of x.
Page 10 of 11
Mathematical Database
7.
1 1 2+ 2 +L
= [ 2, 2, 2, ...] .
Page 11 of 11