Skip to main content
Home
plus.maths.org

Secondary menu

  • My list
  • About Plus
  • Sponsors
  • Subscribe
  • Contact Us
  • Log in
  • Main navigation

  • Home
  • Articles
  • Collections
  • Podcasts
  • Maths in a minute
  • Puzzles
  • Videos
  • Topics and tags
  • For

    • cat icon
      Curiosity
    • newspaper icon
      Media
    • graduation icon
      Education
    • briefcase icon
      Policy

    Popular topics and tags

    Shapes

    • Geometry
    • Vectors and matrices
    • Topology
    • Networks and graph theory
    • Fractals

    Numbers

    • Number theory
    • Arithmetic
    • Prime numbers
    • Fermat's last theorem
    • Cryptography

    Computing and information

    • Quantum computing
    • Complexity
    • Information theory
    • Artificial intelligence and machine learning
    • Algorithm

    Data and probability

    • Statistics
    • Probability and uncertainty
    • Randomness

    Abstract structures

    • Symmetry
    • Algebra and group theory
    • Vectors and matrices

    Physics

    • Fluid dynamics
    • Quantum physics
    • General relativity, gravity and black holes
    • Entropy and thermodynamics
    • String theory and quantum gravity

    Arts, humanities and sport

    • History and philosophy of mathematics
    • Art and Music
    • Language
    • Sport

    Logic, proof and strategy

    • Logic
    • Proof
    • Game theory

    Calculus and analysis

    • Differential equations
    • Calculus

    Towards applications

    • Mathematical modelling
    • Dynamical systems and Chaos

    Applications

    • Medicine and health
    • Epidemiology
    • Biology
    • Economics and finance
    • Engineering and architecture
    • Weather forecasting
    • Climate change

    Understanding of mathematics

    • Public understanding of mathematics
    • Education

    Get your maths quickly

    • Maths in a minute

    Main menu

  • Home
  • Articles
  • Collections
  • Podcasts
  • Maths in a minute
  • Puzzles
  • Videos
  • Topics and tags
  • Audiences

    • cat icon
      Curiosity
    • newspaper icon
      Media
    • graduation icon
      Education
    • briefcase icon
      Policy

    Secondary menu

  • My list
  • About Plus
  • Sponsors
  • Subscribe
  • Contact Us
  • Log in
  • Plus Advent Calendar Door #10: Continued fractions

    10 December, 2016

    The fraction $22/7$ is a good approximation to the irrational number $\pi$: 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 $$ 3 = 3 $$ (which is admittedly not very interesting!) $$ \frac{22}{7} = 3+\frac{1}{7} $$ and $$ \frac{333}{106} = 3+\frac{1}{7+\frac{1}{15}}=3+\frac{15}{106}. $$ 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 $\pi$, calculated from cutting off its infinite continued fraction: $$ \pi = 3+\frac{1}{7+\frac{1}{15+\frac{1}{1+\frac{1}{292+\ldots}}}}. $$ A fraction $p/q$ is a good approximation of an irrational number $x$ if there isn't a fraction that is closer to $x$ with a smaller denominator $q$. 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 $\pi$ produced in this way: $$ 3, 22/7, 333/106, 355/113 \mbox{ and } 103993/33102 $$ very quickly get close to the true value of $\pi$. Their differences from $\pi$ are approximately: $$ 0.141, 0.001, 0.0008, 0.0000003 \mbox{ and } 0.0000000006. $$

    Sunflower seed head Sunflower seed head with 55 left spirals Sunflower seed head with 34 right spirals
    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 $\phi$.

    But not all approximations work so well for irrational numbers. For example, the approximations from the continued fraction of $\phi = 1.618...$ (the limit of the ratio of successive Fibonacci numbers – you can read more here) are: $$ \frac{1}{1}, \frac{2}{1}, \frac{3}{2}, \frac{5}{3}, \frac{8}{5},\ldots $$ These approximations, although the best there are, approach the true value for $\phi$ very slowly, with differences of around $0.618, 0.381, 0.118, 0.048$ and $0.018$ 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, $\phi$ is the most irrational number, with the numbers in its continued fraction never exceeding 1: $$ \phi = 1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\ldots}}}}}}. $$ The continued fraction for $\phi$ 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 $\sqrt 2$, also reveal hidden patterns: $$ \sqrt 2 = 1+\frac{1}{2+\frac{1}{2+\frac{1}{2+\ldots}}}. $$ These patterns are beautiful, but result in these numbers being badly approximable. But $\pi$, 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.

    Return to the Plus advent calendar 2016.

    This article comes from our Maths in a minute library.

    • Log in or register to post comments

    Read more about...

    advent calendar 2016

    Our Podcast: Maths on the Move

    Our Maths on the Move podcast brings you the latest news from the world of maths, plus interviews and discussions with leading mathematicians and scientists about the maths that is changing our lives.

    Apple Podcasts
    Spotify
    Podbean

    Plus delivered to you

    Keep up to date with Plus by subscribing to our newsletter or following Plus on X or Bluesky.

    University of Cambridge logo

    Plus is part of the family of activities in the Millennium Mathematics Project.
    Copyright © 1997 - 2025. University of Cambridge. All rights reserved.

    Terms