Module 6 - CLSU Open University

advertisement
MODULE
6
Continued Fractions
INTRODUCTION
Number has many tools but probably none is more fascinating or
elegant than continued fractions. It was once said that God invented the
integers and man invented everything else. It might be added God
probably invented continued fractions as well. Continued fractions were
developed in part as a response to a need to approximate irrational
number. Irrational numbers are numbers that cannot be written as a
quotient or ratio of two integers.
OBJECTIVES:
At the end of this chapter, you should be able to:
1. express rational numbers as finite continued fractions;
2. determine the rational number represented by the simple
continued fraction;
3. compute the convergents of a simple continued fraction;
4. determine the infinite continued of irrational numbers; and
5. find a rational number that will approximate irrational number
with accuracy to four decimal places.
6.1 FINITE CONTINUED FRACTIONS
Any positive rational number can be written as a finite continued
fraction. Recall the Euclid’s algorithm from Chapter 2 for finding the
GCD(Greatest Common Divisor). The methodology is identical for finding
68
the continued fraction representation of a rational number. For example,
finding the greatest common divisor of 13,020 and 5,797 using Euclid’s
algorithm, we have
13,020 = 5,797(2) + 1,426
5,797 = 1,426(4) + 93
1,426 = 93(15) + 31
93 = 31(3) + 0
We see that the GCD(13020, 5797) = 31. But our goal now is not to
find the greatest common divisor but to find the continued fraction
representation. Suppose we want to find the continued fraction for the
rational number 13,020/5797. Paraphrasing Euclid’s algorithm we get
13,020
1,426
=2+
5,797
5,797
In mathematics, s finite continued fraction is a fraction of the form
a0 +
1
a1 +
1
a2 +
1
a3 +
1



1
an−1 +
1
an
where a0 is an integer and all other numbers ai ( i  0) are positive
integers. The numbers a1, a2, a3,. . . an are the partial denominators of this
fraction. Such fraction is called a simple continued fraction if all a i are
integers.
69
The theory of continued fractions begin with Rafael Bombelli. He
attempted to find the square roots by means of infinite continued
fractions, a method both ingenious and novel. He essentially proved that
√13 could be expressed as the continued fraction
√13 = 3 +
4
4
6+
6+
6+
4
4
6+ …
Something to remember:
The value of any finite continued fraction will always be a rational
number.
Example: The continued fraction
5+
1
1+
1
2+
1
1+
1
3
can be condensed to the value 86/15.
5+
1
1+
1
2+
=
1
1+
5+
1
1+
1
3
= 5+
70
1
2+
1
1+
1
2+
3
4
1
4
3
= 5+
= 5+
=5+
=5+
=
5+
1
1+
1
2+
=
1
1+
1
1+
1
11
4
1
1+
4
11
1
15
11
11
15
75 + 11
15
86
15
1
3
Theorem 6-1
Any rational number can be written as a finite simple continued
fraction.
Proof:
Let a/b, where b > 0 be any rational number. Euclid’s algorithm for
finding the greatest common divisor of a and b and gives the equation:
a = ba0 + r1
0 < r1 < b
b = r 1a1 + r 2
0 < r2 < b
71
r1 = r 2 a 2 + r 3
0 < r3 < b



rn - 2 = rn - 1an - 1 + rn
0 < rn < rn -1
rn - 1 = rn an + 0
Notice that each remainder rk is a positive integer, a1, a2 . . . an are
all positive. Rewrite the equations of the algorithm in the following
manner.
a/b
= a0 + r1/b
=
a0 + 1 / (b/r1)
b/r1
= a1 + r2/r1
=
a1 + 1 / (r1/r2)
r1/r2
= a2 + r3/r1
=
a2 + 1 / (r1/r3)
rn - 1/rn = an
If we use the second of these equations to eliminate b/r1 from the
first equation, then,
a⁄ = a
0
b
1
1
= a0 +
1
b
a1 + r
( )
r1
( 1)
r2
In this result, substitute the value of r1/r2 as given in the third
equation:
a⁄ = a +
0
b
1
a1 +
72
1
1
a2 + r
( 2)
r3
Continuing in this way, we can go on to get
a⁄ = a +
0
b
1
a1 +
1
a2 +
1
a3 +



