Algorithms – Jeff Erickson

Recommended

What is an algorithm?

An algorithm is an explicit, precise, unambiguous, mechanically-executable sequence of elementary instructions, usually intended to accomplish a specific purpose. For example, here is an algorithm for singing that annoying song “99 Bottles of Beer on the Wall”, for arbitrary values of 99:

BottlesOfBeer(n):
For i ← n down to 1
Sing “i bottles of beer on the wall, i bottles of beer,”
Sing “Take one down, pass it around, i − 1 bottles of beer on the wall.”
Sing “No bottles of beer on the wall, no bottles of beer,”
Sing “Go to the store, buy some more, n bottles of beer on the wall.”

The word “algorithm” does not derive, as algorithm phobic classicists might guess, from the Greek roots arithmos (άριθμός), meaning “number”, and algos (ἄλγος), meaning “pain”. Rather, it is a corruption of the name of the 9th century Persian scholar Muhammad ibn Musa al-Khwarizmı. Al-Khwarizmi is perhaps best known as the writer of the treatise Al-Kitab almukhtas.ar fıhısab algabr walmuqabala, from which the modern word algebra derives. In a different treatise, al-Khwarizmi described the modern decimal system for writing and manipulating numbers—in particular, the use of a small circle or sifr to represent a missing quantity—which had been developed in India several centuries earlier. The methods described in this latter treatise, using either written figures or counting stones, became known in English as algorism or augrym, and its figures became known in English as ciphers.

Although both place-value notation and al-Khwarizmı’s works were already known by some European scholars, the “Hindu-Arabic” numeric system was popularized in Europe by the medieval Italian mathematician and tradesman Leonardo of Pisa, better known as Fibonacci. Thanks in part to his 1202 book Liber Abaci, written figures began to replace the counting table (then known as an abacus) and finger arithmetic as the preferred platform for calculation5 in Europe in the 13th century—not because written decimal figures were easier to learn or use, but because they provided an audit trail. Ciphers became common in Western Europe only with the advent of movable type, and truly ubiquitous only after cheap paper became plentiful in the early 19th century.

Eventually the word algorism evolved into the modern algorithm, via folk etymology from the Greek arithmos (and perhaps the previously mentioned algos). Thus, until very recently, the word algorithm referred exclusively to mechanical techniques for place-value arithmetic using “Arabic” numerals. People trained in the fast and reliable execution of these procedures were called algorists or computators, or more simply, computers.

Attribution

Jeff Erickson(2019)‎. Algorithms, URL: http://jeffe.cs.illinois.edu/teaching/algorithms/

This work is available under a Creative Commons Attribution 4.0 International License. For license details, see http://creativecommons.org/licenses/by/4.0/.

VP Flipbook Maker

This book is shown with VP Online Flipbook maker. PDF can be uploaded and converted to digital flipbook in a few steps. Try it now!