The breadth of a hair
Samarkand, July 1424. In a city that Ulugh Beg, grandson of Timur, has filled with scholars, a mathematician from Kashan named Jamshīd al-Kāshī finishes a treatise on a single number: the ratio of a circle’s circumference to its diameter. He does not begin with his own answer. He begins by grading everyone else’s.
Archimedes, he writes, proved that the ratio lies between 3 10/71 and 3 1/7 — two bounds that differ by 1/497 of the diameter. On a circle the size of the Earth’s, that uncertainty is about five farsakh, some thirty kilometres. Abū al-Wafāʾ al-Būzjānī in Baghdad, using polygons of 720 sides, had brought it down to about a thousand cubits. Abū Rayḥān al-Bīrūnī, with 180 sides, to about one farsakh. And both of them, al-Kāshī adds, had made a slip in computing a chord. (He was right about al-Bīrūnī. Modern scholars have found that the slip he blamed on Abū al-Wafāʾ was in a later report of his work.)
Then he sets his own target, before he computes a single digit.
… in a circle that its diameter is six hundred thousand times the diameter of the sphere Earth, the difference between the result of our calculations and the actual value would not reach the breadth of a hair.
A hair, he specifies, a sixth of the width of a barley grain. To meet that tolerance he doubled the sides of a hexagon twenty-eight times, to a polygon of 3 · 2²⁸ = 805,306,368 sides, worked entirely in base 60, and wrote down 2π to nine sexagesimal places — sixteen decimal places. Nobody in the world did better for 172 years. By coincidence, sixteen decimal places is almost exactly what the 64-bit floating-point numbers in your laptop can hold.
Look again at the order of his work, because it is the order of this whole course. First, how large an error can I afford? Then, which method will get me there, and how many steps will it take? Then the arithmetic — and a proof that the answer is as good as promised. That is numerical analysis. Not the computing of numbers, which any machine can do, but the science of knowing how far to trust them.
Everything you will do in this course rests on four things the world had to build first: a way of writing fractions that a machine — or a scribe — can compute with; algorithms, fixed recipes that always end in an answer; iteration, the idea of improving an answer by repeating a step; and error bounds, the habit of proving how close the answer is. For six hundred years the people who built most of them wrote in Arabic and Persian. This prologue is their story.
The atlas
Thirty-six moments, thirty-two cities, three and a half thousand years.
Before the story, the map. Press play and watch where these ideas were made and how they moved. Gold arcs are books and methods travelling: base-60 fractions from Babylon to Alexandria, Greek mathematics into Arabic, Indian numerals to Baghdad, Arabic numerals to Pisa. The turquoise arcs are people. Notice how many of the great names in this story were born far to the east — in Khwarazm, Buzjan, Karaj, Nishapur, Tus and Kashan — and travelled to wherever the work was paid for.
Sixty on clay: Babylon
Mesopotamia, c. 1800–1600 BCE
Every number in this course is written in a place-value system: the same digit means different amounts in different positions. The first people to do that were the scribes of southern Mesopotamia, in what is now Iraq, nearly four thousand years ago. They counted in sixties. A “1” followed by a “24” could mean 1 + 24/60 — they wrote no point, and the scale came from context — and they wrote fractions as easily as whole numbers, with a stylus pressed into wet clay. We still count their way whenever we split an hour into sixty minutes and a minute into sixty seconds.
Sixty has a great virtue for computing: it divides by 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30. So one tenth, in base 60, is simply 0;6 — six sixtieths, finished. Remember that. At the end of this prologue, the same one tenth will refuse to be written down at all, and in 1991 that refusal will cost lives.
In the Yale Babylonian Collection there is a small, round clay tablet, catalogued YBC 7289, about the size of a palm. Historians think it was a student’s rough work, held in one hand. On it is a square with its two diagonals. One side is marked 30. Along the diagonal are four numbers: 1;24,51,10 — and below them 42;25,35, the length of the diagonal. The first number is the square root of 2, to about six decimal places: wrong by less than one part in two million.

