Index of folder

Continued Fractions

    This is just a short introduction at the high school level, also giving the concept of the number e=2,71828.. but no applications. Links to more detailed expositions are given at the end.

    There exist two ways of writing numbers smaller than 1: ordinary fractions and decimal fractions. For example:
                  1 / 2 = 0.5
                  1 / 8 = 0.125
                  2 / 3 = 0.66666....
                  3 / 7 = 0.428571 428571 ...
In general we prefer to use decimal fractions, for a number of reasons:

  1.     Addition is much easier.
  2.     Looking at two decimal fractions, we can at once tell which is bigger, whereas with ordinary fractions it is not always easy.
  3.     Using decimal fraction, any number--for instance, any square root--can be expressed as accurately as we wish, by using a sufficient number of decimals. The symbol for square roots is , so:
                  2 = 1.414213562 ...
                  3 = 1.732050808...

    also
                  e = 2.718281828459 ... (more about this, later)
                  π = 3.141592654...

    Actually (3) is not completely accurate: there does exist a way of representing 2 or π by ordinary fractions to any desired accuracy, in such a way that the accuracy depends on where we decide to stop the process (like the place where we decide to cut off the decimal fraction). It is called a continued fraction.

    The easiest way to explain it is by an actual example. You will need a good hand-held calculator--the more decimals it gives, the better--and you should use it to verify all the steps below.

    Take p, the ratio between the circumference of a circle and its diameter. To the 11th decimal it equals

π = 3.14159265359...

    Easy to write down, just remember the sentence: Yes, I have a super motorbike to travel about the roads foolishly. You then count the letters of each word; actually, the comma may also belong, since in many countries a comma is used as decimal point.

The trick in deriving continued fractions is to
  1. Keep dividing numbers into integer part and fractional part.
  2. Invert the fractional part, and when inverting, remember that for instance

    17 =     1    
                1 / 17
    and similarly for any number
   
x =     1    
        1 / x

Many calculators have a "1/x" button which comes very handy here.

Let us work now with only 8 decimals:

π     =     3.14159265    

           =     3     +     0.14159265     

          =     3     +                 1              
                                  1 / 0.14159265

      =     3     +                 1              
                                    7.0625133        

      =   3   +                 1                    
                       1 / (7 + 0.0625133)

    =     3     +                   1                        
                               7   +             1              
                                             (1 / .0625133)

          =     3     +                       1                    
                                  7   +             1              
                                                    15.9966

One would guess at this point that

                    3   +       1        
                                7   +   1  
                                          16

is a very good approximation, and as we'll see, it really is. We may continue, but it pays to simplify the notation, before those fraction bars become unmanageable. Multiple fractions may be more easily written with slash bars

3 + 1/(7 + (1/15.9966))

and that is the notation adopted from here on (if you prefer fraction bars, please transcribe onto paper!). Mathematicians may write

3 +    1             1     
         7   +   15.9966

with the "+" sign at the level of the denominator. That is not recommended to anyone not familiar with the notation, or whose handwriting tends to wander.

