Skip to content
History of Science

Who was al-Khwarizmi? How the word algorithm grew out of a person's name

The word 'algorithm', at the heart of every computer, comes from the name of a mathematician who lived in 9th-century Baghdad. We tell the story of al-Khwarizmi's life, the birth of algebra and how his name travelled from Latin to the present day.

By Kuazara Bilim EkibiPublished: Updated: 7 min read

Blue and gold geometric tile patterns radiating from the centre of a domed ceiling

Photo: Faruk Kaymak / Unsplash

In this article · 7 sections

When you watch a video on your phone, see a post on social media or look for the shortest route on a map, an algorithm is running in the background. The word sounds so modern that most people are surprised to hear it comes from the name of a man who lived about 1,200 years ago. That man was Muhammad ibn Musa al-Khwarizmi, usually known simply as al-Khwarizmi. In this post we look at who he was, what he did, and how his name became one of the most basic words in computer science.

A house of wisdom in Baghdad

What we know about al-Khwarizmi’s life is limited. He is thought to have been born around 780 and to have died around 850. The “al-Khwarizmi” part of his name suggests that his family came from Khwarazm, a region that today lies within the borders of Uzbekistan and Turkmenistan. Historians disagree about his exact birthplace and origins, so the details need to be treated with caution.

What we do know for certain is that he did most of his work in Baghdad during the reign of the Abbasid caliph al-Ma’mun (813-833). At that time Baghdad had a centre of science and translation that the sources call the Bayt al-Hikma (the House of Wisdom). Greek, Persian and Sanskrit works were being translated into Arabic, astronomical observations were being made, and mathematicians were discussing each other’s work. Indian, Greek and Mesopotamian knowledge came together here to form a new synthesis. Al-Khwarizmi was one of the most productive figures in this setting: he wrote astronomical tables, a geography book and two very influential works of mathematics.

The word algebra was born from a book

Al-Khwarizmi’s most famous work is a book thought to have been written in the 820s, al-Kitab al-mukhtasar fi hisab al-jabr wa’l-muqabala. Its long title can be translated roughly as “The compendious book on calculation by completion and balancing”. The word “al-jabr” in it passed into Latin over time as algebra and became the source of the word algebra we use today.

So what do “completion” and “balancing” mean? They are two basic moves we still make when solving an equation:

  • Al-jabr (completion): removing a subtracted term from one side of an equation by adding it to both sides.
  • Al-muqabala (balancing): simplifying the equation by cancelling like terms that appear on both sides.

For example, in the equation 3x−5=103x - 5 = 10, adding 5 to both sides is “completion”: 3x=153x = 15. What you do when you solve equations at secondary school is, at heart, the method described in al-Khwarizmi’s book.

Al-Khwarizmi did not use symbols; he wrote his equations entirely in words. He used phrases such as “a square and ten roots equal thirty-nine dirhams”. In today’s language this is the equation x2+10x=39x^2 + 10x = 39. To solve this example he took a geometric route: he added rectangles along the sides of a square and completed the shape into a larger square. This is the method we now call “completing the square”:

x2+10x+25=39+25=64⇒(x+5)2=64⇒x=3x^2 + 10x + 25 = 39 + 25 = 64 \quad\Rightarrow\quad (x+5)^2 = 64 \quad\Rightarrow\quad x = 3

Because negative numbers were not accepted as solutions at the time, al-Khwarizmi gave only the result x=3x = 3.

The word algorithm was born from a name

Al-Khwarizmi’s second important work is a book explaining how to calculate with Indian numerals. It became one of the most influential works in carrying the decimal place-value system and zero into the Islamic world, and from there to Europe. Here is the curious part: the Arabic original of the book has not survived. All we have are Latin translations made in the 12th century.

One of these Latin translations opens with the words “Dixit Algorizmi...”, meaning “Algorizmi said...”. European translators fitted the name al-Khwarizmi to Latin pronunciation, turning it into Algorizmi or Algoritmi. Over time the name came to stand for the method the book taught: calculating step by step with Hindu-Arabic numerals began to be called “algorism”.

The word changed shape over the centuries. Under the influence of the Greek word arithmos, meaning “number”, it became algorithm. Its meaning widened too: at first it meant only the method of calculating with numerals, but eventually it came to mean “a clearly defined sequence of steps followed to solve a problem”. It is in this last sense that the word entered Turkish as algoritma, and that we use algorithm in English today.