Squeezing π: the Greeks
Syracuse and Alexandria, c. 250 BCE–150 CE
Around 250 BCE, in Syracuse on the island of Sicily, Archimedes did something new with an approximation: he trapped it. In a short work, Measurement of a Circle, he drew regular polygons inside and outside a circle, doubled their sides from 6 to 96, and proved that π lies between 3 10/71 and 3 1/7. He did not claim to know π. He claimed to know an interval that contains it — and that is the idea of an error bound, which you will use in every unit of this course. Seventeen centuries later, al-Kāshī opened his treatise by quoting exactly this result.
In Alexandria, in the first century CE, Heron needed the square root of 720 to find the area of a triangle. He took 27, whose square is close to 729; divided 720 by 27 to get 26 2/3; and averaged the two to get 26 5/6. If you want it closer, he wrote, repeat the step with the new number. That is an iteration: a rule that takes an approximation and returns a better one.
And around 150 CE Ptolemy, also in Alexandria, built the great trigonometric table of antiquity — a table of chords for every half degree, written in Babylonian base-60 fractions — and took π as 3;8,30, which is 3.14167. For the next thirteen centuries, astronomers and mathematicians from Spain to India computed in sixties. Much of the work in this prologue is, at heart, the work of making better tables.
Zero and the sine table: India and Persia
Pataliputra, Bhinmal and Ctesiphon, 499–770 CE
In 499, a 23-year-old astronomer named Aryabhata finished a short book of verses near Pataliputra on the Ganges. In it he tabulated the half-chord, the ancestor of our sine, at 24 equal steps through a quarter circle — and he built the table from its differences, the amount each entry grows by, the way you will build difference tables in Unit 7. He also gave π as 62,832/20,000 = 3.1416 and called it, carefully, “approximate”.
In 628, at Bhinmal in what is now Rajasthan, Brahmagupta wrote the first rules for computing with zero as a number in its own right: what zero added to a number gives, what a number taken from itself leaves. Combined with the Indian decimal place-value numerals, it gave the world the digits you write today. In 665 he did something just as important for this course: he showed how to read between the lines of a table.
Between India and the Mediterranean lay Persia. Its Sasanian kings (224–651) kept royal astronomical tables, the Zīj-i Shāh, at their capital Ctesiphon on the Tigris. When the empire fell in the 650s, its scholars and their tables did not vanish. A century later, thirty kilometres upriver, a new city would be built, and Persian scholars would be among the first to work in it.
The House of Wisdom: Baghdad
Baghdad, Damascus and Cairo, 762–1050
The Abbasid caliph al-Mansur founded Baghdad in 762. Within about a decade an embassy from India brought a Sanskrit astronomical text to his court, and with it the Indian numerals — the nine digits and the zero — that Europe would later call “Arabic”. His great-grandson al-Maʾmūn (reigned 813–833) made learning a policy. In the House of Wisdom (بيت الحكمة), scholars paid by the state translated Greek, Persian and Sanskrit mathematics into Arabic, and then went further than any of their sources. The first of them, for this course, was a man from Khwarazm, south of the Aral Sea.
Muḥammad ibn Mūsā al-Khwārizmī
محمد بن موسى الخوارزميYou halve the number of the roots, which in the present instance yields five. This you multiply by itself; the product is twenty-five. Add this to thirty-nine; the sum is sixty-four. Now take the root of this, which is eight, and subtract from it half the number of the roots, which is five; the remainder is three.