π = 3 + 1/(7 + (1/15.9966)) = 3 + 1/(7 + (1/(15 + 0.9966)))

                    = 3 + 1/(7 + (1/(15 +(1/1.0034))))

                    = 3 + 1/(7 + (1/(15 +(1/(1 + 0034)))))

                    = 3 + 1/(7 + (1/(15 +(1/(1 +(1/292.62)))))

    We can stop here, dropping the extra decimals (the process could go on with no limits except those of paper and patience). Because we made an approximation, we now must use ~ which means "is approximately equal to"

π ~ 3 + 1/(7 + (1/(15 +(1/(1 +(1/292)))))

or in mathematical notation

3 +    1         1         1         1     
          7     +15     +1     +292

    The number 1/292 is so small (compared to 1 to which it is added) that we may guess (rightly) that dropping it causes only a minor error. Dropping it and rearranging the lowest denominator, brings us back to the earlier guess

                    3   +       1        
                                7   +   1  
                                          16

    Let us see what one gets by cutting this off at various places. Cutting off all fractions gives

π ~ 3

which is a very crude approximation, although it is used in the bible (1st Kings, ch. 7, verse 23). The next one is very widely used:

π ~ 3 1/7 = 22/7 = 3.14285...

It is accurate to better than one part in 1000. Next step:

            π ~   3   +       1        
                                7   +   1  
                                          16

        =   3  +       1.      =  3  +   16      =   355  =   3.14159292...
                    113/16                113           113

which gets us 6 decimals! To remember this result, just write the first 3 odd numbers, and double up each of them:

1 1 3 3 5 5

Divide in the middle, insert a fraction bar and you have it.

    By continuing the process far enough, π can be approximated by a continuous fraction to any desired accuracy, and so can any other number. In practical use, as noted, decimal fractions are much easier, but continuous fractions have some advantages too. Consider fractions which need infinite decimals for their representation:

1/3   = 0.33333...

1/11 = 0.090909...

1/13 = 0.076923 076923...

and so on: they always contain a repeating pattern. Not so with most square roots. One gets

(2) = 1.414213562...

(3) = 1.732050808...

with no repetitions. If however you try to represent these square roots by continued fractions, you will find a pattern. Try it! Surprise!

You will even find a pattern if you do this with

e  =  2.718281828459...

    This number is just as fundamental to more advanced mathematics as π. It arises if one calculates the sequence of values EN, one for each integer N:

EN  =  [1 + (1 / N)]N

As N gets larger, EN is found to get closer and closer to a limiting value, and that is the number e.

    Consider any number X raised to the N-th power, forming XN. If X is larger than 1, its powers grow larger and larger as N increases, without any limit. One can say that when N becomes infinite, XN also becomes infinite.

    On the other hand, if X=1, raised to any power it remains equal to 1: 1N=1, even if N approaches infinity. So what is one to make of

EN  =  [1 + (1 / N)]N          ?

    The number raised to the Nth power is larger than 1, so as N grows towards infinity, one might expect its Nth power to grow without limit--except that at the same time the number itself gets closer and closer to 1!

    The answer is, it goes to a limit which is neither 1 nor infinity, but something in between, a number between 2 and 3, denoted e. Proving that is hard, but it is easy to demonstrate it on a calculator, especially if yours has on it a button that can raise numbers to arbitrary powers:

N = 10           (1 + 1/10)10        = (1.1)10        = 2.593742...

N = 100         (1 + 1/100)100    = (1.01)100    = 2.7048128...

N = 1000       (1 + 1/1000)1000 = (1.001)1000 = 2.7169239...

    If your calculator only has a button "X2" which gives square powers of whatever number X you have entered, that is enough too. Push it twice and you get X4 (since 22=4). Push it 3 times and you get X8, since 23=8, 4 times for X16 (24=16), and so on. By pushing the button N times, you raise the given number X to the power 2N.

Let N=10, then 210=1024 (you can multiply 2 by itself 9 more times and check!). To calculate

( 1   +     1   1024
             1024

simply obtain 1 + (1/1024) and then push the squaring button 10 times; the result should be 2.7169557.... Of course, it is not far from (1.001)1000 obtained above.

You can now go on: 220 = (1024)2 = 1048576. Key in

( 1   +         1       )
             1048576

and push the squaring button 20 times. You should get e correct to 4 decimals. And now that you know about e, try to express it in a continued fraction!

(Extra Credit: If you have a computer with "Basic" and know how to use it, write a program that expands any given number in a continuous fraction.)


More detailed web sites on continued fractions:


Return to listing of Education files

Author and Curator:   Dr. David P. Stern
     Mail to Dr.Stern:   david("at" symbol)phy6.org .

Last updated 19 December 2003