OK, maybe not for the greater good, but still fun. This first post will
be relatively short and sweet, intended to give an introduction for the
posts that will follow.
Before the introduction, some
courtesy of Wikipedia:
...decimal representation has some problems. One problem is that many
rational numbers lack finite representations in this system. For
example, the number is represented by the
infinite sequence . Another
problem is that the constant is an essentially arbitrary
choice, and one which biases the resulting representation toward numbers that
have some relation to the integer . For example,
has a finite decimal representation,
while does not, not because
is simpler than
but because happens
to divide a power of
. Continued fraction
notation is a representation of the real numbers that avoids both
these problems. Let us consider how we might describe a number like
which is around .
This is approximately . Actually it is a little bit more
than about . But the
in the denominator is not correct; the correct
denominator is a little bit more than about
But the in the denominator is not correct; the correct
denominator is a little bit more than actually
. So is
This is exact...
With this in mind, one can define an infinite continued fraction to be
With the denominators we can define
a recurrence for the finite approximations (convergents) of this value. For
example, the zeroth is and the first is
The other motivation (the one I actually learned first in real life) for
continued fractions comes from being represented by
an infinite continued fraction. (Instead of saying a probability of
people would rather say a in
chance.) So we try to write
. But, instead, notice that
Plugging this into itself, we have
and notice it can be represented by .
Define the th convergent to be
so above we have
along with and
The fraction is converted
into simply by
in the final denominator. Since
we similarly have
Thus and satisfy
the same recurrence.
It remains to check the initial conditions work, but note
as we checked above.
Check out my
where I actually accomplish something with fractions (or at least
prepare to accomplish something).