=
1
an−1 +
1
an
To illustrate the procedure involved, let us represent 19/51 as a
continued fraction. An application of Euclid’s algorithm to the integers 19
and 51 gives the equations.
51 = 19(2) + 13 or
51/19 = 2 + 13/19
19 = 13(1) + 6 or
19/13 = 1 + 6/13
13 = 6(2) + 1
or
6 = 6(1) + 0
or
13/6 = 2 + 1/6
6/6 = 1
Making the appropriate substitutions, it is seen that
1
19⁄
=
51
51
( )
19
=
=
1
2+
13
19
1
2+
73
1
19
13
1
=
2+
19⁄
51 =
1+
6
13
1
=
=
1
1
2+
1+
6
13
1
2+
1
1+
1
13
6
1
2+
1
1+
1
2+
1
6
which is the continued fraction expansion for 19/51.
Since continued fractions are cumbersome to print or write, we
adopt the convention of denoting a continued fraction by a symbol which
displays its partial quotients; say, by the symbol [ a0; a1, a2, . . . an ].
Using this notation, the expansion for 19/51 is indicated by [ 0; 2, 1, 2,
6 ].
Something to remember:
The initial integer in the symbol [ a0; a1, a2, . . . an ] will be zero
when the value of the fraction is positive but less than 1.
The representation of a rational number as a finite simple continued
fraction is not unique; once the representation has been obtained, we can
always modify the last term. For, if an > 1, then
an = ( an – 1) + 1 = ( an – 1) + 1/1
where an – 1 is a positive integer, hence
[ a0; a1, a2, . . . an ] = [ a0; a1, a2, . . . an – 1, 1 ]
74
Every rational number has two representations as a simple
continued fraction, one with an even number of partial denominators and
one with an odd number. In the case of 19/51,
19/51 = [ 0; 2, 1, 2, 6 ] = [ 0; 2, 1, 2, 5, 1 ]
The continued fraction made from [ a0; a1, a2, . . . an ] by cutting
off the expansion after the kth partial denominator ak is called the kth
convergent of the given continued fraction and denoted by Ck, ; in symbols
(1≤ k n)
Ck = [ a0, a1, a2, . . . ak ]
We let the zero’th convergent C0 be equal to the number a0.
A point worth calling attention to is that for k < n if ak is replaced by
the value ak + 1/ak +1, then the convergent Ck becomes the convergent
Ck + 1.
[ a0, a1, a2, . . . . ak – 1, ak, ak + 1 ] = C
k+1
It hardly needs remarking that the last convergent Cn, always equals
the rational number represented by the original continued fraction.
Going back to our example 19/51 = [ 0; 2, 1, 2, 6 ], the successive
convergents are
C0 = 0
C1 = [ 0; 2 ] = 0 + 1/2 = 1/2
C2 = [0; 2, 1] = 0 +
1
2+
C3 = [0; 2, 1, 2] = 0 +
1
1
=
1
3
1
2+
1
1+
=
1
2
3
8
C4 = [0; 2, 1, 2, 6] = 19/51.
Except for the last convergent C4, these are alternately less than or
greater than 19/51, each convergent being closer to 19/51 than the
previous one.
75
Much of the labor in calculating the convergents of a finite continued
fraction [ a0; a1, a2, . . . an ] can be avoided by establishing formulas for
their numerators and denominators. To this end, let us define numbers p k
and qk ( k = 0, 1, 2, 3, . . . n) as follows:
p0 = a 0
q0 = 1
p1 = a1a0 + 1
q1 = a 1
pk = ak pk-1 + pk -2
qk = ak qk-1 + qk-2
for k = 2, 3, 4, . . . n
A direct computation shows that the first few convergents of [ a 0;
a1, a2, . . . an ] are
C0 = a 0 =
C1 = a 0 +
C2 = a 0 +
p
a0
= 0
1
q0
a1 a0 + 1
p
1
=
= 1
a1
a1
q1
1
a1 +
1
a2
=
a2 (a1 a + 1) + a0
0
a2 a1 + 1
=
p2
q2
Theorem 6-2
The kth convergent of the simply continued fraction [ a0; a1, a2, . . .
an ] has the value Ck = pk/qk ( 0  k ≤ n )
76
Example:
19/51 = [ 0; 2, 1, 2, 6 ]
p0 = 0
q0 = 1
p1 = 0(2) + 1 = 1
q1 = 2
p2 = 1(1) + 0 = 1
q2 = 1(2) + 1 = 3
p3 = 2(1) + 1 = 3
q3 = 2(3) + 2 = 8
p4 = 6(3) + 1 = 19
q4 = 6(8) + 3 = 51
This says that the convergents of [ 0; 2, 1, 2, 6 ]
C0 = p0/q0 = 0/1 = 0
C1 = p1/q1 = 1/2
C2 = p2/q2 = 1/3
C3 = p3/q3 = 3/8
C4 = p4/q4 = 19/51
SCQ1:
a. Express 179/127 as a continued fraction with 6 terms.
b. Express 179/127 as a continued fraction with 7 terms.
77
Activity 6.1
1. Express each of the following rational numbers a finite simple continued
fraction.
a) 71/55
c) -19/51
b) 187/57
d) – 234/77
2. Determine the rational numbers represented by the following simple
continued fraction.
a) [ 4; 2, 1, 3, 1, 2, 4 ]
b) [ -2; 2, 4, 6, 8 ]
3. Represent the following simple continued fractions in an equivalent
form, but with an odd number of partial denominators.
a) [ 0, 3, 1, 2, 3]
b) [ -1, 2, 1, 6, 1 ]
4. Compute the convergents of the following simple continued fractions.
a) [ 0; 2, 4, 1, 8, 2]
b) [ -3; 1, 1, 1, 1, 3 ]
78
6.2 INFINITE CONTINUED FRACTION
Every infinite continued fraction is irrational and every irrational
number can be represented in precisely one way as an infinite continued
fraction. An infinite continued fraction representation for an irrational
number is mainly useful because its initial segments provide excellent
rational approximations to the number. These rational numbers are called
the convergents of the continued fraction. Even-numbered convergents
are smaller than the original number, while odd-numbered ones are
bigger.
An infinite continued fraction is an expression of the form
a0 +
b1
a1 +
b2
b3
a3 + …
a2 +
where a0, a1, a2 . . . and b1, b2, b3 . . . are real numbers.
An example of this type is found in the work of William Brouncker
who converted (in 1655) Wallis famous infinite product
4 3 .3 .5 .5 .7 .7 …
=
π
2 . 4 . 4 . 6. 6 . 8 …
4
=1+
π
1
2
3
2 +
2+
2
52
72
2 +
2+ …
Theorem 6-3
Every irrational number has a unique representation as an infinite
continued fraction.
79
Example 1. Find the continued fraction expansion of √23 .
Solution:
Consider x = √23  4.8
The successive irrational numbers xk ( and therefore the integers ak
= [ xk ] ) can be computed rather easily with the calculations as follows.
x0 = √23 = 4 + ( √23 − 4)
a0 = 1
x1 =
1
1
√23 + 4
√23 − 3
=
=
=1+
x0 – [ x0 ]
7
7
√23 − 4
a1 = 1
x2 =
1
7
√23 + 3
√23 − 3
=
=
=3+
x1 – [ x1 ]
2
2
√23 − 3
a2 = 3
x3 =
1
2
√23 + 3
√23 − 4
=
=
=1+
x2 – [ x2 ]
7
7
√23 − 3
a3 = 1
x4 =
1
7
=
= √23 + 4 = 8 + (√23 − 4)
x3 – [ x3 ]
√23 − 4
a4 = 8
Since x5 = x1 also x6 = x2, x7 = x3, x8 = x4 ; then we get x9 = x5,=
x1, and so on, which means that the block of integers 1, 3, 1, 8 repeats
indefinitely. We find that the continued fraction expansion of √23 is
periodic with the form
√23 = [ 4; 1, 3, 1, 8, 3, 1, 8, . . . ] = [ 4, 1, 3, 1, 8 ]
80
Example 2.
Determine several convergents of the continued fraction of the
number
 = 3.141592653 . . .
Solution:
x0 = π = 3 + ( π − 3)
1
1
=
= 7.06251330 …
x0 – [ x0 ]
0.14159265 …
a1 = 7
1
1
=
= 15.99659440 …
x1 – [ x1 ]
0.06251330 …
a2 = 15
1
1
=
= 1.00341723 …
x2 – [ x2 ]
0.99659440 …
a3 = 1
x1 =
x2 =
x3 =
x4 =
a0 = 3
1
1
=
= 292.63724 …
x3 – [ x3 ]
0.00341723 …
a4 = 292
Thus, the infinite continued fraction for  starts out as  = [3; 7, 15,
1, 292 . . .]
SCQ2:
Write √3 and - √3 as infinite simple continued fractions.
81
Activity 6.2
1. Evaluate each of the following infinite simple continued fractions.
a. [ 2; 3 ]
d. [ 2; 1, 2, 1 ]
b. [ 1; 2, 1 ]
e. [1; 2, 1, 2, 12 ]
b. [ 1; 2, 3, 1 ]
2. Determine the infinite continued fraction representation of each
irrational number.
a. √7
c.
b. √5
d.
82
5+ √37
4
1 + √13
2
Download