Babylon and the Square Root of 2

joint with Richard Elwes

Sometimes you can learn a lot from an old piece of clay. This is a Babylonian clay tablet from around 1700 BC. It’s known as “YBC7289”, since it’s one of many in the Yale Babylonian Collection.

It’s a diagram of a square with one side marked as having length 1/2. They took this length, multiplied it by the square root of 2, and got the length of the diagonal. And our question is: what did they really know about the square root of 2?

Questions like this are tricky. It’s even hard to be sure the square’s side has length 1/2. Since the Babylonians used base 60, they thought of 1/2 as 30/60. But since they hadn’t invented anything like a “decimal point”, they wrote it as 30. More precisely, they wrote it as this:

Take a look.

So maybe the square’s side has length 1/2… but maybe it has length 30. How can we tell? We can’t. But this tablet was probably written by a beginner, since the writing is large. And for a beginner, or indeed any mathematician, it makes a lot of sense to take 1/2 and multiply it by \sqrt{2} to get \frac{1}{\sqrt{2}}.

Once you start worrying about these things, there’s no end to it. How do we know the Babylonians wrote 1/2 as 30? One reason is that they really liked reciprocals. According to Jöran Friberg’s book A Remarkable Collection of Babylonian Mathematical Texts, there are tablets where a teacher has set some unfortunate student the task of inverting some truly gigantic numbers such as 325 · 5. They even checked their answers the obvious way: by taking the reciprocal of the reciprocal! They put together tables of reciprocals and used these to tackle more general division problems. To calculate \frac{a}{b} they would break b up into factors, look up the reciprocal of each, and take the product of these together with a. This is cool, because modern algebra also sees reciprocals as logically preceding division, even if most non-mathematicians disagree!

So, we know from tables of reciprocals that Babylonians wrote 1/2 as 30. But let’s get back to our original question: what did they know about \sqrt{2}?

On this tablet, they used the value

\displaystyle{ 1 + \frac{24}{60} + \frac{51}{60^2} + \frac{10}{60^3} \approx 1.41421297... }

This is an impressively good approximation to

\sqrt{2} \approx 1.41421356...

But how did they get this approximation? Did they know it was just an approximation? And did they know \sqrt{2} is irrational?

There seems to be no evidence that they knew about irrational numbers. One of the great experts on Babylonian mathematics, Otto Neugebauer, wrote:

… even if it were only due to our incomplete knowledge of the sources that we assume that the Babylonians did not know that p^2 = 2q^2 had no solution in integer numbers p and q, even then the fact remains that the consequences of this result were never realized.

But there is evidence that the Babylonians knew their figure was just an approximation. In his book The Crest of the Peacock, George Gheverghese Joseph points out that a number very much like this shows up at the fourth stage of a fairly obvious recursive algorithm for approximating square roots! The first three approximations are


\displaystyle{ \frac{3}{2} = 1.5 }


\displaystyle{ \frac{17}{12} \approx 1.41666... }

The fourth is

\displaystyle{ \frac{577}{408} \approx 1.41421569... }

but if you work it out to 3 places in base 60, as the Babylonians seem to have done, you’ll get the number on this tablet!

The number 577/408 also shows up as an approximation to \sqrt{2} in the Shulba Sutras, a collection of Indian texts compiled between 800 and 200 BC. So, Indian mathematicians may have known the same algorithm.

But what is this algorithm, exactly? Joseph describes it, but Sridhar Ramesh told us about an easier way to think about it. Suppose you’re trying to compute the square root of 2 and you have a guess, say a. If your guess is exactly right then

a^2 = 2


a = 2/a

But if your guess isn’t right, a won’t be quite equal to 2/a. So it makes sense to take the average of a and 2/a, and use that as a new guess. If your original guess wasn’t too bad, and you keep using this procedure, you’ll get a sequence of guesses that converges to \sqrt{2}. In fact it converges very rapidly: at each step, the number of correct digits in your guess will approximately double!

Let’s see how it goes. We start with an obvious dumb guess, namely 1. Now 1 sure isn’t equal to 2/1, but we can average them and get a better guess:

\displaystyle{ \frac{1}{2}(1 \;+ \; 2) = \frac{3}{2} }

Next, let’s average 3/2 and 2/(3/2):

\displaystyle{ \frac{1}{2}\left(\frac{3}{2} \; + \; \frac{2}{\frac{3}{2}}\right) = \frac{1}{2}\left(\frac{3}{2} \; + \; \frac{4}{3}\right) = \frac{1}{2}\left(\frac{3 \cdot 3 + 2 \cdot 4}{2 \cdot 3}\right) = \frac{9 + 8}{12} = \frac{17}{12} }

We’re doing the calculation in painstaking detail for two reasons. First, we want to prove that we’re just as good at arithmetic as the ancient Babylonians: we don’t need a calculator for this stuff! Second, a cute pattern will show up if you pay attention.

Let’s do the next step. Now we’ll average 17/12 and 2/(17/12):

\displaystyle{ \frac{1}{2}\left(\frac{17}{12} \; + \; \frac{2}{\frac{17}{12}}\right) = \frac{1}{2}\left(\frac{17}{12} \; + \; \frac{24}{17}\right) = \frac{1}{2}\left(\frac{17 \cdot 17 + 12 \cdot 24}{12 \cdot 17}\right) }

Do you remember what 17 times 17 is? No? That’s bad. It’s 289. Do you remember what 12 times 24 is? Well, maybe you remember that 12 times 12 is 144. So, double that and get 288. Hmm. So, moving right along, we get

\displaystyle{ \frac{1}{2}\left(\frac{289 + 288}{204}\right) = \frac{577}{408}  }

which is what the Babylonians seem to have used!

Do you see the cute pattern? No? Yes? Even if you do, it’s good to try another round of this game, to see if this pattern persists. Besides, it’ll be fun to beat the Babylonians at their own game and get a better approximation to \sqrt{2}.

So, let’s average 577/408 and 2/(577/408):

\begin{array}{ccl} \displaystyle{ \frac{1}{2}\left(\frac{577}{408} \; + \; \frac{2}{\frac{577}{408}}\right) } &=& \displaystyle{ \frac{1}{2}\left(\frac{577}{408} \; + \; \frac{816}{577}\right) }  \\  \\ &=& \displaystyle{ \frac{1}{2}\left(\frac{577 \cdot 577 + 816 \cdot 408}{408 \cdot 577}\right) } \end{array}

Do you remember what 577 times 577 is? Heh, neither do we. In fact, right now a calculator is starting to look really good. Okay: it says the answer is 332,929. And what about 816 times 408? That’s 332,928. Just one less! And that’s the pattern we were hinting at: it’s been working like that every time. Continuing, we get

\displaystyle{ \frac{1}{2}\left(\frac{332,929 + 332,928}{235,416}\right) = \frac{665,857}{470,832} }

So that’s our new approximation of \sqrt{2}, which is even better than the best known in 1700 BC! Let’s see how good it is:

\begin{array}{ccc} \displaystyle{ \frac{665,857}{470,832} }\; &\approx & 1.414213562375... \\ & & \\  \sqrt{2} \; &\approx & 1.414213562373...\end{array}

So, it’s good to 11 decimals!

What about that pattern we saw? As you can see, we keep getting a square number that’s one more than twice some other square:

3^2 = 2 \cdot 2^2 + 1

17^2 = 2 \cdot 12^2 + 1

577^2 = 2 \cdot 408^2 + 1

and so on… at least if the pattern continues. So, while we can’t find integers p and q with

p^2 = 2 q^2

because \sqrt{2} is irrational, it seems we can find infinitely many solutions to

p^2 = 2 q^2 + 1

and these give fractions p/q that are really good approximations to \sqrt{2}. But can you prove this is really what’s going on?

We’ll leave this as a puzzle in case you’re ever stuck on a desert island, or stuck in the deserts of Iraq. And if you want even more fun, try simplifying these fractions:

\displaystyle{ 1 + \frac{1}{2} }

\displaystyle{ 1 + \frac{1}{2 + \frac{1}{2}} }

\displaystyle{ 1 + \frac{1}{2 + \frac{1}{2 +\frac{1}{2}}} }

\displaystyle{ 1 + \frac{1}{2 + \frac{1}{2 +\frac{1}{2 + \frac{1}{2}}}} }

and so on. Some will give you the fractions we’ve seen already, but others won’t. How far out do you need to go to get 577/408? Can you figure the pattern and see when 665,857/470,832 will show up?

If you get stuck, it may help to read about Pell numbers. We could say more, but we’re beginning to babble on.


You can read about YBC7289 and see more photos of it here:

• Duncan J. Melville, YBC7289.

• Bill Casselman, YBC7289.

Both photos in this article are by Bill Casselman.

If you want to check that the tablet really says what the experts claim it does, ponder these pictures:

The number “1 24 51 10” is base 60 for

\displaystyle{ 1 + \frac{24}{60} + \frac{51}{60^2} + \frac{10}{60^3} \approx 1.41421297... }

and the number “42 25 35” is presumably base 60 for what you get when you multiply this by 1/2 (we were too lazy to check). But can you read the clay tablet well enough to actually see these numbers? It’s not easy.

For a quick intro to what Babylonian mathematicians might have known about the Pythagorean theorem, and how this is related to YBC7289, try:

• J. J. O’Connor and E. F. Robertson, Pythagoras’s
theorem in Babylonian mathematics

We got our table of Babylonian numerals from here:

• J. J. O’Connor and E. F. Robertson, Babylonian numerals.

For more details, try:

• D. H. Fowler and E. R. Robson, Square root approximations in Old Babylonian mathematics: YBC 7289 in context, Historia Mathematica 25 (1998), 366–378.

We also recommend this book, an easily readable introduction to the history of non-European mathematics that discusses YBC7289:

• George Gheverghese Joseph, The Crest of the Peacock: Non-European Roots of Mathematics, Princeton U. Press, Princeton, 2000.

To dig deeper, try these:

• Otto Neugebauer, The Exact Sciences in Antiquity, Dover Books, New York, 1969.

• Jöran Fridberg, A Remarkable Collection of Babylonian Mathematical Texts, Springer, Berlin, 2007.

Here a sad story must indeed be told. While the field work has been perfected to a very high standard during the last half century, the second part, the publication, has been neglected to such a degree that many excavations of Mesopotamian sites resulted only in a scientifically executed destruction of what was left still undestroyed after a few thousand years. – Otto Neugebauer.

89 Responses to Babylon and the Square Root of 2

  1. Michael Knap says:

    I love the pun Dr. Baez and Dr. Elwes! Which one of you is responsible for that? Aside: are you going to have time for a doctoral student in Riverside next fall?

    • John Baez says:

      The advantage of writing a joint post is that neither of us has to take the blame for that pun: we can both blame each other.

      I will indeed be seeking good grad students to work with me on network theory, and perhaps some topics relating to climate change and mathematical biology.

    • michele says:

      Hello Dr Baez,
      I don’t know if you reply to posts this old, but I am looking for information on a war that was fought over the existence of the square root of two. I am a biochemist, but recall a fabulous math instructor I had a few decades ago in college making reference to this. Are you familiar with the occurrence of this in history such that you could tell me anything about it to help me research it?
      I really like the breadth of topics you explore on your blog and how you facilitate the opportunity for viewers to explore the topics by working on them mathematically themselves.

      • John Baez says:

        Michele wrote:

        I don’t know if you reply to posts this old…

        To me posts never grow old; I would the discussions to go on for centuries. It’s mainly other people who lose interest.

        I have never heard of a “war fought over the existence of the square root of two”, and I think I’d have heard of it if it existed.

        This story could perhaps be a huge exaggeration of another story which is itself probably just a legend, about a disciple of Pythagoras who was drowned because he proved the irrationality of the square root of two. According to Wikipedia:

        Hippasus of Metapontum (/ˈhɪpəsəs/; Greek: Ἵππασος, Híppasos; fl. 5th century BC), was a Pythagorean philosopher. Little is known about his life or his beliefs, but he is sometimes credited with the discovery of the existence of irrational numbers. The discovery of irrational numbers is said to have been shocking to the Pythagoreans, and Hippasus is supposed to have drowned at sea, apparently as a punishment from the gods, for divulging this. However, the few ancient sources which describe this story either do not mention Hippasus by name or alternatively tell that Hippasus drowned because he revealed how to construct a dodecahedron inside a sphere. The discovery of irrationality is not specifically ascribed to Hippasus by any ancient writer. Some modern scholars though have suggested that he discovered the irrationality of √2, which it is believed was discovered around the time that he lived.

        Hippasus is sometimes credited with the discovery of the existence of irrational numbers, following which he was drowned at sea. Pythagoreans preached that all numbers could be expressed as the ratio of integers, and the discovery of irrational numbers is said to have shocked them. However, the evidence linking the discovery to Hippasus is confused.

        Pappus merely says that the knowledge of irrational numbers originated in the Pythagorean school, and that the member who first divulged the secret perished by drowning. Iamblichus gives a series of inconsistent reports. In one story he explains how a Pythagorean was merely expelled for divulging the nature of the irrational; but he then cites the legend of the Pythagorean who drowned at sea for making known the construction of the regular dodecahedron in the sphere. In another account he tells how it was Hippasus who drowned at sea for betraying the construction of the dodecahedron and taking credit for this construction himself; but in another story this same punishment is meted out to the Pythagorean who divulged knowledge of the irrational. Iamblichus clearly states that the drowning at sea was a punishment from the gods for impious behaviour.

  2. Aaron says:

    More Babylonian digits:

    577 / 408 = 1 24 51 [10 35 17 38 49 24 42 21]

    665857 / 470832 takes a long time to start repeating, so I won’t give the full list, but it starts 1 24 51 [10 7 46 6 9 12 43 0 …].

    The first few exact digits are 1 24 51 10 7 46 6 4 44.

    • John Baez says:

      Cool! Since you seem to be good at this, could you verify that 1/2 times \sqrt{2} really has the sexagesimal expansion given on that tablet? All the experts say so, but I’ve been meaning to check it myself, just to feel a bit better about it.

      Also, anyone who wants to take a stab at those puzzles near the end should tell us what they come up with!

      1) If we start with a = 1 and keep averaging a and 2/a, do we keep getting fractions p/q with

      p^2 = 2 q^2 + 1  ?

      2) What about the fractions we get by expanding these:

      \displaystyle{ 1 + \frac{1}{2} }

      \displaystyle{ 1 + \frac{1}{2 + \frac{1}{2}} }

      \displaystyle{ 1 + \frac{1}{2 + \frac{1}{2 +\frac{1}{2}}} }

      \displaystyle{ 1 + \frac{1}{2 + \frac{1}{2 +\frac{1}{2 + \frac{1}{2}}}} }

      and so on?

      3) What’s the relation between the fractions in 1) and the fractions in 2)?

      • Aaron says:

        (1, 24, 51, 10) / 2 surely has that 42 25 35 form — it’s just standard grade school arithmetic in a larger base.

        (1/2, 30 + 24 / 2, 51 / 2, 30 + 10 / 2), where the divisions round down and 30s come from odd digits above.

        The first few actual digits are 0 42 25 35 3 53 3 2 22 25 43.

        (I wouldn’t trust these “actual digits” very far — I’m not using arbitrary precision libraries for sqrt(2), but going through double precision floating point. I suppose I should just use the continued fraction expansion, but I’d have to dig up and modify some old code for that.)

      • John Baez says:

        Aaron wrote:

        … it’s just standard grade school arithmetic in a larger base.

        I know, but I didn’t like arithmetic in grade school, and I don’t like it any better in base 60.

        Thanks for checking it!

    • Greg Egan says:

      I think we can show by induction that the averaging process always gives fractions of the form \frac{p}{q} such that p^2=2q^2+1. Start with a_1=\frac{3}{2}, which satisfies the condition. Then define:

      \begin{array}{ccl} a_{n+1}&=&\displaystyle{\frac{1}{2}\left(a_n\;+\;\frac{2}{a_n}\right)} \\ \\&=&\displaystyle{\frac{{a_n}^2+2}{2 a_n}}\end{array}

      If we put a_n=\frac{p_n}{q_n}, and assume that p_n^2=2q_n^2+1, we get:

      \begin{array}{ccl}\displaystyle{\frac{p_{n+1}}{q_{n+1}}}&=&\displaystyle{\frac{p_n^2+2q_n^2}{2 p_n q_n}} \\ \\&=&\displaystyle{\frac{4q_n^2+1}{2 p_n q_n}}\end{array}

      And we have:

      \begin{array}{ccl}\displaystyle{2 q_{n+1}^2 + 1}&=&\displaystyle{8 p_n^2 q_n^2 + 1} \\ \\&=&\displaystyle{8 (2q_n^2+1) q_n^2 + 1}\\ \\&=&\displaystyle{16 q_n^4+8 q_n^2 + 1}\\ \\&=&\displaystyle{(4q_n^2+1)^2}\\ \\&=&\displaystyle{p_{n+1}^2}\end{array}

    • Greg Egan says:

      The continued fractions also have a simple recursive relationship between them. If we drop the intial 1 it’s obvious that you can get the other bit from the previous other bit just by adding 2 and inverting. If we then allow for the extra 1, we add 1 rather than 2, invert, and then add 1 again. In other words:

      \begin{array}{ccl} c_{n+1}&=&\displaystyle{1+\frac{1}{c_n+1}} \\ \\&=&\displaystyle{\frac{c_n+2}{c_n+1}}\end{array}

      If we look at every second term in this sequence, we get:

      \begin{array}{ccl} c_{n+2}&=&\displaystyle{1+\frac{1}{2+\frac{1}{c_n+1}}} \\ \\&=&\displaystyle{\frac{3c_n+4}{2c_n+3}}\end{array}

      If we start with c_1=\frac{3}{2} this is a fraction of the form \frac{p_n}{q_n} satisfying p_n^2=2q_n^2+1, and we have:

      \begin{array}{ccl} \displaystyle{\frac{p_{n+2}}{q_{n+2}}}&=&\displaystyle{\frac{3p_n+4q_n}{2p_n+3q_n}}\\ \\p_{n+2}^2 - 2q_{n+2}^2-1&=&(3p_n+4q_n)^2 - 2(2p_n+3q_n)^2-1\\ \\&=&p_n^2 - 2q_n^2-1\end{array}

      So by induction, every second of the continued fractions satisfies p_n^2=2q_n^2+1.

    • Greg Egan says:

      Oh, and other sub-series of the continued fractions satisfy p_n^2=2q_n^2-1. To prove this just add 2 to both sides of the last equation derived above, to get


      and note that c_2=\frac{7}{5} which satisfies p_n^2=2q_n^2-1.

      • John Baez says:

        Great! So the remaining puzzle is how these two ways of getting solutions of the Diophantine equation

        p^2 = 2q^2 + 1

        namely the ‘averaging’ method and the ‘continued fraction’ method, are related.

        At first I naively guessed the averaging method gave all the solutions that the continued fraction method gave. But then I read about Pell numbers on Wikipedia and noticed that

        99^2 = 2 \cdot 70^2 + 1

        arises from the continued fraction method but not the averaging method.

        And then I remembered that the averaging method gives a sequence of approximations to \sqrt{2} where the number of correct digits roughly doubles each time… while for continued fraction approximations to \sqrt{2} the number of correct digits grows roughly linearly.

        So, I now guess that the nth solution of

        p^2 = 2q^2 + 1

        obtained by the averaging method is something like the 2^nth solution obtained by the continued fraction method. But I’ve refrained from attempting to work out the details: someone else should have all the fun.

        Presumably this has been known by number theorists for at least a few centuries—maybe longer! I read that Archimedes discovered some relation between approximations to \sqrt{3} and another case of Pell’s equation, namely:

        p^2 = 3 q^2 + 1

        I don’t know exactly what he did, but somehow he noticed

        1351^2 = 3 \cdot 780^2 + 1

        which means that

        \frac{1351}{780} = 1.73205128...

        is a good approximation to

        \sqrt{3} = 1.73205081...

        Since Pell’s equation is a classic topic in number theory, I don’t expect to discover anything new about it. However, the approach where you start by looking for good approximations to square roots seems a lot more fun than the approach where you say “here’s a random-looking equation: let’s look for integer solutions!” So when I teach number theory next, I may talk about this. I could start by showing the students this:

        and tell a nice tale, starting around 1700 BC and leading up to Pell’s equation and maybe even beyond.

        • reperiendi says:

          If you have a solution to x^2-Dy^2=z^2 then you know that x+z and x-z are multiples of the factors of D, so it’s a very interesting equation for cryptographers.

        • Todd Trimble says:

          @reperiendi: could you state this a bit more formally? I’m honestly not sure what you’re trying to say.

        • John Baez says:

          My guess is that he was trying to say that when x^2 - z^2 = Dy^2, then (x+z)(x-z) is divisible by D.

          (By the way, ‘reperiendi’ is my student Mike Stay—that’s very easy to discover, but he usually posts here under his real name, so I thought I should mention it.)

        • Mike Stay says:

          Yes: Legendre showed that by taking the continued fraction convergents P_n/Q_n to \sqrt{D}, you get that P_n^2 \mbox{ mod } D \; < \; 2\sqrt{D}. You compute a bunch of these remainders, factor each of them and do Gaussian elimination of the squarefree part. The result is a pair (r,s) whose squares differ by a multiple of D, so r+s and r-s will, much of the time, share only a single factor each with D, allowing you to factor D.

        • Mike Stay says:

          I wrote “only share a single factor with D“—I’m assuming that D is the product of two large primes, since that’s how you generate the modulus for RSA.

      • Greg Egan says:

        From computer calculations it’s easy to check that for the first few cases your guess is exactly right.

        If we number both sequences so they start at a_1=c_1=1, then a_n=c_{2^{n-1}}.

        I don’t know how to prove this yet!

      • Greg Egan says:

        Ah, it’s easy to prove by induction that the continued fractions c_n, defined with:

        \begin{array}{ccccl} c_1&=&1&& \\ \\ c_2&=&1+\frac{1}{2}&=&\frac{3}{2}\\ \\ c_3&=&1+\frac{1}{2+\frac{1}{2}}&=&\frac{7}{5}\end{array}

        all satisfy the equation:


        This is clearly true for n=1. To show that it being true for some n implies it for n+1, you can just apply the recursion relations we found previously:

        \begin{array}{ccl} c_{n+1}&=&\displaystyle{1+\frac{1}{c_n+1}} \\ \\&=&\displaystyle{\frac{c_n+2}{c_n+1}}\\ \\c_{n+2}&=&\displaystyle{1+\frac{1}{2+\frac{1}{c_n+1}}} \\ \\&=&\displaystyle{\frac{3c_n+4}{2c_n+3}}\end{array}

        Applying the first recursion relation gives us:

        \begin{array}{ccl} \displaystyle{\frac{1}{2}(c_{n+1}+\frac{2}{c_{n+1}})}&=&\displaystyle{\frac{1}{2}(\frac{c_n+2}{c_n+1}+\frac{2}{\frac{c_n+2}{c_n+1}})}\\ \\ &=&\displaystyle{\frac{3 c_n^2+8 c_n+6}{2 \left(c_n+1\right) \left(c_n+2\right)}}\end{array}

        Applying the second recursion relation to c_{2n}, which by the induction hypothesis equals \frac{1}{2}(c_n+\frac{2}{c_n}), gives:

        \begin{array}{ccl} c_{2n+2}&=&\displaystyle{\frac{3c_{2n}+4}{2c_{2n}+3}}\\ \\ &=&\displaystyle{\frac{3(\frac{1}{2}(c_n+\frac{2}{c_n}))+4}{2(\frac{1}{2}(c_n+\frac{2}{c_n}))+3}}\\ \\ &=&\displaystyle{\frac{3 c_n^2+8 c_n+6}{2 \left(c_n+1\right) \left(c_n+2\right)}}\end{array}

        • John Baez says:

          Hey, that’s a cool proof! Indeed, it’s not immediately clear how to show that a_{n} = b_{2^n} if they’re defined recursively using a_{n+1} = f(a_n), b_{n+1} = g(a_n). It seems like trying to march forward when one leg is going a lot faster than the other. That had me stuck. But you found a neat way to do it.

          If any number theorists read this, please tell us when this fact was first discovered: starting with a = 1 and repeatedly averaging a and 2/a, n times, gives the 2^{n-1}st term in the continued fraction expansion of \sqrt{2}. I want to know how many more centuries I need to think about math before I catch up.

        • Yes, this is very nice indeed! I got as far as the algebra in Greg’s first comment, but this shows a relationship between the two sequences very clearly.

        • Greg Egan says:

          I was curious to see whether this relationship generalised to arbitrary periodic continued fractions, which are always roots of some quadratic with integer coefficients, and applying Newton’s method to solve the same quadratic.

          The answer turns out to be that when things work out nicely there’s an analogous powers-of-two link, but there are other cases where applying Newton’s method to refine an approximation will give a result whose continued fraction is no longer a truncated version of the infinite continued fraction of the true result.

          In the cases where everything goes nicely, suppose the quadratic root’s continued fraction has a repeating block of partial denominators of length r.

          If you define c_1, c_2, c_3, ... such that each of these continued fractions includes r more partial denominators than the one before, then applying Newton’s method to any c_n yields c_{2n}.

          But take the quadratic:


          This has roots:

          \displaystyle{x_{\pm }=\frac{1}{4}\left(4\pm \sqrt{3}\right)}

          The sequence of denominators for x_{-} is [0;1,1,3,4,3,4,3,4,…] and the sequence for x_{+} is [1;2,3,4,3,4,3,4,…]

          Let’s concentrate on x_{+}. The first few truncated continued fractions for this are:

          x_{+}\approx 1,\frac{3}{2},\frac{10}{7},\frac{43}{30},\frac{139}{97},\frac{599}{418},\frac{1936}{1351},\frac{8343}{5822}

          Applying Newton’s method to the quadratic gives the recursion:

          \displaystyle{x_{n+1}=\frac{16 x_n^2-13}{32x_n-32}}

          We can’t apply this to 1 because the denominator is zero, but if we apply it to \frac{3}{2} it gives \frac{23}{16}, whose sequence of denominators is [1;2,3,2]. If we apply it to \frac{10}{7} it gives \frac{321}{224}, whose sequence of denominators is [1;2,3,4,3,2]. And if we apply it to \frac{43}{30} it gives \frac{4471}{3120}, whose sequence of denominators is [1;2,3,4,3,4,3,2].

          So the relationship almost works in general, but cases like this mean it’s not a perfect match.

        • John Baez says:

          Greg wrote:

          I was curious to see whether this relationship generalised to arbitrary periodic continued fractions,

          Cool—thanks for figuring that out! I was wondering how much this generalized.

          What are some nice examples where the relationship does work as nicely as possible? The golden ratio? \sqrt{3}? They both have appealing periodic continued fraction expansions. And I’m curious about how Archimedes noticed that

          \frac{1351}{780} = 1.73205128...

          though I haven’t taken the time to read what, if anything, he said.

        • Greg Egan says:

          Everything works nicely for \sqrt{3} (which is [1;1,2,1,2,1,2,…]) and the golden ratio (which is [1;1,1,1,…]).

          For \sqrt{3}, which has a repeated block of size 2, you actually get Newton’s method doubling the index, i.e.

          c_n \to c_{2n}

          even if you list all the successive continued fractions as c_1, c_2, c_3, .... With some other examples, though, such as \sqrt{13}, which has a repeated block of size 5, you only get c_n \to c_{2n} if you add five more denominators to each continued fraction c_n in the list.

          With the golden ratio, the repeated block has size 1, and Newton’s method doubles the index.

          So far, all the examples I’ve seen where Newton’s method takes you out of the continued fractions list altogether have more than a single non-repeating entry at the start, e.g. [1;2,3,4,3,4,3,4…].

          As for Archimedes knowing that:

          \sqrt{3} \approx \frac{1351}{780}

          for what it’s worth you can get there in two steps of the Babylonian method, if you start at \frac{5}{3}. If you start at 1 or 2 you never hit it.

        • John Baez says:

          Nice. I like giving students pattern-finding problems in number theory, so now I can give them something where they approximate the golden ratio using Newton’s method and are forced to notice that the 2nth Fibonacci number shows up! This would come after lots of easier problems involving Fibonacci numbers…

        • Greg Egan says:

          There’s a really simple general result that lies behind these “powers of two” patterns.

          Suppose you have a fractional linear function (and we rule out true linear functions):

          \displaystyle{ r(x) = \frac{\alpha  x + \beta}{x + \gamma} }

          We can normalise the coefficient of x in the denominator to 1 because if it started out as zero we’d have a linear function.

          The fixed points of this function, where r(x)=x, will be roots of a quadratic:

          q(x) = x^2 + (\gamma -\alpha) x -\beta

          The successive refinements to an approximation to a root of this quadratic by Newton’s method are given by:

          \displaystyle{ N(x) = x-\frac{q(x)}{q'(x)} = \frac{x^2+\beta}{2x+\gamma -\alpha} }

          It turns out that, with no further assumptions at all:

          r(r(N(x))) = N(r(x))

          which can be proved just by grinding through the algebra.

          Now, if you have some sequence c_1, c_2, c_3, .... with:

          c_{n+1} = r(c_n)

          and it also happens to be true that:

          c_2 = N(c_1)

          then you have everything you need to prove by induction that:

          c_{2n} = N(c_n)

          Taking this as the induction hypothesis, we have:

          c_{2n+2}=r(r(c_{2n}))\\ =r(r(N(c_n)))\\ =N(r(c_n))\\ =N(c_{n+1})

          Now c_2=r(c_1), so what the initial condition is saying is that c_1 must be a root of:

          \displaystyle{ N(x)-r(x)=\frac{(x-\alpha) q(x)}{(x+\gamma) q'(x)} }

          In other words, ruling out c_1 being a root of the quadratic itself, it must equal the parameter from the fractional linear transformation:


          So we have the general result that in the sequence:

          c_1=\alpha , c_2=r(\alpha), c_3=r(r(\alpha)), ...


          \displaystyle{ r(x) = \frac{\alpha  x + \beta}{x + \gamma} }

          if we use Newton’s method to refine roots of the quadratic obtained from r(x)=x, we will have:

          c_{2n} = N(c_n)

          Now we can apply this to periodic continued fractions.

          With any periodic continued fraction, it’s not hard to see that adding another periodic block of denominators will amount to performing some fractional linear transformation on the number you started with. That’s why all periodic continued fractions are roots of some quadratic: the limiting value must be a fixed point of that fractional linear transformation.

          When the initial non-repeating portion of the periodic continued fraction has a length of 1, we can write the transformation very simply as:

          r(x)=[d_0;d_1,d_2,...,d_k, \frac{1}{x-d_0}]

          where the repeating block of denominators is d_1,...,d_k.

          Whether we get the “powers of two” pattern will depend on whether we meet the initial condition of the induction. When the initial non-repeating portion of the periodic continued fraction has a length of 1, it turns out that this condition will always be satisfied. When the non-repeating portion is longer than 1, it generally won’t be.

          Explicitly, for the case where we have a repeating block of two denominators, we have:

          \displaystyle{ r(x)=[d_0;d_1,d_2,\frac{1}{x-d_0}] } \\\displaystyle{ =\frac{(d_0+\frac{1}{d_1})x+\frac{d_2}{d_1}+d_0(d_2-d_0)}{x+\frac{1}{d_1}+(d_2-d_0)}}

          Here we have


          which is the continued fraction with two partial denominators, and hence c_1 in a sequence where we add two partial denominators (the size of the repeating block) to each successive term.

        • Todd Trimble says:

          My gosh, Greg, this r r N = N r identity is beautiful and striking and cries out loud for a conceptual explanation. Do you have one? How did you find this identity?

        • Greg Egan says:

          Todd, I found that identity because it was a necessary condition for the inductive proof of the \sqrt{2} case to generalise to other quadratics.

          I don’t have a conceptual explanation for it! There might be a geometric explanation, somehow connected to the fact that:

          \displaystyle{ r(x) = x - \frac{q(x)}{x+\gamma} }\\ \displaystyle{ N(x) = x - \frac{q(x)}{q'(x)} }

          Or maybe it’s somehow related to the group theory of fractional linear transformations, though I’m not sure how to bring N into that.

        • John Baez says:

          Really cool stuff!

          Here’s a shallow thought: we can rewrite

          rrN = Nr


          rN = r^{-1} N r

          which could be more tractable since it’s always good to conjugate something by something else.

          r^{-1} N r seems like some sort of ‘warped Newton’s method’: Newton’s method done in a coordinate system that’s been warped by r (or maybe its inverse).

          The ordinary Newton’s method involves drawing a straight line, so Newton’s method warped by a fractional linear transformation would involve drawing a circle.

        • John Baez says:

          Here’s a better thought.

          Greg’s function r is a fractional linear transformation with an attractive fixed point. Most or all transformations of that sort are conjugate, within the group of fractional linear transformations, to one of this sort:

          x \mapsto \alpha x

          for some \alpha with |\alpha| < 1. (This transformation has the origin as an attractive fixed point.)

          So, let’s assume we can do a change of coordinates via a fractional linear transformation so that in these new coordinates

          r(x) = \alpha x

          In this new coordinate system what map N would obey

          r r N =  N r ?

          The obvious choice is squaring:

          N(x) = x^2

          So, I believe that when we change coordinates as described, N will be be squaring.

          And here’s another piece of evidence for this: we know that Newton’s algorithm converges quadratically, meaning that if x_0 is the attractive fixed point of N and x is some nearby point,

          |N(x) - x_0| \le c |x - x_0|^2

          Squaring has the origin as a fixed point and it’s quadratically convergent in this sense.

          On the other hand the original map r, and multiplying by \alpha with |\alpha| < 1, are maps with an attractive fixed point that only converge linearly. As Greg suggested, r r N = N r is a very reasonable relation between two maps with same attractive fixed point, one of which converges linearly and the other of which converges quadratically.

        • Todd Trimble says:

          Seems to be barking up the right tree — thanks, John!

        • Greg Egan says:

          That’s brilliant, John!

          If you define:

          T(x) = \frac{x-x_2}{x-x_1}

          where x_1, x_2 are the roots of the quadratic, then:

          T(N(T^{-1}(x))) = x^2


          T(r(T^{-1}(x))) = \frac{\gamma +x_1}{\alpha -x_1} x


          r(x) = \frac{\alpha x + \beta}{x+\gamma}

        • Greg Egan says:

          I should have described the transformed fractional linear function in a nicer way:

          T(r(T^{-1}(x))) = T(\alpha ) x

          This makes it crystal clear that if you start with \alpha in the original coordinates, so the sequence is:

          \alpha , r(\alpha ), r(r(\alpha )), ...

          in the transformed coordinates it becomes:

          T(\alpha ), T(\alpha )^2, T(\alpha )^3, ...

          And since the Newton’s method iteration is transformed to squaring:

          T(N(T^{-1}(x))) = x^2

          the reason iterating with N doubles your index in this sequence becomes completely transparent!

        • John Baez says:

          Great! It’s nice how a mysterious fact can, with sufficient cogitation, be made crystal clear. It’s especially fun doing it as part of a team.

          I’m still curious when this was first discovered. Since fractional linear transformations play a mammoth role in number theory, I can’t believe we’re the first to notice it.

        • nad says:

          John wrote:

          It’s especially fun doing it as part of a team.

          There may be though diverging opinions about whether a team is a team.

        • John Baez says:

          I’m not sure what that’s supposed to mean. Is that a general observation, or you trying to hint at something in particular?

        • Greg Egan says:

          I can’t resist mentioning another technique for rational approximations that falls out of the whole fractional linear approach: if Newton’s method under the change of variables corresponds to squaring, what do higher powers give us?

          Rather than work this out in all generality, what if we apply this to approximating the square root of 2 by some higher-power version of Newton’s method, and to keep things simple just start at 1 and apply a single step.

          The result for even n is:

          \displaystyle{\sqrt{2} \approx \frac{\sum _{k=0}^{\frac{n}{2}} \binom{n}{2 k} 2^{\frac{n}{2}-k}}{\sum _{k=0}^{\frac{n}{2}-1}\binom{n}{2 k+1} 2^{\frac{n}{2}-k-1}}}

          For odd n it is:

          \displaystyle{\sqrt{2} \approx \frac{\sum _{k=0}^{\frac{n-1}{2}} \binom{n}{2 k+1} 2^{\frac{n-1}{2}-k}}{\sum _{k=0}^{\frac{n-1}{2}}\binom{n}{2 k} 2^{\frac{n-1}{2}-k}}}

          For example, for n=8 this gives us:

          \displaystyle{\sqrt{2} \approx \frac{2^4 \binom{8}{0}+2^3 \binom{8}{2}+2^2 \binom{8}{4}+2 \binom{8}{6}+\binom{8}{8}}{2^3    \binom{8}{1}+2^2 \binom{8}{3}+2 \binom{8}{5}+\binom{8}{7}}}\\ = \frac{577}{408} \approx 1.4142157

  3. John Baez says:

    Reading about Babylonian math in 1700 BC made me want to see how far back it goes. This page was helpful:

    • Duncan Melville, Third millennium mathematics.

    It turns out the earliest writing in Mesopotamia goes back to 3200-2900 BC. We have 6000 clay tablets from this period, mostly from the city of Uruk. All were either found in ancient rubbish dumps or were illegally excavated and sold on the black market, so there is no archaeological context for any of them!

    So, apart from the information on the tablets we know nothing about how they were used, who wrote them… or anything! That really sucks.

    However, people have figured out that they’re lists of records like “3 sheep” or “5 bowls of barley”. There are no sentences, no verbs, no grammar.

    But here’s the cool part: they used 3 different number systems. A base-60 system, the S system, was used to count most discrete objects, such as sheep or people. But for ‘rations’ such as cheese or fish, they used a base 120 system, the B system. And yet another system, the ŠE system, was used to measure quantities of grain. It took work to figure this out.

    What about before writing?

    Back in 8000 BC, they used little geometric clay figures called “tokens” to represented things like sheep, jars of oil, and various amounts of grain. Apparently they were used for contracts! Eventually groups of tokens were sealed in clay envelopes, so any attempt to tamper with them would be visible.

    But, it was annoying to have to break a clay envelope just to see what’s in it. So after a while, they started marking the envelopes to say what was inside. At first, they did this simply by pressing the tokens into the soft clay of the envelopes. Later, these marks were simply drawn on tablets. Eventually they gave up on the tokens – a triumph of convenience over security. The marks on tablets then developed into the Babylonian number system! The transformation was complete by 3000 BC.

    This gradual process probably explains why they used different number systems for different kinds of things before settling on the ‘abstract’ numbers around 3000 BC.

    So, it took 5000 years of abstraction to get from tokens to writing and numerals! It seems slow, but of course they had other things on their mind. This reminds me a bit of how we slowly come up with better and better ways to use computers. We change things a bit at a time, in a messy sort of process.

    • Duncan Melville says:

      You say:

      But here’s the cool part: they used 3 different number systems. A base-60 system, the S system, was used to count most discrete objects, such as sheep or people. But for ‘rations’ such as cheese or fish, they used a base 120 system, the B system. And yet another system, the ŠE system, was used to measure quantities of grain. It took work to figure this out.

      Actually, they had something like a dozen systems. I only mentioned a few on my web page. The standard reference is:

      • Nissen, H. J., Damerow, P. and Englund, R. (1993). Archaic bookkeeping : early writing and techniques of the economic administration in the ancient Near East, University of Chicago Press.

      • John Baez says:

        Thanks, Duncan! I think it’s fascinating that the same culture had so many number systems before they were unified. It makes me think of the proliferation of computer-related standards we see now, and the battles to simplify and unify them. I wonder if those will ever settle down as our number system did.

        I think everyone interested in the history of mathematics should read your Mesopotamian Mathematics webpages! They provide just enough detail to be fascinating, not so much as to be overwhelming. That’s what makes me people want to learn more. I want to learn more!

        • Nick Barnes says:

          Anyone interested in this who prefers to be overwhelmed should read Georges Ifrah’s Universal History of Numbers:

        • John Baez says:

          That looks good—I’ll try to get it from the library. When it comes to absorbing truly large amounts of information, I prefer an old-fashioned book to a webpage. I guess one reason is simply that it sits there, physically reminding me of its existence, so I keep going back to it. (I don’t have a Kindle-oid yet.)

  4. John Baez says:

    Here’s another fun fact:

    The first known math homework in Mesopotamia—and maybe in the world?—goes back to about 2500 BC. It involves dividing by 7. Given that base 60 makes it easy to divide by 2, 3, 4, 5, and 6, this proves that math teachers have always been sadists.

    But the really cool part is that the same homework problem shows up on two tablets, and one of the students gets it wrong. One expert commented that it was “written by a bungler who did not know the front from the back of his tablet, did not know the difference between standard numerical notation and area notation, and succeeded in making half a dozen writing errors in as many lines.” This proves that grading homework has always been depressing.

    This is from

    • Duncan Melville, Early dynastic mathematics.

  5. Roger Witte says:

    Sweet historical analysis.

    The Babylonians had a very fortuitous choice of writing material for such a war-torn region. It had the property that when the city was razed, the library contents were preserved (clay+fire->ceramic).

    Subsequent choices, papyrus, parchment and paper, all burn.

    • John Baez says:

      That’s a nice point. I’ve read that data storage media have been getting more and more perishable ever since people switched from carving on rock to the convenience of clay tablets.

      It would be great if all the Babylonian clay tablets had been baked into indestructible ceramic. Unfortunately it seems not. Here is a tragic passage from Neugebauer:

      The Mesopotamian soil has preserved tablets for thousands of years. This will not be the case in our climate. Many tablets are encrusted in salts. A change in moisture produces crystals which break the surface of the tablets, thus rapidly obliterating the writing. I have seen “tablets” which consist of dust only, carefully preserved in showcases. To prevent this, tablets must be baked at high temperatures and thereafter soaked to remove salts. But only great museums possess the necessary equipment and experienced staffs, not to mention that these methods of preservation were often kept as museum secrets. Many thousands of tablets have been acquired at high costs only to be destroyed without being read or recorded in any way.

      That’s the back story behind the quote at the end of the blog article:

      Here a sad story must indeed be told. While the field work has been perfected to a very high standard during the last half century, the second part, the publication, has been neglected to such a degree that many excavations of Mesopotamian sites resulted only in a scientifically executed destruction of what was left still undestroyed after a few thousand years.

    • John Baez says:

      It’s a bit of a digression, but here’s some more about the preservation of knowledge from Stewart Brand. This is his summary of Brewster Kahle’s recent talk at the Seminars on Long Term Thinking:

      Universal access to all knowledge, Kahle declared, will be one of humanity’s greatest achievements. We are already well on the way. “We’re building the Library of Alexandria, version 2. We can one-up the Greeks!”

      Start with what the ancient library had—books. The Internet Library already has 3 million books digitized. With its Scribe Book Scanner robots—29 of them around the world—they’re churning out a thousand books a day digitized into every handy ebook format, including robot-audio for the blind and dyslexic. Even modern heavily copyrighted books are being made available for free as lending-library ebooks you can borrow from physical libraries—100,000 such books so far. (Kahle announced that every citizen of California is now eligible to borrow online from the Oakland Library’s “ePort.”)

      As for music, Kahle noted that the 2-3 million records ever made are intensely litigated, so the Internet Archive offered music makers free unlimited storage of their works forever, and the music poured in. The Archive audio collection has 100,000 concerts so far (including all the Grateful Dead) and a million recordings, with three new bands every day uploading.

      Moving images. The 150,000 commercial movies ever made are tightly controlled, but 2 million other films are readily available and fascinating—600,000 of them are accessible in the Archive already. In the year 2000, without asking anyone’s permission, the Internet Archive started recording 20 channels of TV all day, every day. When 9/11 happened, they were able to assemble an online archive of TV news coverage all that week from around the world (“TV comes with a point of view!”) and make it available just a month after the event on Oct. 11, 2001.

      The Web itself. When the Internet Archive began in 1996, there were just 30 million web pages. Now the Wayback Machine copies every page of every website every two months and makes them time-searchable from its 6-petabyte database of 150 billion pages. It has 500,000 users a day making 6,000 queries a second.

      “What is the Library of Alexandria most famous for?” Kahle asked. “For burning! It’s all gone!” To maintain digital archives, they have to be used and loved, with every byte migrated forward into new media every five years. For backup, the whole Internet Archive is mirrored at the new Bibliotheca Alexadrina in Egypt and in Amsterdam. (“So our earthquake zone archive is backed up in the turbulent Mideast and a flood zone. I won’t sleep well until there are five or six backup sites.”)

      Speaking of institutional longevity, Kahle noted during the Q & A that nonprofits demonstrably live much longer than businesses. It might be it’s because they have softer edges, he surmised, or that they’re free of the grow-or-die demands of commercial competition. Whatever the cause, they are proliferating.

      –Stewart Brand

  6. Nathan Urban says:

    I don’t think you mentioned it explicitly, but this iterative averaging method of computing square roots is equivalent to Newton’s method. (It’s also how I used to compute square roots as a kid on calculators that didn’t have square root buttons.)

    • John Baez says:

      Yes, that’s a good thing to note. Of course Newton’s method is a lot more general, and in general it uses calculus:

      When pondering Babylonian mathematics one wants to come up with ways they could have guessed the special case of Newton’s method for computing \sqrt{2} without knowing calculus—that’s why I didn’t mention Newton’s method.

      George Gheverghese Joseph gives a way that doesn’t quite mention calculus, but comes very close. It goes like this:

      Suppose you want to know the square root of x and you already have an approximate answer, say a. You want to find a better approximation, say a + c. You note that (a + c)^2 \approx a^2 + 2ac if c^2 is small. So, you set x = a^2 + 2ac and solve this for c. Then a + c is your new better approximation.

      But if you work out what a + c is, it’s just the average of a and x/a. And that seems like an idea people could have invented without the rigamarole I just described.

      I don’t yet have enough of a sense yet of how the Babylonians thought about this stuff. I should read this more carefully:

      • D. H. Fowler and E. R. Robson, Square root approximations in Old Babylonian mathematics: YBC 7289 in context, Historia Mathematica 25 (1998), 366–378.

      I think it should shed some light on it.

      • ShyLynx says:

        I came across a very nice and natural geometric interpretation of that averaging algorithm. You are finding a square root of A by constructing a sequence of rectangles of a fixed area A, which converge to the square of area A. In each step, you average the previous two side-lengths to get one of the sides, and the other one is, naturally, A/guess. Don’t remember the source, sorry.

  7. Nick Barnes says:

    Newton’s method converges much more quickly than the method I use for extracting square roots in my head, a relaxing mental exercise useful when, for example, stuck in traffic. On the other hand, my method is in decimal, so I can sit there and recite digits (more and more slowly, as my mental scratchpad gets fuller). And I was taught it by my mother, so it serves as a memorial exercise too.

  8. Let me see if I have your argument right.

    There is a simple algorithm which at each iteration gives you better approximations of \sqrt 2. The third iteration after the initial choice of 1 is 577/408. This fraction worked out to three places in base 60 is the same as the Babylonian expression for \sqrt 2. Therefore, it’s reasonable to think the Babylonians used (something like) this algorithm.

    That’s quite a piece of Peircean abduction. I’m not sure I see that we can say much more than that they must have had some method which approaches to the true value. It might have been as clumsy as trial and error: if too high/low, try lower/higher. So long as they had some means of getting nearer to the correct value, if they had the patience, they were always going to be able to achieve three place base 60 accuracy.

    • John Baez says:

      Whoops. It’s not really ‘our argument’, it’s the conventional wisdom. I could try to pull the wool over your eyes and note that Wikipedia calls the recursive algorithm I described the Babylonian method. I could point out lesson plans that say things like:

      This lesson describes a method for finding square roots used by the Babylonian people of Mesopotamia. The method involves dividing and averaging, over and over, to find a more accurate solution with each repeat of the process.

      However, I have not yet seen anyone go further than to say it seems plausible that the Babylonians might have computed \sqrt{2} this way. And indeed the Wikipedia article has a little footnote saying:

      Although the term “Babylonian method” is common in modern usage, there is no direct evidence showing how the Babylonians computed the approximation of √2 seen on tablet YBC 7289. Fowler and Robson offer informed and detailed conjectures.

      So, you’ve got a great point, and I should reword the article (at least the version on my website). But first I’ll re-read this more carefully:

      • D. H. Fowler and E. R. Robson, Square root approximations in Old Babylonian mathematics: YBC 7289 in context, Historia Mathematica 25 (1998), 366–378.

      They describe some other Babylonian calculations, which might give us a better sense of what they were likely to have done.

    • John Baez says:

      Here’s a nice example from Fowler and Robson, taken from an old Babylonian tablet:

      A gate, of height 1/2 rod 2 cubits, and breadth 2 cubits. What is its diagonal? You: square 0;10, the breadth. You will see 0;01 40, the base. Take the reciprocal of 0;40 (cubits), the height; multiply by 0;01 40, the base. You will see 0;02 30. Break in half 0;02 30. You will see 0;01 15. Add 0;01 15 to 0;40, the height. You will see 0;41 15. The diagonal is 0;41 15. The method.

      This takes a while to understand! If you’re anything like me, your first impulse is to think about something else: it looks difficult yet boring at the same time.

      But let me lead you all through it.

      First, we need to know that a rod is 12 cubits. Second, we need to know how scholars of Babylonian mathematics write numbers in base 60. The semicolon is a ‘decimal point’ (or ‘sexagesimal point’), which is not actually present in the clay tablets—it’s the result of guesswork. But let’s not worry about that; the idea is that 0;01 40 is short for

      \displaystyle{ 0 + \frac{1}{60} + \frac{40}{60^2} }

      and so on.

      So, let me translate:

      A gate has height \frac{40}{60} rods and breadth \frac{10}{60} rods. What is its diagonal? You square the breadth \frac{10}{60} and get \frac{1}{60} + \frac{40}{60^2}, the ‘base’. You take the reciprocal of the height and multiply by the base and get \frac{2}{60} + \frac{30}{60^2}. Divide this by two and get \frac{1}{60} + \frac{15}{60^2}. Add this to the height and get \frac{41}{60} + \frac{15}{60^2}. That’s the diagonal.

      It’s easier to understand if we abstract the idea using algebra:

      A gate has height H and breadth b. What is its diagonal? It’s

      \displaystyle{ H + \frac{b^2}{2 H} }

      I’d call this a first-order Taylor series approximation:

      \displaystyle \sqrt{H^2 + b^2} \approx H + \frac{b^2}{2 H}

      It’s good when b is much smaller than H. Of course we can’t be sure what they thought they were doing!

      For H = b = 1 this gives us 3/2 as an approximation to \sqrt{2}—not very good, since b isn’t much smaller than H.

      But anyway, they start here and study some possible ways that tricks along these lines could led the Babylonians to much better approximations of \sqrt{2}.

    • John Baez says:

      David wrote:

      I’m not sure I see that we can say much more than that they must have had some method which approaches to the true value. It might have been as clumsy as trial and error: if too high/low, try lower/higher. So long as they had some means of getting nearer to the correct value, if they had the patience, they were always going to be able to achieve three place base 60 accuracy.

      That’s true. But I guess on the basis of example like the one I just described, most scholars of Babylonian mathematics think of the Babylonians as fairly clever, not clumsy plodders. And they try to make up stories that seem consistent with what they know the Babylonians could do.

      But it seems we’ll never know for sure. There are probably lots of clay tablets still buried that could help us out—and lots that have been dug up but haven’t been translated, and many that have been sitting in moist European museums for so long that it’s too late! (See my reply to Roger Witte.)

    • I’ll stand by this post as being a) plausible, and b) in line with the opinions of people who know this stuff better that I do.

      But it is worth admitting that “conventional wisdom” on Babylonian mathematics can be wrong, and does change. It was conventional wisdom for several years that Plimpton 322 was a table of Pythagorean triples. But Eleanor Robson put paid to this idea in 2001, acidly remarking that “Ancient mathematical texts and artefacts, if we are to understand them fully, must be viewed in the light of their mathematico-historical context, and not treated as artificial, self-contained creations in the style of detective stories.”

      Click to access neither-sherlock.pdf

      I don’t think we fell into the Sherlock Holmes trap here, but it certainly is worth watching out for!

      • Will says:

        Sorry to comment on an ancient post, but I see this interpretation of Robson repeated again and again, and it frustrates me. Plimpton 322 can’t literally be a table of Pythagorean triples, not least because it only contains one of the sides and the diagonal, rather than both sides and the diagonal. But are you claiming that the author of the tablet didn’t think of the numbers it contains as having to do with exact side lengths of right triangles (or of rectangles with their diagonal)? I don’t think Robson’s article supports that. I can’t think of any scholar who says that—even Friberg, who states in his book A Remarkable Collection of Babylonian Mathematical Textsthat the numbers in columns 2 and 3 shouldn’t be thought of as integer side lengths, still thinks the tablet is connected with right triangles.

      • John Baez says:

        It’s an ancient post, but still brand-new compared to what it’s discussing. Thanks for adding your wisdom! I don’t know about Richard, but my knowledge on this topic is very superficial and prone to mistakes.

  9. Thomas says:

    I find the use of irrational square roots and antique versions of continued fraction expansions as rhetorical model interesting, e.g. for Platon’s dialoges, and as model for the human mind. Heraclit’s proportions like “god:man=man:child” look like that. But only if their “paradigm” were that “gods”, “childs” etc. are well known, static ideas. Like the “docta ignorantia” or “coincidentia oppositorum”, which was used by christian theologists to characterize the possible knowledge of “god” – only with the roles of “god” and “human” interchanged. If that guess is roughly correct, it would rhetorically explain why the ancient greeks saw the human mind as inherently dynamic entity, on which idea later gnostics relied.

    There have been other interesting cases where concepts from mathematics suddenly became into a strong resonance with the “Zeitgeist” and it’s problems. E.g. this, written by a french anarchist in prison who had only access to math. physics books, was taken by W. Benjamin as core text for understanding the 19th century mentality (and probably influenced Nietzsche). A more recent case were the problems with set theory and the concept of functions in general ca. 100 years ago, as told in this very interesting book (video lecture, free copy).

  10. some guy on the street says:

    Hmmm… no-one has mentioned harmonic means, which is interesting because they’re implicitly here, for behold:

    \frac{a+b}{2} \frac{2 a b }{a+b} = a b

    That is, the arithmetic and harmonic mean of two numbers have the same product as those two numbers; at the same time,

    \frac{a + b}{2} -\frac{2 a b}{a+b} = \frac{(a-b)^2}{a+b}.

    It’s easy to see that the new difference is less than half the old, and eventually decreases quadratically.

    Incidentally, it’s a fun game to apply Newton’s method to the function x\mapsto 1/x - a… Try it!

    • John Baez says:

      I’ll try it! I’m supposed to be writing a talk now for the CQT Symposium on Wednesday, but that means that I’m eagerly looking for various fun ways to procrastinate, inbetween bursts of activity.

      Your comment on arithmetic and harmonic means reminds me of the arithmetic-geometric mean idea, which I don’t understand as well as I should… but already had floating in my mind, since it’s yet another process involving means that converges quadratically.

      The idea is that you take two numbers a_i and b_i, compute their arithmetic mean

      a_{i+1} = (a_i + b_i) / 2

      and geometric mean

      b_{i+1} = \sqrt{a_i b_i}

      and keep iterating. You can use this trick to efficiently compute elliptic integrals, and there’s a book:

      • Jonathan Borwein, Peter Borwein, Pi and the AGM: A Study in Analytic Number Theory and Computational Complexity, John Wiley & Sons, Inc., New York, 1998.

      which contains some cool results. Unfortunately it’s been years since I looked at it, so I completely forget what those results are! Now I’m really curious.

      Does anyone know what cool stuff is in this book? I think it contains some nice algorithms for computing π, which roughly double the number of correct digits each time. Unfortunately the Babylonians didn’t know these!

  11. John Baez says:

    There was a great exhibition of Babylonian clay tablets including YBC7829 at the Institute for the Study of the Ancient World at New York University:

    Before Pythagoras: the culture of Old Babylonian mathematics, November 12, 2010 – January 23, 2011.

    which alas I missed… but a nice reading list is still available!

  12. prime says:

    A very interesting post! I wonder whether ancient people knew that there were infinitely many Pell numbers?

    Thank you very much!


    • John Baez says:

      Wikipedia says:

      Pell numbers arise historically and most notably in the rational approximation to the square root of 2. If two large integers x and y form a solution to the Pell equation

      \displaystyle{ x^2-2y^2=\pm 1,}

      then their ratio x/y provides a close approximation to \sqrt 2. […] The approximation

      \displaystyle{ \sqrt 2\approx\frac{577}{408} }

      of this type was known to Indian mathematicians in the third or fourth century B.C. The Greek mathematicians of the fifth century B.C. also knew of this sequence of approximations: Plato refers to the numerators as rational diameters. In the 2nd century CE Theon of Smyrna used the term the side and diameter numbers to describe the denominators and numerators of this sequence.

  13. We see a lot of papers and talk about ancient Babylonians exactness of calculating the value of square root of 2. But how close could they come to the square root of 3? […]

  14. […] Babylon and the Square Root of 2 | Azimuth – Dec 02, 2011 · The Babylonians knew an amazingly good approximation to the square root of 2 back around 1700 BC. But did they know it was just an approximation?… […]

  15. R. M. Shreshtha says:

    Really amazing and interesting; but how do such manipulations look in alphabetical numeration or numeral systems like the Greek numerals?

  16. David Li says:

    Why is p^2 = 2q^2+1?

    Can see how p represents the numerator and q the denominator but why is it different in the first equation above where you used 1^2 instead of 2^2? Just what is p^2=2q^2?

    Can someone please explain this in simpler terms? Been thinking for over an hour.

    • John Baez says:

      David Lie wrote:

      Why is p^2 = 2q^2+1?

      We’re trying to calculate the square root of two. If the square root of two were a rational we could find p and q with

      p/q = \sqrt{2}

      or in other words

      p^2 = 2q^2

      But the square root of two is not rational! So we can’t get p^2 = 2q^2. But we can come close: we can find integers p and q with

      p^2 = 2q^2 + 1

      An easy example is

      3^2 = 2(2^2) + 1

      (You caught a typo in my post: I wrote 3^2 = 2(1^2) + 1, which is nonsense. I’ll fix it now. Thanks!)

      The wonderful trick is then to take one solution of

      p^2 = 2q^2 + 1

      and use it to get another, bigger solution—which gives a better approximation to the square root of two!

      • Todd Trimble says:

        Part of the nice thing here is visualizing this geometrically. The graph of p^2 - 2q^2 = 1 is a hyperbola in the pq-plane, with asymptotes p = \pm \sqrt{2} q. If you can find a pair (p, q) of positive integers which are coordinates of a point way way out on the hyperbola, then necessarily that point will be close to an asymptote, making p/q is an excellent approximation to \sqrt{2}.

        The question then is how we get such integer points (p, q) way way out on the hyperbola? This is the second beautiful idea that John alluded to: exploit a group structure on the hyperbola. If I can make an analogy: the graph of xy = 1 is also a hyperbola, with asymptotes given by the x– and y-axes. It is also a group, where two points (x, 1/x) and (x', 1/x') on the hyperbola may be “multiplied” in an evident way to yield a third point on the hyperbola, (x x', 1/x x'). Then starting with a point like (2, 1/2), repeated powers (2^n, 1/2^n) bring us closer and closer to an asymptote (the x-axis for positive n, and the y-axis for negative n).

        Similarly, we may start with the hyperbola x^2 - 2y^2 = 1. Factoring it as (x + \sqrt{2}y)(x - \sqrt{2}y) = 1 to liken it more to x y = 1, we can multiply two points on the hyperbola. Here goes: we have

        (x + \sqrt{2}y)(x' + \sqrt{2}y') = x x' + 2 y y' + \sqrt{2}(y x' + x y').

        This suggests that the product of two points (x, y) and (x', y') on the hyperbola should be

        (x'', y'') = (x x' + 2 y y', y x' + x y').

        And indeed this third point lies on the hyperbola, because

        (x'' + \sqrt{2}y'')(x'' - \sqrt{2}y'')

        = (x + \sqrt{2}y)(x' + \sqrt{2}y')(x - \sqrt{2}y)(x' - \sqrt{2}y')

        = (x + \sqrt{2}y)(x - \sqrt{2}y)(x' + \sqrt{2}y')(x' - \sqrt{2}y')

        = 1 \cdot 1 = 1.

        Note that if x, x', y, y' are integers, then so is x'' and y''. Thus, if we start with an integer pair (p, q) = (3, 2) lying on the hyperbola, then we can take “powers” according to this product law. So the square is

        (3, 2) \cdot (3, 2) = (3^2 + 2 \cdot 2^2, 2 \cdot 3 + 3 \cdot 2) = (17, 12).

        The cube is

        (3, 2) \cdot (17, 12) = (3 \cdot 17 + 2 \cdot 2 \cdot 12, 2 \cdot 17 + 3 \cdot 12) = (99, 70).

        Already 99/70 = 1.4142857... is not a bad approximation to \sqrt{2}!

      • John Baez says:

        Very nice, Todd! I hadn’t thought of it in terms of a group structure on the hyperbola. There’s also a group structure on the circle that allows us to multiply two rational solutions of x^2 + y^2 = 1 and get another, thus giving a recipe for getting new Pythagorean triples from old ones. I don’t know how interesting this is… l’m having trouble with some calculations that should be easy. Probably not awake enough yet. So I just have some questions:

        1) Is your group structure on the hyperbola just another ‘real form’ of the group structure on the circle? If so, what’s the complex form of this algebraic group?

        2) There’s a famous old way to get new Pythagorean triples from old: you take your triple a,b,c, get a point on the circle (\frac{a}{c},\frac{b}{c}), and draw a straight line from (1,0) to this point. The line intersects the circle at another point with rational coordinates, and this is a new Pythagorean triple. The resulting algorithm goes back to Euclid. Is there a hyperbolic analogue of this trick?

        (The only hard part of this trick is seeing that the line intersects the circle at a point with rational coordinates, but if you write an equation for the coordinates of this point you’ll get a quadratic equation with two solutions, one being the one you want and the other coming from the point (1,0). Since that other solution of the quadratic is obviously rational, so is the one you want!)

        3) How is the ‘straight line’ trick related to your ‘group law’ trick?

        4) There are similar famous tricks for getting new solutions of cubic Diophantine equations from old ones. These involve drawing a bunch of lines, but ultimately they rely on the fact that any elliptic curve is an algebraic group. Do these tricks reduce to either the ‘straight line’ trick or the ‘group law’ trick in some limit where a cubic degenerates to a quadratic?

        • Todd Trimble says:

          Before I try to get to your questions, let me just say part of what’s going on is that we are dealing with algebraic number fields like \mathbb{Q}[i] or \mathbb{Q}[\sqrt{2}], or the rings of algebraic integers therein like \mathbb{Z}[\sqrt{2}], and we are studying the structure of multiplicative groups derived from these with the help of the norm map (taking an element x in the field to the product of all \sigma x where \sigma ranges over all the automorphisms of the field over \mathbb{Q}). So the norm of a typical element r + s\sqrt{2} in \mathbb{Q}[\sqrt{2}] is (r + s\sqrt{2})(r - s\sqrt{2}) = r^2 - 2s^2. And the norm map takes algebraic integers p + q\sqrt{2} \in \mathbb{Z}[\sqrt{2}] to ordinary integers, and takes units of the ring \mathbb{Z}[\sqrt{2}] to units \pm 1 \in \mathbb{Z}. Thus we are naturally led to the group structure on the union of the two hyperbolas r^2 - 2q^2 = \pm 1.

          Additionally, what is nice is that the group of units in \mathbb{Z}[\sqrt{2}], identified with certain integer pairs (p, q), is a discrete subgroup of the two-hyperbola group (each hyperbola has two branches, so the two-hyperbola group is isomorphic to \mathbb{Z}/4 \times \mathbb{R}. So the group of units is finitely generated. And if we focus on just the group of integer pairs (p, q) sitting on the branch of x^2 - 2y^2 = 1 where x > 0, then this branch is isomorphic to \mathbb{R}, so we are dealing with a discrete subgroup of \mathbb{R}. But we know that discrete subgroups of \mathbb{R} are either trivial or infinite cyclic! So basically we know that the solutions to Pell’s equation p^2 - 2q^2 = 1 are (modulo the torsion elements \pm 1) generated by a single element, namely the integer pair (p, q) that is closest to the identity (1, 0) without actually being the identity. It’s easy to convince oneself that that’s (p, q) = (3, 2) or (p, q) = (3, -2) (the inverse). And the same is true for the general Pell’s equation p^2 - Dq^2 = 1: although you have to convince yourself somehow that non-identity solutions exist, once you have one you know that you are dealing with an infinite cyclic group and you can generate all the solutions from a single solution. (Besides fancy theorems like Dirichlet’s unit theorem, the only way I know that guarantees existence of a nontrivial generator for the Pell group is by analyzing continued fraction expansions and especially their periodicity.) Oh, let me not forget to say that actually (3, 2) is the square of (1, 1) which sits on the other hyperbola x^2 - 2y^2 = -1, so actually it’s 1 + 1\cdot \sqrt{2} which generates the group of units in \mathbb{Z}[\sqrt{2}], modulo its torsion subgroup.

          Okay, onto your questions now!

          As for (1): you may have to help me a bit because I am not on intimate terms with the terminology. I think what we are dealing with is the group of units in the algebra \mathbb{R}[\sqrt{D}], dealing with cases like D = -1 and D = 2. (Or elements of norm 1, depending on what we want to look at.) The uniform group law can be written as

          (x, y) \cdot (x', y') = (x x' + D y y', x y' + y x').

          If I understand the question, it’s whether the complexified versions of the norm 1 groups are isomorphic, and the answer has to be ‘yes’ since for every nonzero D, the algebra \mathbb{C}[\sqrt{D}] is isomorphic to \mathbb{C} \times \mathbb{C}, and the norm 1 group corresponds to \{(x, y) \in \mathbb{C} \times \mathbb{C}: x y = 1\}. I think. (But let me know if that’s not what you’re asking.)

          As for (2), I think you are alluding to the stereographic projection trick. In the case of a circle, we take a point like (1, 0) on the circle and draw the straight line between that and another point (a/c, b/c) and watch where that line intersects a line like x = -1. Of course by point-slope it hits it at a point (-1, r) where r is rational if (a/c, b/c) is. But conversely, if r is rational, then the line connecting (-1, r) to (1, 0) intersects the circle x^2 + y^2 = 1 in two points. Obviously one of those points is (1, 0). Then we argue that the other point must have rational coordinates — essentially because if a rational quadratic polynomial has one rational root, then the other root must be rational as well, by e.g. the quadratic formula. So stereographic projection sets up a bijective correspondence between rational solutions (x, y) = (a/c, b/c) to the equation x^2 + y^2 = 1 and rational numbers r = p/q, and by this method we can generate all Pythagorean triples (a, b, c) where a^2 + b^2 = c^2. (I wonder how old this method is? It’s not exactly Euclid’s since he didn’t have cartesian coordinates or algebraic representations AFAIK, but it’s not ridiculous to think maybe it had occurred to a 17th century mathematician…)

          Now this stereographic projection argument is perfectly general, and so it applies to any conic with rational coordinates, such as x^2 - Dy^2 = 1 where D is a squarefree integer. So there is a bijective correspondence between rational points (r, s) on this conic and rational points on the projective line x = 0, say. After a little algebra, we see that this parametrization takes a point r on the line to (x, y) = (\frac{D r^2 + 1}{D r^2 - 1}, \frac{2 r}{Dr^2 - 1}). Which is exactly how it works for Pythagorean triples, taking D = -1.

          In each case we can transport the group structure on the rational conic to a group structure on \mathbb{P}^1(\mathbb{Q}). But we get in this way nonisomorphic group structures on \mathbb{P}^1(\mathbb{Q}), essentially because the algebraic number fields \mathbb{Q}[\sqrt{D}] have different arithmetic structures. (For example, the torsion subgroups may differ.)

          Because of this, looking at (3) I’m not sure I draw that much of a connection between the group law trick and the stereographic projection trick. One can see commonalities in method when one passes to sufficiently great extensions like \mathbb{R} or \mathbb{C}, but down here we are dealing with arithmetic which is more subtle. Note also that I was looking at elements of norm 1 in the algebraic integers \mathbb{Z}[\sqrt{2}], as opposed to elements of norm 1 in the algebraic number field \mathbb{Q}[i].

          But, but, …

          As for (4): this looks interesting! I think I’m more inclined to view the stereographic projection as referring to a group structure on the union conic + line, which forms a singular cubic. In the case we are more used to thinking about, nonsingular cubics as (unpointed) elliptic curves, the group law is prescribed by x + y + z = 0 iff x, y, z are collinear. Similarly, with stereographic projection, we are considering collineations of three points (two on the conic, one on the line). And I remember being told (this was in a brief email exchange with Noam Elkies and some others whose names I’d have to dig up) that actually group laws on eilliptic curves do pass over to group laws on even such degenerate cubics like the union of a conic and a line, or the union of three lines, although there can be a bit of weirdness going on in these degenerate siutations. Now I’m not sure right now what could be milked out of that observation, but it looks like it might be fun following up on that. (Maybe I should try to find those emails, but that could take some doing…)

        • John Baez says:

          Thanks again, Todd! It would be really cool if the stereographic projection trick for generating new Pythagorean triples and the group structure on solutions of Pell’s equations could both be seen as arising from degenerate cases of the usual group structure on elliptic curves.

          If it’s true, one could write a nice Whiggish history of Diophantine equations organized around the theme of ‘group laws’. I certainly would have understood number theory a bit better if someone had told me that tale.

          If you can dig up anything on group structures on degenerate cubics, I’d be very interested. I’ll try to learn a bit about the history of the stereographic projection trick.

          One can’t help wonder what’s in the lost works of Diophantus. (Right now I’m having a huge amount of fun reading The Archimedes Codex by Reviel Netz and William Noel, so my interest in the lost history of Greek mathematics is re-energized.)

          As for (1): you may have to help me a bit because I am not on intimate terms with the terminology.

          Neither am I, which is why I put ‘real form’ in quotes. I know about real forms of complex Lie or associative algebras or (a bit more to the point) complex algebraic varieties, but clearly that idea generalizes a lot…

          If I understand the question, it’s whether the complexified versions of the norm 1 groups are isomorphic, and the answer has to be ‘yes’.

          Great, that’s what I figured. I suppose to be more conservative in this Diophantine context one might tensor with an imaginary quadratic extension of \mathbb{Q} rather than \mathbb{C}. For example, if you look for solutions of x^2 + y^2 = 1 in \mathbb{Q} you’ll find Pythagorean triples. But if you adjoin \sqrt{-2} and then look for solutions of this equation, you’ll also find rational solutions of x^2 - 2 y^2 = 1.

  17. […] Another interesting impression of the mathematical capabilities is possible from a tablet showing a representation of the square root of 2. It has been discussed by Richard Elwes in his blog post Babylon and the Square Root of 2. […]

  18. So one of the oldest records of square roots in history would be The Old Babylonian tablet YBC 7289, which dates back anywhere from 2000-1600 BC. It depicts a square with two diagonals drawn and on the diagonals are numbers; when they are calculated, you get a very close approximation of the square root of 2 for the diagonal. Their value for the square root of two was about 1.41421297; I could have my students quickly calculate the square root of two (about 1.41421356) and mention to my students that this is pretty impressive for a civilization without modern day technology. The fact that they used clay tablets for math calculations shows how little they had to work with. Yet Babylon was also one of the most famous ancient cities in Mesopotamia; it’s mentioned multiple times in the bible and they were pretty advanced in mathematics for their area, despite the lack of resources we have today. They used a sexagesimal number system, which is base 60; they could solve algebra problems and work with what we now call Pythagorean triples; they could also solve equations with cubes.

  19. As for the questions concerning group laws, I have written about this a couple of years ago ( The stereographic projection is related to the group structure on the tangent of the circle. And Isabelle Dechene has written a thesis about generalized Jacobians where the degenerate aspect is taken care of (

  20. John Baez says:

    Recently another Babylonian mathematical clay tablet has been in the news. The tablet, Plimpton 322, is very interesting. Unfortunately the news is mostly hype and misinformation. My analysis:

    Babylon? Babble On!, 30 August 2017.

  21. […] But I said "Western world" before. In fact, a form of the method of successive approximations was known to the Babylonians for finding the square root of a positive number, which is very similar to applying Newton's method to the quadratic equation x2−a=0. There's a nice blog post by John Baez and Richard Elwes about that. […]

  22. […] We see a lot of papers and talk about ancient Babylonians exactness of calculating the value of square root of 2. For example: […]

You can use Markdown or HTML in your comments. You can also use LaTeX, like this: $latex E = m c^2 $. The word 'latex' comes right after the first dollar sign, with a space after it.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.