What exactly is an algorithm?

An algorithm is a set of steps for doing a job, followed in order, free of ambiguity and coming to an end. We use algorithms without computers too:

  1. When you add numbers in a column, you start with the ones column.
  2. If the total is 10 or more, you carry the extra to the next column.
  3. You repeat this until all the columns are done.

This is an algorithm you learnt at primary school, and it is exactly the kind of method al-Khwarizmi’s book taught Europe. A recipe, a method for solving a Rubik’s cube or a method for finding the greatest common divisor of two numbers are all algorithms too.

Myth or fact?

Some of the claims about al-Khwarizmi circulating online are exaggerated. It is worth separating them out:

  • “Al-Khwarizmi wrote the first algorithm.” This is not true. For example, the method for finding the greatest common divisor of two numbers, known today as the “Euclidean algorithm”, was written down in Ancient Greece more than a thousand years before him. Al-Khwarizmi did not invent the algorithm; the word comes from his name.
  • “Al-Khwarizmi invented zero.” This is wrong too. The use of zero as a number developed in India. Al-Khwarizmi’s contribution was to explain the system clearly and in a teachable way, which helped it spread.
  • “He discovered algebra on his own.” The Babylonians could solve types of quadratic equations thousands of years earlier, and the Greek mathematician Diophantus had also worked on equations. What makes al-Khwarizmi special is that he took algebra beyond the solution of particular problems and presented it as a discipline in its own right, with systematic rules. This is why many historians count him among the founders of algebra.

A trail that leads to today

Once al-Khwarizmi’s works were translated into Latin, they had a deep influence on mathematics education in Europe. Liber Abaci, written in 1202 by the Italian mathematician Leonardo Fibonacci, also played a big part in spreading Hindu-Arabic numerals in Europe. If you think about how laborious it is to multiply and divide with Roman numerals, you can guess how much easier this change made trade and science.

Today, whenever a search engine ranks results, a navigation app works out a route or a game character dodges an obstacle, step-by-step instructions are running. Each of them is a descendant of a concept that carries the name of a mathematician who lived in Baghdad. The next time you hear the word “algorithm”, remember that you are actually saying a person’s name.

Summary

  • Al-Khwarizmi was a mathematician and astronomer who lived roughly between 780 and 850 and worked in the scientific community of Baghdad.
  • The word algebra comes from “al-jabr” in the title of his book.
  • The word algorithm derives from “Algoritmi”, the Latin form of his name.
  • He did not invent the algorithm or zero, but he presented algebra as a systematic field and played a key role in spreading Indian numerals.
  • The “add to both sides, simplify” steps you take when solving an equation are a direct legacy of the methods in his book.

Frequently asked

4 questions

Who was al-Khwarizmi?

Al-Khwarizmi was a mathematician, astronomer and geographer who lived roughly between 780 and 850 and worked in Baghdad. He is known for the book that presented algebra as a systematic discipline and for his work explaining Indian numerals.

Where does the word algorithm come from?

In the 12th-century Latin translations of his book, al-Khwarizmi's name was written as 'Algoritmi' or 'Algorizmi'. Over time the name came to mean a step-by-step method of calculation and turned into today's word 'algorithm'.

What does the word algebra mean?

Algebra comes from the Arabic word 'al-jabr', which carries the meaning of 'completion, restoring'. It describes removing subtracted terms by adding the same term to both sides of an equation.

Did al-Khwarizmi write the first algorithm?

No. Step-by-step methods such as the Euclidean algorithm existed long before him. Al-Khwarizmi did not invent the algorithm; the word 'algorithm' derives from his name.

Sources

3 sources
  1. 1.MacTutor History of Mathematics — Abu Ja'far Muhammad ibn Musa Al-Khwarizmi (opens in a new tab)mathshistory.st-andrews.ac.uk
  2. 2.Encyclopaedia Britannica — al-Khwārizmī
  3. 3.Katz, V. J. — A History of Mathematics: An Introduction, Pearson
  • #al-khwarizmi
  • #algorithm
  • #algebra
  • #history of mathematics
  • #house of wisdom