Continued Fractions
Continued Fractions
Continued Fractions
Continued Fractions
Runali Jadhav
Precia Bhagyaraj
Himanshu Mishra
Of
TYBSc
PROJECT GUIDE
Mrs. Veena B. Kamat
1
INDEX
1 Introduction
2 History
Continued Fractions
3
Some Applications
4
6 Ramanujan’s Contribution
7 References
2
INTRODUCTION
Consider a simple fraction 9/7 expressed in the following way. The expression on the right are
called continued fractions. These provide much insight into many mathematical problems,
particularly into the nature of numbers
9 2 1 1 1
=1+ =1+ =1+ =1+
7 7 7 1 1
3+ 3+
2 2 1
1+
1
1
The quadratic equation x 2−3 x−1=0 can be written as x=3+
x
1 1
1 x=3+ =3+
Replace x again by 3+ on the right-hand side gives x 1
x 3+
x
Repeating this process, a several more times we get
1
x=3+
1
3+
1
3+
1
3+
1
3+
x
Since x appears on the right hand side of this fraction this process continues.
We now consider the following successive fractions,
1
1 1 , 3+
3 , 3+ ,3+ 1
x 1 3+ …….
3+ 1
x 3+
x
If we convert them to fractions we
10 33 109
3, =3.333 … , =3.3 , =3.30303 … … .
3 10 33
These numbers give better and better approximations to the positive root of the quadratic
equation which is
3+ √ 13
x= =3.302775 … …
2
Does the sequence of fractions actually converge to the root?
3
Here one sees how continued fractions can be used to give better and better rational
approximations to irrational numbers. We first discuss how rational functions can be expanded
into continued fractions (finite in nature). We then discuss expansion of irrational numbers into
infinite continued fractions and some applications
HISTORY
The origin of continued fractions is hard to pinpoint as examples of these fractions
can be found throughout mathematics in the last 2000 years. The foundations
however were not laid until the late 1600's, early 1700's.
Continued fractions became a field in its right through the work of John Wallis
(1616-1703). In his book Arithemetica Infinitorium (1655), he developed and
presented the identity
4 3 ×3 × 5× 5× 7 ×7 × 9 …
=
x 2 × 4 × 4 ×6 × 6 ×8 × 9 …
The first president of the Royal Society, Lord Brouncker (1620-1684) transformed
this identity into
2
4 1
=1+ 2
x 3
2+ 2
5
3+ 3
7
3+
⋱
4
This brief sketch into the past of continued fractions is intended to provide an
overview of the development of this field. Though its initial development seems to
have taken a long time, once started, the field and its analysis grew rapidly. Even
today, the fact that continued fractions are still being used signify that the field is
still far from being exhausted.
CONTINUED FRACTIONS
1 1 7 25
[ 2,1,3,9 ] =2+ =2+ =2+ =
1 2 9 9
The continued fraction 1+ 1+
1 7
3+
2
25
represents the rational number
9
5
Conversely let’s start with a rational number 57/33
57 24
57=1× 33+24 ; =1+
33 33
33 9
33=1× 24+9 ; =1+
24 24
24 6
24=2 ×9+ 6 ; =2+
9 9
9 3
9=1× 6+3 ; =1+
6 6
6
6=2× 3+0 ; =2+0
3
The numbers 1, 1, 2, 1, 2 in the continued fraction are precisely the quotients that would arise if
we used the Euclidean Algorithm to compute gcd (57,33).
67 1
=2+
29 1
Let us look at some more rational expansions: 3+
1
4+
2
The process of finding the continued fractions is as follows:
First we divide 67 by 29 and to obtain quotient 2 and remainder 9. Continuing this process
6
67 9 1 1
=2+ =2+ =2+
29 29 29 2 ………
3+
9 9
29
We now find the continued fraction of
67
29 29
29=67 ×0+29 ; =0+
67 67
67 9
67=29 ×2+9 ; =2+
29 29
29 2
29=9 ×3+2 ; =3+
9 9
9 1
9=2× 4 +1; =4+
2 9
2=2×1+ 0;
We see except for the first step the remaining steps are the same and
29
=[0 , 2,3,4,2]
67
Notice that a 0 ,=0 in this example.
7
1 1 1 29
0+ = = = .
1 1 9 67
2+ 2+ 2+
1 2 29
3+ 3+
1 9
4+
2
67 a
A comparison with the expansion of =[2,3,4,2] suggests that if for any rational with a> b
29 b
a b
and =[ a0 , a1 , a2 , a3 , ….. , a n] then =[0 ,a 0 , a1 , a2 , ….. , an ]
b a
a
Let where b> 0 , be an arbitrary rational number
b
By Euclidean algorithm for finding the greatest common divisor of a and b we get
a=ba0 +r 1 ; 0<r 1< b
b=r 1 a1 +r 2 ;0<r 2 <r 1
r 1=r 2 a 2+ r 3 ; 0< r 3 <r 2
⋮
r n−2=r n−1 a n−1+ r n ; 0< r n <r n−1
r n−1=r n an +0
Since each remainder r k is a positive integer. a 1 , a2 , … , an are all positive.
We rewrite the equations of the algorithms in the following manner:
a r 1
=a 0+ 1 =a0 +
b b b
r1
b r 1
=a1 + 2 =a1 +
r1 r1 r1
r2
r1 r3 1
=a2 + =a2 +
r2 r2 r2
r3
⋮
8
r n−1
=an
rn
b
If we use the second of these equations to eliminate from the first equation, then
r1
a 1 1
=a 0+ =a0 +
b b 1
a1 +
r1 r1
r2
r1
In this result, substitute the value of as given in the third equation:
r2
a 1
=a 0+
b 1
a1 +
1
a 2+
r2
r3
Continuing in this way, we can go on to get
a 1
=a 0+
b 1
a1 +
1
a 2+ ⋱
a 3+ ¿¿
1
1
an−1+
an
51
We illustrate continued fraction of using Euclidean Algorithm
19
51 13
51=2 ×19+3 ; =2+
19 19
19 6
19=1×13+ 6 ; =1+
13 13
13 1
13=2× 6+1 ; =2+
6 6
6
6=6 ×1+0 ; =1
6
Making the appropriate substitutions, we see
9
19 1 1 1 1 1 1
=0+ = = = = =
51 51 13 1 1 1 1
2+ 2+ 2+ 2+ 2+
19 19 19 6 1 1
1+ 1+ 1+
13 13 13 1
2+
6 6
This is the continued fraction expansion for 19/51=[0 ; 2, 1 , 2, 6]
.
The initial integer in the symbol [a0 ; a1 , … , an ] is zero when the value of the fraction is positive
but less than one.
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 a n> 1, then
1
a n=( a n−1 ) +1= ( an−1 )+
1
Where a n−1is a positive integer; hence,
[ a 0 ; a 1 , … , an ]=[ a0 ; a 1 , .. , an−1 , 1]
On the other hand, if a n=1 , then
1 1
a n−1+ =a + =a +1
a n n 1 n−1
So that
[ a 0 ; a 1 , … , an −1 , an ]=[a0 ; a1 , … , an−2 , an−1+ 1]
Every rational number has two representation as a simple continued fraction, one with an even
number of partial denominators and one with an odd number (it turns out that these are the only
19
two representations). In the case of 19/51, =[ 0 ; 2, 1 ,2 , 6 ]=[ 0 ; 2 ,1 , 2, 5 , 1]
51
The converse of the above theorem is also true. That is ‘every finite SCF represents a rational
number.
10
Much of the difficulty in calculating the convergents of a finite continued fraction [a0 ; a1 , … , an ]
can be avoided by establishing formulas for their numerators and denominators.
We define numbers pk and q k (k =0 , 1, … , n) as follows:
p0=a0 q0 =1
p1=a1 a0 +1 q1=a 1
pk =ak p k−1+ p k−2 q k =ak qk−1 +q k−2; for k =2 ,3 , … , n .
A direct computation shows that the first few convergents of [a0 ;a1 , … , an ] are
a0 p 0
C 0=a 0= =
1 q0
1 a1 a0 +1 p1
C 1=a0 + = =
a1 a1 q1
1 a2 ( a1 a0 +1 ) +a 0 p2
C 2=a0 + = =
1 a2 a1 + 1 q2
a1 +
a2
1
For k < n if a k is replaced by the value a k + , then the convergent C k becomes the convergent
a k+1
C k+1 ;
[ a0 ; a1 , … , ak−1 , ak +
1
ak +1]=[ a0 ; a1 , … , ak−1 , ak , ak+1 ]=Ck +1
Clearly the last convergent C n always equals the rational number represented by the original
a
continued fraction .
b
19
The successive convergents of =[ 0 ;2, 1 ,2 , 6 ] , are
51
C 0=0
1 1
C 1=[ 0 ; 2 ] =0+ =
2 2
11
1 1
C 2=[ 0 ; 2, 1 ] =0+ =
1 3
2+
1
1 3
C 3=[ 0 ; 2 ,1 , 2 ] =0+ =
1 8
2+
1
1+
2
19
C 4= [ 0 ; 2 , 1, 2 , 6 ] =
51
19
Except for the last convergent C 4 , these are alternately less than or greater than , each
51
19
convergent being closer in value to than the previous one.
51
Definition: An infinite simple continued fraction (SICF) is a continued fraction of the form
12
1
a 0+
1
a 1+
1
a 2+
a3. + …
where a 0 , a 1 , a2 , … is an infinite sequence of integers, all positive except possibly for a 0.
It is reasonable to define the value of the infinite continued fraction [a0 , a1 , a2 ,… ] to be the limit
pn
of the sequence of rational numbers C n= , provided of course, that this limit exists. That is
qn
[ a 0 , a 1 , a2 , … ]=nlim
→∞
[a0 , a1 , a2 , … , a n]=lim C n
n→∞
C n=[ a 0 , a1 , a2 , … , an ]
Note: “simple” indicates that the partial denominators a k are all integers.
13
We see after 1 the partial denominator 2 repeats infinitely
Remark: If b 1 , b2 , … , bn is the smallest block of integers that constantly repeats, we say that
b 1 , b2 , … , bn is the period of the expansion and that the length of the period is n . Thus, for
example, [3; 1 , 2 ,1 , 6] would denote [ 3 ;1, 2 , 1, 6 , 1 ,2 , 1 ,6 ,… ] , a continued fraction whose
period 1 ,2 , 1 ,6 has length 4.
That is nlim
→∞
C n is an irrational number.
Unlike representation of a rational as a continued fraction it can be shown that the representation
of an infinite continued fraction of an irrational is unique.
Having shown that every infinite continued fraction represents a unique irrational number we
now show that an arbitrary irrational number can be expended into an infinite continued fraction.
14
Continued Fraction Algorithm
The successive irrational numbers x k (and therefore the integers a k =[x k ]¿ can be computed
rather easily, with the calculations as shown in the following examples:
1
As in the case of SCF the continued fraction representation of =[0 ; 1, 2]
√2
15
SOME APPLICATIONS
DESIGN OF A CALENDAR
Let us see an application of continued fractions to the design of a calendar. How
many days are in a year? A good answer is 365. However, astronomers tell us that
the Earth completes its orbit around the Sun in approximately 365.2422 days. The
continued fraction of this figure is
365.2422=[365 , 4 , 7 ,1 , 3 , 4 , 1,1 ,1,2]
The second convergent is
1
365.25=365+
4
which means a calendar of 365 days per year but a leap year every 4 years. The
forth convergent gives the better approximation
8
365.2424 …=[ 365 , 4 , 7 , 1 ] =365+
33
The Gregorian calendar, named after Pope Gregorio XIII who introduced it in
1582, is based on a cycle of 400 years: there is one leap year every year which is a
multiple of 4 but not of 100 unless it is a multiple of 400. This means that in 400
years one omits 3 leap years, thus there are
400.365+ 100−3=146097
days. On the other hand, in 400 years the number of days counted with
( 8
) ( 8
)
a year of 400 365+ 33 days is 400 365+ 33 =146096.9696 …
16
DESIGN A PLANETARIUM
He wanted to design the gear ratios in order to produce a proper scaled version of
the planetary orbits. He knew that the time required for the planet Saturn to orbit
around the Sun is about
77708431
=29.425448 …=[29,2,2,1,5,1,4 , …]
2640858
206
The forth convergent is [ 29 , 2, 2 ,1 ] = 7
Therefore, Huygens made the gear regulating the Saturn’s motion with 206 teeth,
and the gear regulating Earth’s motion with 7 teeth, as shown in figure below.
17
ELECTRIC NETWORKS
The electrical resistance of a series of two resistances R1 and R2 is R1 +¿ R2
If R1 and R2 are instead in a parallel network then the resulting resistance R satisfies
1 1 1
= +
R R1 R2
Is given by
18
circuit is given by the following continued fraction expansion
[R 0 , S1 , R 1 , S2 , R 2 , . . .]
Electric networks and continued fractions have been used to solve the “Squaring
the square” problem, which states: Is it possible to decompose an integer square
into the disjoint union of integer squares, all of which are distinct? The answer to
this problem is positive. Indeed, in 1978 Duijvestijn found a decomposition of the
122 × 122 square into 21 distinct integer squares as shown in the figure below.
Furthermore, there are no solutions with less than 21 squares, and Duijvestijn’s
solution is the only with 21 squares (see [3]).
19
PAPER FOLDING
The number √ 2 appears in the A series paper sizes. Precisely, since √ 2is twice its
inverse, i.e., √ 2 = 2/ √ 2, folding a rectangular piece of paper with sides in
proportion √ 2 yields a new rectangular piece of paper with sides in proportion √ 2
again. The sizes of an A0 paper are defined to be in proportion √ 2 and so that the
area is 1 m2 . Thus, rounded to the nearest millimetre, an A0 paper is 841 by 1189
millimetres. Note that
841 29
= =[ 1, 2 , 2,2 ]
1189 49
is the fifth convergent of √ 2. The sizes of A1, A2, A3, and so forth are defined by
successively halving the A0 paper, as in Fig. 7. The Golden Ratio Φ has a similar
property. If we start with a rectangle with Golden Ratio proportion, then we can
fold it in order to get a square and a smaller rectangle which sizes are again in
Golden Ratio proportion, as shown in Fig. 8.
In fact, the Golden Ratio is the unique number with this property
20
THE IRRATIONALITY OF √ 2
We discuss some “geometric” proofs of the irrationality of √ 2
Start with a rectangle having side lengths 1 and 1+ √ 2 (see Fig. 9).
Decompose it into two squares of sides 1 and a rectangle of sides 1 and
1+ √ 2−2=√2−1
1
The second rectangle has sides in proportion =1+ √ 2
√2−1
hence it can be decomposed in two squares and a rectangle whose sides are
again in 1+ √ 2 proportion.
If we start with a rectangle having integer side lengths, then it is clear that the
process stops after finitely many steps (the side lengths of the successive rectangles
produce a decreasing sequence 74 of positive integers).
The same conclusion holds for a rectangle with side lengths in rational proportion
(reduce to a common denominator and scale).
We give a proof in just one dimension:
21
Start with an interval of length t=1+ √ 2 (see Fig. 10).
The smaller interval can now be split in two intervals of length 1/t 2 and one
of length 1/t 3
RAMANUJAN’S CONTRIBUTION
22
Ramanujan was a world expert on continued fractions. He found
exquisite expressions for the golden ratio, the number phi; which,
he found was nothing but one plus one divided by one plus one
divided by, and you go on forever.
23
... cf=[]
... q=x//k
... cf.append(q)
... r=x%k
... while r!=0:
... x=k
... k=r
... q=x//k
... cf.append(q)
... r=x%k
... print(cf)
sage: confract(45,29)
[1, 1]
[1, 1, 1]
[1, 1, 1, 4]
[1, 1, 1, 4, 3]
24
sage: def confract(x, k):
... cf=[]
... q=x//k
... cf.append(q)
... r=x%k
... while r!=0:
... x=k
... k=r
... q=x//k
... cf.append(q)
... r=x%k
... return cf
sage: confract(45,29)
[1, 1, 1, 4, 3]
REFERENCES
25
Elementary Number Theory, David Burton, Tata MacGraw Hill
https://www.math.ru.nl/~bosma/Students/CF.pdf
http://archives.math.utk.edu/articles/atuyl/confrac/history.html
file:///C:/Users/Spectrum/Downloads/5_6186088941716767782.pdf
http://www.rnta.eu/SecondRNTA/Waldschmidt-Sanna.pdf
https://thefederal.com/features/ramanujans-enchanting-journeys-in-the-
maze-of-continued-fraction/
26