Partial Convergents
Fix a finite continued fraction
. We do not assume
at this point that the
are integers.
Definition 5.1 (Partial convergents)
For
, the
th
convergent of the
continued fraction
is
. These convergents for
are
also called
partial convergents.
For each
with
,
define real numbers
and
as follows:
Proof.
We use induction. The assertion is obvious when
. Suppose the
proposition is true for all continued fractions of length
. Then
SAGE Example 5.1
If c is a continued fraction
in SAGE, use c.convergents()
to compute a list of the partial
convergents of c.
sage: c = continued_fraction(pi,bits=33); c
[3, 7, 15, 1, 292, 2]
sage: c.convergents()
[3, 22/7, 333/106, 355/113, 103993/33102, 208341/66317]
As we will see, the convergents of a continued fraction
are the best rational approximations to the value of
the continued fraction. In the example above, the
listed convergents are the best rational approximations
of
with given denominator size.
Proof.
The case for
is obvious from the definitions.
Now suppose
and the statement is true for
. Then
This completes the proof of (
5.1.2). For
(
5.1.3), we have
Remark 5.1
Expressed in terms of matrices, the proposition asserts that the determinant
of
is
, and of
is
.
SAGE Example 5.1
We use SAGE to verify Proposition
5.1.7
for the first few terms of the continued
fraction of
.
sage: c = continued_fraction(pi); c
[3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 3]
sage: for n in range(-1, len(c)):
... print c.pn(n)*c.qn(n-1) - c.qn(n)*c.pn(n-1),
1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1
sage: for n in range(len(c)):
... print c.pn(n)*c.qn(n-2) - c.qn(n)*c.pn(n-2),
3 -7 15 -1 292 -1 1 -1 2 -1 3 -1 14 -3
Proof.
It is clear that the
and
are integers, from the formula
that defines them. If
is a positive divisor of both
and
, then
, so
.
SAGE Example 5.1
We illustrate Corollary
5.1.10 using SAGE.
sage: c = continued_fraction([1,2,3,4,5])
sage: c.convergents()
[1, 3/2, 10/7, 43/30, 225/157]
sage: [c.pn(n) for n in range(len(c))]
[1, 3, 10, 43, 225]
sage: [c.qn(n) for n in range(len(c))]
[1, 2, 7, 30, 157]
William
2007-06-01