Fractions with a decimal point
Indian numerals came with a habit: you wrote them in dust on a board, rubbed out as you went, and kept fractions in the old base 60. In 952–953 a mathematician probably working in Damascus, al-Uqlīdisī, wrote a book that changed both. He showed how to do the Indian methods with pen and ink on paper — a calculation you could check afterwards — and, for the first time in any book that survives, he wrote decimal fractions, marking the place where the whole number ends. Raise a number by a tenth of itself, he explains, five times over: write it, write it again shifted one place, add, and mark the point.
al-Uqlīdisī
أبو الحسن الإقليدسي
A generation of giants
As the caliphs’ power waned in the tenth century, other dynasties took over the patronage of science: the Persian Buyids in Baghdad itself, the Samanids and then the Ghaznavids in the east, the Fatimid caliphs in Cairo. Most of the scholars they paid were Persian.
Abū al-Wafāʾ al-Būzjānī
أبو الوفاء البوزجانيAbū Bakr al-Karajī
أبو بكر الكرجيIbn al-Haytham (Alhazen)
الحسن بن الهيثمAbū Rayḥān al-Bīrūnī
أبو ريحان البيرونيThe Persian algebraists: Nishapur, Tus and Maragha
1048–1274
Al-Khwārizmī could solve any quadratic equation by completing a square. The cubic — an equation with x³ in it — would not yield to the same trick, and it occupied the best minds of Persia for two centuries. The story of how they attacked it is, in miniature, the story of numerical analysis: when you cannot find a formula, find a construction; when the construction will not give digits, find an iteration; and before you start, find out whether there is any root to look for.
Omar Khayyam
عمر خیّامKhayyam knew what he had not done. He had a geometric solution for every type, but no arithmetic one — no formula into which you could put the numbers and get the root out. He said so plainly, and left the problem open for whoever came next.
… possibly someone else will come to know it after us.

al-Samawʾal al-Maghribī
السموأل بن يحيى المغربيSharaf al-Dīn al-Ṭūsī
شرفالدین طوسیNaṣīr al-Dīn al-Ṭūsī
نصیرالدین طوسیThe prince’s calculator: Samarkand and Istanbul
1417–1580
Ulugh Beg, grandson of Timur, governed Samarkand and preferred mathematics to war. Between 1417 and 1420 he built a madrasa on the Registan square; between 1424 and 1429, an observatory on a hill outside the city, its great meridian arc cut into the rock. He wanted new astronomical tables, and tables need computation: sines and tangents, to more places than anyone had ever computed. To lead that work he brought to Samarkand the man this prologue began with.
We know an unusual amount about al-Kāshī, because letters he wrote in Persian to his father in Kashan survive. In them he praises the prince’s mathematics and is less generous about his colleagues: of the Samarkand scholars, only Qāḍī Zāda al-Rūmī earns his respect. He had reason to be confident. In his years in Samarkand he wrote three works that each, on its own, would have made him famous.
Jamshīd al-Kāshī
غیاثالدین جمشید کاشانی

Ulugh Beg’s astronomers completed his tables, the Zīj-i Sulṭānī, in 1437, with a catalogue of 994 stars and sine and tangent tables correct to at least eight decimal places. Qāḍī Zāda al-Rūmī, the colleague al-Kāshī respected, may have finished his sine treatise after his death. In 1449 Ulugh Beg was murdered on his own son’s orders, and the observatory was abandoned. Its arc lay buried until archaeologists dug it out in 1908.

The Samarkand tradition did not end with Ulugh Beg. A century and a half later, Taqī al-Dīn, born in Damascus in 1526, built an observatory in Istanbul for the Ottoman sultan, finished in 1579 — and in his astronomical tables he computed the trigonometric functions in decimal fractions, the first recorded use of decimals for them. In January 1580 the observatory was demolished by order of the state. Five years later, in the Netherlands, Simon Stevin published a little book on decimal fractions that Europe would treat as the beginning of the subject.
Meanwhile, elsewhere
China and Kerala
This prologue follows one river, but there were others, and two of them run straight into this course. In China, the Nine Chapters on the Mathematical Art, compiled by the first century CE and commented on by Liu Hui in 263, solves systems of linear equations by laying their coefficients out in columns on a counting board and eliminating them, column against column. It is the method you will learn in Unit 3 as Gaussian elimination — some 1,700 years before Gauss.

