Continued Fractions
Overview
Continued Fractions are a way of representing real numbers as a sequence of positive integers. Let's say we have a real number α1. We can form a sequence of positive integers from α1 in this way:
For example, let's say α1=1.5. We can say that
The trick here is that if α2∈Z, we can continue this exact process with α2 and keep the continued fraction going.
Example
Let's take another example, that of 1117:
The list of continued fractions is represented as a list of the coefficients ai, in this case
Convergents
The kth convergent of a continued fraction is the approximation of the fraction we gain by truncating the continued fraction and using only the first k terms of the sequence, for example the 2nd convergence of 1117 is 1+11=12=2 while the 3rd would be 1+1+111=1+21=23.
One of the obvious applications of these convergents is as rational approximations to irrational numbers.
Properties of Convergences
As a sequence, they have a limit
This limit is α1, the real number you are attempting to approximate
They are alternately greater than and less than α1
Sage
In Sage, we can define a continue fraction very easily:
We can then print off the list of coefficients:
And the convergents are even calculated for us:
Last updated
Was this helpful?