You are on page 1of 11

Chapter 15: Continued Fractions Chapter 15: Continued Fractions SECTION A Finite Continued Fractions By the end of this

section you will be able to understand what is meant by an Egyptian fraction convert a rational number into a continued fraction understand an application of continued fractions

A1 Egyptian Fractions Egyptian civilization only used what we call unit fractions, that is fractions with a numerator 3 of 1. For example in Egyptian fractions would be written as 4 3 1 1 = + 4 2 4 They also did not allow repetition of fractions. For example they could not write 3 1 1 1 = + + 10 10 10 10 3 How can we write as a sum of unit distinct fractions? 10 3 1 1 = + 10 4 20 Similarly we can convert other fractions into distinct unit fractions: 11 1 1 = + 30 5 6 71 1 1 1 = + + 105 3 5 7 Why use Egyptian fractions? It makes comparing fractions a lot easier. In the above example we can say 11 71 is less than 30 105 Another example 3 1 1 = + 10 4 20 7 1 1 1 = + + 15 4 5 60 7 3 Clearly is greater than . We dont have to convert them to a common denominator in 15 10 order to answer the question which fraction is greater. A2 Introduction to Continued Fractions We can write the improper fraction 52 7 as 5 + 9 9 We need the numerator to be 1 and not 7. How can we do this?

Chapter 15: Continued Fractions 7 that is 9 5+ 7 1 = 5+ 9 9 7

Invert

9 2 is an improper fraction. We can write this as 1 + : 7 7 52 7 = 5+ 9 9 1 1 = 5+ = 5+ 9 2 1+ 7 7 We continue in this manner with only using unit fractions and avoiding improper fractions: 52 7 = 5+ 9 9 1 1 1 1 = 5+ = 5+ = 5+ = 5+ 9 2 1 1 1+ 1+ 1+ 7 1 7 7 3+ 2 2 1 5+ 52 1 1+ We can write the rational number as . The last term is an example of a 1 9 3+ 2 continued fraction. Note that all the numerators have a value of 1. 1 5+ 1 1+ There is a more compact way of writing this continued fraction, . Since all the 1 3+ 2 numerators are 1 we ignore these and write the remaining numbers in order within brackets: 52 1 = 5+ = [5; 1, 3, 2] 1 9 1+ 1 3+ 2 We can convert any fraction into a continued fraction. The semicolon ; next to the 5 means 52 52 that this is the integer part of or = 5 . 9 9 29 52 Which is bigger or ? 5 9 29 = [5; 1, 3, 1] . Hence Well the continued fraction for 5 29 52 is greater than 5 9 Example 1 69 Convert into a continued fraction. 11 But now

Chapter 15: Continued Fractions Solution 69 is an improper fraction. Therefore 11 69 3 = 6+ 11 11 Remember for a continued fraction all the numerators must be 1. Inverting the last fraction and evaluating the remaining fractions: 69 3 1 = 6+ = 6+ 11 11 11 3 1 11 2 = 6+ Writing 3 = 3 + 3 2 3+ 3 1 2 1 = 6+ Writing 3 = 3 / 2 1 3+ 3 2 1 3 1 = 6+ Writing 2 = 1 + 2 1 3+ 1 1+ 2 All the numerators are 1 and there is no improper fraction so we are done. In compact form we write this as: 69 = [ 6; 3, 1, 2] 11 For a continued fraction we need to 1) convert all the improper fractions into mixed fractions 2) ensure that all the numerators of any fractions must be 1 Next we give a formal definition of continued fractions. Definition (15.1). A finite continued fraction is of the form: 1 a1 + 1 a2 + 1 a3 + 1 a4 + First note that O an 1 + 1 an

where a1 , a2 , a3 , a4 , L , an are real numbers. All of these are positive except possibly a1 . If all the as are integers then the continued fraction is called a simple fraction. In this chapter we will only deal with simple continued fractions. Example 2 450 Express into a continued fraction. 743

Chapter 15: Continued Fractions Solution 450 is not an improper fraction. However we can write this as 743 450 450 = 0+ 743 743 For a continued fraction we can only have numerators of 1. Inverting the given fraction: Note that

Chapter 15: Continued Fractions 450 450 = 0+ = 0+ 743 743 1 743 450 1 = 0+ 293 1+ 450 1 = 0+ 1 1+ 450 293 = 0+ 1 1+

Writing the improper fraction as a mixed fraction 293 1 Writing 450 = 450 / 293 450 Writing the improper fraction 293 as a mixed fraction

1 157 1+ 293 1 = 0+ 1 1+ 1 1+ 293 157 = 0+ 1 1+ 1+ 1 1 1+

293 Writing the improper fraction 157 as a mixed fraction

1 136 1+ 157 1 = 0+ 1 1+ 1 1+ 1 1+ 1 157 136 1 = 0+ 1 1+ 1 1+ 1 1+ 1 21 1+ 136 Is this ever going to terminate at any point? Yes because we have a rational which means it must stop eventually. Let us continue with this:

Chapter 15: Continued Fractions 1 1+ 1+ 1 1 1+ 1 1 21 1+ 136 = 0+ 1 1+ 1 1+ 1 1+ 1+ 1 1+ 1+ 1 1 1+ 1+ 1 1+ 1+ 1 1 1+ 1+ 1 1+ 1+ 1 1 1+ 1+ 6+ 1 1 1 1 21 10 1 1 1 10 6+ 21 = 0+ 1 1+ 1+ 1 1 1+ 1+ 6+ 1 1 1 1 2+ 1 10 1 1 1 10 6+ 21 1 1 1 136 21

0+

= 0+

= 0+

= 0+