Zu Chongzhi, around 480, pinned π between 3.1415926 and 3.1415927 and found the fraction 355/113, a record that stood for nine centuries. Qin Jiushao, in 1247, solved polynomial equations digit by digit by a scheme close to Sharaf al-Dīn’s. And in Kerala, in southern India, Madhava of Sangamagrama found infinite series for π and for the sine in the late fourteenth century — the start of the series and truncation errors of Lesson 1-3.
The hand-over: Europe and the machines
1145–1985
In 1145, in Segovia, Robert of Chester translated al-Khwārizmī’s al-Jabr into Latin. In 1202 a young man from Pisa whose father had taken him to the customs house at Bugia, on the coast of what is now Algeria, published the Liber Abaci, which taught Europe the Hindu–Arabic numerals he had learned there. We know him as Fibonacci. Then the centres moved. Simon Stevin made decimals popular in 1585; John Napier published logarithms in 1614, giving astronomers a way to multiply by adding.
In 1669 Isaac Newton described his method for roots — the Babylonian averaging rule, it turns out, is its special case for square roots — and Joseph Raphson published a cleaner version in 1690. Leonhard Euler stepped a differential equation forward in small steps in 1768. Carl Friedrich Gauss recovered the lost asteroid Ceres in 1801 and published his method of least squares in 1809. Carl Runge (1895) and Wilhelm Kutta (1901) gave the methods for differential equations that still fly spacecraft.
Then came the machines, and with them an old question in a new form. In 1947 John von Neumann and Herman Goldstine asked whether the rounding errors of an electronic computer would ruin the solution of a large linear system. In 1948 Alan Turing studied the same question and named the quantity that decides it: the condition number. In 1985 the IEEE 754 standard, led by William Kahan, fixed exactly how a computer stores a number, rounds it and reports a failure. That standard is the subject of Lesson 1-1. It is al-Kāshī’s question — how large an error can I afford, and can I prove I stayed inside it? — asked a billion times a second.
What they left in your course
Look closely and it is everywhere
You will meet their work in this course without their names attached. Here are the names.
- algorithm — from al-Khwārizmī, Latinised as Algoritmi
- algebra — from al-jabr, “restoring”, in the title of his book
- zero, cipher — from ṣifr, “empty”, the Arabic for the Sanskrit śūnya
- root — Latin radix, translating jadhr, al-Khwārizmī’s word for the unknown
- surd — Latin surdus, “deaf”, translating aṣamm
- sine — jyā → jība → jayb → sinus
- minute, second — the first and second places of Babylonian sixtieths
- Babylonian method — square roots by averaging, YBC 7289
- al-Kashi’s theorem — the law of cosines, so called in France
- Khayyam’s triangle — the binomial triangle, so called in Iran
- Brahmagupta’s formula — second-order interpolation, 665
- Ruffini–Horner — used by Sharaf al-Dīn, al-Kāshī and Qin Jiushao first
- Heron’s method — square roots by iteration
- fangcheng — the Nine Chapters’ elimination
| Base 60, base 10, base 2 — and one tenth | Lesson 1-1 · Floating point |
| A tolerance set before computing (al-Kāshī’s hair) | Lesson 1-2 · Rounding error |
| Infinite series and where to stop (Madhava) | Lesson 1-3 · Truncation error |
| Does a root exist? (Sharaf al-Dīn) | Lesson 2-1 · Bracketing |
| Square roots by averaging (Babylon, Heron) | Lesson 2-2 · Newton’s method |
| sin 1° by iteration (al-Kāshī) | Lesson 2-3 · Fixed-point iteration |
| Elimination on a counting board (Nine Chapters) | Lesson 3-1 · Gaussian elimination |
| Turing’s condition number | Lesson 3-2 · Condition numbers |
| Least squares (Gauss and Ceres) | Lesson 5-1 · Least squares |
| Between the lines of a table (Brahmagupta, al-Bīrūnī) | Lesson 7-1 · Interpolation |
| Polygons doubled, error divided by four (Archimedes, al-Kāshī) | Lesson 8-1 · Richardson extrapolation |
| Slices summed and bounded (Ibn al-Haytham) | Lesson 8-2 · Quadrature rules |
| Small steps forward (Euler, Runge, Kutta) | Lessons 9-1, 9-2 · ODE solvers |
Turn the page
Here is the thread that runs through four thousand years. The scribe of YBC 7289 wrote √2 in sixties and stopped after three places. Al-Uqlīdisī and al-Kāshī wrote fractions in tens. Each of them knew that the digits they stopped at were not the whole number, and each of them chose where to stop.
A computer counts in twos, and it chooses where to stop for you — a fixed number of binary places, every time. Most of the time you never notice. But some very ordinary numbers have no end in base 2, however harmless they look in base 10. One of them is one tenth.
Dhahran, Saudi Arabia, 25 February 1991. A Patriot air-defence battery has been running for about a hundred hours, counting time in tenths of a second. That is Lesson 1-1. It is where the craft that began on a clay tablet in Mesopotamia meets the machine on your desk — and where you start learning to ask al-Kāshī’s question of every number your computer prints.
- M. K. Azarian, “The introduction of al-Risāla al-Muḥīṭīyya: an English translation”, International Journal of Pure and Applied Mathematics 57 (2009) 903–914; and “Al-Risāla al-Muḥīṭīyya: a summary”, Missouri Journal of Mathematical Sciences 22 (2010) 64–85.
- A. Aaboe, “Al-Kāshī’s iteration method for the determination of sin 1°”, Scripta Mathematica 20 (1954) 24–29.
- F. Rosen (tr.), The Algebra of Mohammed ben Musa, London, 1831.
- A. S. Saidan, The Arithmetic of al-Uqlīdisī, Reidel, 1978.
- R. Rashed, The Development of Arabic Mathematics: Between Arithmetic and Algebra, Kluwer, 1994.
- J. L. Berggren, Episodes in the Mathematics of Medieval Islam, 2nd ed., Springer, 2016.
- V. J. Katz, “Ideas of calculus in Islam and India”, Mathematics Magazine 68 (1995) 163–174.
- E. S. Kennedy, “The motivation of al-Bīrūnī’s second order interpolation scheme”, Proceedings of the First International Symposium for the History of Arabic Science, vol. II (1976) 67–71.
- D. Fowler and E. Robson, “Square root approximations in Old Babylonian mathematics: YBC 7289 in context”, Historia Mathematica 25 (1998) 366–378.
- K. Chemla and Guo Shuchun, Les Neuf Chapitres, Dunod, 2004.
- The MacTutor History of Mathematics archive, University of St Andrews — biographies of each mathematician named here (mathshistory.st-andrews.ac.uk); the Encyclopaedia Iranica on al-Bīrūnī; the U.S. GAO report IMTEC-92-26 (1992) on the Patriot at Dhahran.
- Where sources disagree — how the Babylonian scribe found √2, what Sharaf al-Dīn had in mind with his maxima, the dates of the Nine Chapters and of Madhava — this page says so rather than choosing.
Images: YBC 7289, Yale Peabody Museum, CC0; the meridian arc at Samarkand, photograph by Bobyrr, CC BY-SA 4.0; al-Khwārizmī’s al-Jabr (Bodleian MS. Huntington 214), Khayyam’s Treatise on Algebra, al-Uqlīdisī’s Kitāb al-fuṣūl, al-Kāshī’s Treatise on the Circumference and Key to Arithmetic, and the 1820 Nine Chapters are public-domain reproductions via Wikimedia Commons. Coastlines: Natural Earth (public domain).