How Continued Fractions Approximate Irrational Numbers
This article explores the mathematical mechanism behind continued fractions and how they generate the most accurate rational approximations for irrational numbers. It covers the basic structure of continued fractions, the iterative process of extracting them from real numbers, the concept of convergents, and the specific mathematical criteria that make these fractions the undisputed best approximations available, illustrated through classic examples like Pi and the Golden Ratio.
What is a Continued Fraction?
An irrational number cannot be expressed as a simple fraction of two integers. Its decimal expansion goes on forever without repeating. A continued fraction bypasses the limitations of the base-10 decimal system by representing a number as a sequence of integer parts and reciprocal fractions.
A simple continued fraction takes the following form:
a0 + 1 / (a1 + 1 / (a2 + 1 / (a3 + ...)))
In this expression, a0 is an integer, and all subsequent
numbers (a1, a2, a3, etc.) are
positive integers. These integers are known as the "partial quotients"
of the continued fraction. For rational numbers, this sequence
eventually ends. For irrational numbers, the sequence is infinite.
The Algorithm: Turning Irrationals into Continued Fractions
Generating a continued fraction for an irrational number relies on a simple, repeating two-step process: separate and invert.
Let us use Pi (approximately 3.14159265) as an example:
- Find the integer part: The integer part of
3.14159265 is 3. This is
a0. You are left with the fractional part, 0.14159265. - Invert the remainder: Take the reciprocal of the
fractional part:
1 / 0.14159265, which equals approximately 7.0625133. - Repeat: The integer part of 7.0625133 is
7 (this is
a1). Take the remainder (0.0625133) and invert it:1 / 0.0625133, which is approximately 15.996594. - Repeat again: The integer part is
15 (this is
a2). Invert the remainder (0.996594) to get1 / 0.996594, which is approximately 1.003417. The integer part is 1 (this isa3). - Continue: Inverting the remainder 0.003417 gives
1 / 0.003417, which is approximately 292.63. The integer part is 292 (a4).
We can write the continued fraction of Pi in shorthand notation using
its partial quotients: [3; 7, 15, 1, 292, ...].
Convergents: Stopping the Process
Because the continued fraction of an irrational number goes on forever, we must truncate (cut off) the fraction at a certain step to get a usable rational number. The fraction obtained by stopping at a specific step is called a convergent.
Let us calculate the first few convergents of Pi using
[3; 7, 15, 1, 292]:
- First convergent: Stop at
a0. The approximation is simply 3. - Second convergent: Stop at
a1. This gives3 + 1/7, which equals 22/7 (approximately 3.142857). - Third convergent: Stop at
a2. This gives3 + 1/(7 + 1/15), which simplifies to 333/106 (approximately 3.141509). - Fourth convergent: Stop at
a3. This gives3 + 1/(7 + 1/(15 + 1/1)), which simplifies to 355/113 (approximately 3.1415929).
Why Are They the "Best" Approximations?
In mathematics, a fraction p/q is defined as a "best
rational approximation" of an irrational number if it is closer to the
irrational number than any other fraction with a smaller or equal
denominator.
Every convergent produced by a continued fraction is guaranteed to be a best rational approximation. You cannot find a fraction closer to Pi than 22/7 unless you use a denominator larger than 7. In fact, 22/7 is closer to Pi than any fraction with a denominator all the way up to 56.
This extreme accuracy happens because of the way the inversion step works. When a remainder is very small, its reciprocal (the next partial quotient) is very large.
If the next partial quotient (a_n) is large, it means
the remainder you just threw away by truncating the fraction was tiny.
Therefore, stopping right before a large partial quotient
yields a convergent of extraordinary accuracy.
Looking back at Pi [3; 7, 15, 1, 292, ...], the fifth
number is 292. Because 292 is quite large, truncating the continued
fraction right before it—at [3; 7, 15, 1]—gives the
fraction 355/113. This fraction is accurate to six
decimal places. To get a better approximation of Pi than 355/113, you
would need a fraction with a denominator of at least 16,604.
The Flip Side: The Golden Ratio
While large partial quotients yield exceptional approximations, small partial quotients yield the worst (though still the "best possible" for their denominator size).
The Golden Ratio, approximately 1.6180339887, has the simplest
continued fraction of all: [1; 1, 1, 1, 1, ...].
Because every partial quotient is 1 (the smallest possible positive integer), the remainders at each step are always as large as possible. Consequently, its convergents—which happen to be ratios of consecutive Fibonacci numbers (1/1, 2/1, 3/2, 5/3, 8/5, 13/8)—approach the true value of the Golden Ratio very slowly. Because of this property, mathematicians classify the Golden Ratio as the "most irrational" number, meaning it is the hardest irrational number to approximate closely with rational fractions.