The fraction is a good approximation to the irrational number : so much so that it is celebrated in Pi Approximation Day on 22 July. But have you ever wondered how to calculate rational approximations to irrational numbers?
The answer comes from continued fractions: these are a nested series of fractions that can reveal hidden properties of numbers. Any number can be written as a continued fraction. Rational numbers (including integers) can be written as finite continued fractions: for example
(which is admittedly not very interesting!)
Irrational numbers have infinite continued fractions, and cutting these off after a finite number of levels gives you fractions that are close to the value of the irrational number. The fractions above are the first few such approximations to
, calculated from cutting off its infinite continued fraction:
is a good
approximation of an irrational number
if there isn't a fraction that is closer to
with a smaller denominator
. And the continued fraction expansion of an irrational number gives the best series of approximations in this sense, for an irrational number.
The first few approximations of produced in this way:
very quickly get close to the true value of . Their differences from are approximately:
|If you count the curves of seeds spiralling in a sunflower you'll find pairs (counting spirals curving left and curving right) that are (almost always) neighbours in the Fibonacci series, all approximations of .
But not all approximations work so well for irrational numbers. For example, the approximations from the continued fraction of (the limit of the ratio of successive Fibonacci numbers – you can read more here) are:
These approximations, although the best there are, approach the true value for
very slowly, with differences of around
for those listed above. Irrational numbers with such useless approximations are called badly approximable
. You can tell something is badly approximable if the numbers in its continued fraction are bounded (they don't ever exceed some fixed number) and this is a measure of how irrational they are. In fact,
is the most irrational number, with the numbers in its continued fraction never exceeding 1:
The continued fraction for
reveals a beautiful pattern, despite the fact that it (and all irrational numbers) having messy infinite decimal expansions that do not tail off into any repeating patterns. The continued fractions of other irrational numbers, such as
, also reveal hidden patterns:
These patterns are beautiful, but result in these numbers being badly approximable. But
, with its excellent rational approximations, holds no such pattern in its continued fraction.
You can read more about continued fractions in John D Barrow's article, Chaos in Numberland: The secret life of continued fractions.