How do we write the given fraction

450 as a continued fraction in compact form? 743 [ 0; 1, 1, 1, 1, 6, 2, 10]

As you can observe in the above example that some fractions take a long time to convert into a continued fraction. A3 Euclidean Algorithm and Continued Fractions 450 How do we know that the given fraction in Example 2 will stop with a finite number of 743 steps? The next proposition proves that for a rational number the continued fraction will be finite.

Chapter 15: Continued Fractions

Proposition (15.2). Any rational number can be written as a finite simple continued fraction. This means that if we have a rational number then we are guaranteed that only a finite number of steps are required to convert this into a continued fraction. How do we prove this result? By using the Euclidean Algorithm. Proof. a Let be a rational number where b > 0 . We apply the Euclidean Algorithm which is stated b on page 26 of Burton: a = bq1 + r1 0 < r1 < b b = r1q2 + r2 r1 = r2 q3 + r3 rn 2 M = rn 1qn + rn 0 < r2 < r 1 0 < r3 < r2 M 0 < rn < rn 1 0 < rn < rn 1

rn 1 = rn qn +1 + 0

Using this by replacing the quotients qs with as gives: a = ba1 + r1 0 < r1 < b b = r1a2 + r2 r1 = r2 a3 + r3 rn 2 M = rn 1an + rn 0 < r2 < r 1 0 < r3 < r2 M 0 < rn < rn 1

rn 1 = rn an +1 + 0 0 < rn < rn 1 Each of the remainders rs are positive integers. Using the first equation of these results we have a ba1 + r1 r 1 = = a1 + 1 = a1 + b b b b r1 b Substituting the second equation b = r1a2 + r2 into gives r1 a 1 1 1 = a1 + = a1 + = a1 + b r1a2 + r2 r b a2 + 2 r1 r1 r1 If r2 = 1 then we stop and have the resulting continued fraction. If r2 1 then we continue: a 1 1 = a1 + = a1 + r 1 b a2 + 2 a2 + r1 r1 r2 Replacing the third equation r1 = r2 a3 + r3 for r1 gives:

Chapter 15: Continued Fractions a 1 = a1 + 1 b a2 + r1 r2 = a1 + 1 a2 + 1 r2 a3 + r3 r2 = a1 + 1 a2 + 1 a3 + r 3 r2

We continuing doing this until we get to the zero remainder which is means we have a 1 = a1 + 1 b a2 + r a3 + 3 r2 = a1 + 1 a2 + 1 a3 + O

rn 1 = an +1 . Hence this rn

1 an + an +1 This completes the proof that for a rational number to find the continued fraction. This proof shows that we can also use the Euclidean Algorithm to find the continued fraction of a rational number. Example 3 450 Express the fraction given in Example 2 above into a continued fraction by using the 743 Euclidean Algorithm. Solution a Applying the Euclidean Algorithm of : b a = bq1 + r1 0 < r1 < b b = r1q2 + r2 r1 = r2 q3 + r3 rn 2 to the given fraction M = rn 1qn + rn 0 < r2 < r 1 0 < r3 < r2 M 0 < rn < rn 1 0 < rn < rn 1 a we only need a finite number of steps b

rn 1 = rn qn +1 + 0

450 with a = 450 and b = 743 gives: 743

Chapter 15: Continued Fractions 450 = 0 ( 743) + 450 450 = 1( 293) + 157 293 = 1( 157 ) + 136

743 = 1( 450 ) + 293

157 = 1( 136 ) + 21 136 = 6 ( 21) + 10 21 = 2 ( 10 ) + 1

10 = 10 ( 1) + 0 Hence the continued fraction in compact form is given by the quotients which are the numbers in front of the brackets. This means that 450 = [ 0; 1, 1, 1, 1, 6, 2, 10] 743 This is identical to the continued fraction found on page 5. In this case the Euclidean Algorithm shows that the numbers 450 and 743 are relatively prime, gcd ( 743, 450 ) = 1 . A4 An Application of Continued Fractions One application is to see how we can split a rectangle into only squares. The following example illustrates this. Example 4 Write a 71 by 9 rectangle in terms of squares only. Compare the three techniques of creating the squares, continued fraction and the quotients in the Euclidean Algorithm. Solution We are given the following rectangle: Fig 1
71

71 into a mixed fraction we have: 9 71 8 = 7+ 9 9 This means there are 7 squares of size 9 by 9 and one of rectangle of size 8 by 9: Converting the improper fraction

Chapter 15: Continued Fractions Fig 2


9 9 9 9 9 9 9

10

We need to convert the last shaded rectangle into a square. Evaluating the remaining continued fraction we have 71 8 = 7+ = 7+ 9 9 = 7+ 1 9 8 1 1+

1 8 This means we have one 8 by 8 square and 8 lots of 1 by 1 squares:


9 9 9 9 9 9 9

Fig 3 We can write the given fraction 71 as a continued fraction: 9 8 lots of one by one squares.

71 = [ 7; 1, 8] 9 Each of these numbers 7, 1 and 8 correspond to the number of squares in Fig 3. If we apply 71 the Euclidean Algorithm to we obtain the following: 9 71 = 7 ( 9 ) + 8 8 = 8 ( 1) + 0 In this algorithm the quotients 7, 1 and 8 correspond to the numbers in the continued fraction and the number of squares in Fig 3. SUMMARY We can convert a rational number into a finite simple continued fraction. A finite continued fraction is of the form: 9 = 1( 8 ) + 1

9
8

9
1

Chapter 15: Continued Fractions a1 + 1 a2 + 1 a3 + O an 1 + where a1 , a2 , a3 , a4 , L , an are real numbers. 1 an

11