# What is an algorithm?

Japanese: アルゴリズム

**In one line:** An algorithm is a clearly defined set of steps or method of calculation for solving a problem or reaching a goal.

An algorithm is a set of steps for solving a problem or doing a job. Think of a recipe. “First do this, then do that,” in order. The word comes from al-Khwarizmi, a Persian mathematician who worked around the 800s. The same problem can be solved fast or slow. It depends on how clever the steps are. Looking for a name in a phone book? If you open it in the middle first, that is a fine algorithm too. You use algorithms every day without knowing. Getting dressed has one. Socks before shoes.

**Common mix-up:** An algorithm is not the program itself. It is the idea of the steps; a program is those steps written for a computer.

**Where the word comes from**

Around 825, al-Khwarizmi, a Persian scholar working in Baghdad, wrote a book on calculating with the numerals that came from India, the ancestors of our 0 to 9. When the book was translated into Latin, his name was written something like “Algorithmi,” and the word algorithm grew from it. In medieval Europe, “algorism” meant doing arithmetic with those new numbers.

**Old and fast recipes**

One of the oldest recorded algorithms is Euclid’s method for finding the greatest common divisor of two numbers, from his Elements, around 300 BC. A favorite today is binary search: look at the middle of a sorted list, decide whether what you want is in the first or second half, and keep cutting in half. Even with a million items, it takes only about 20 steps. One good idea can change the time needed by huge amounts.

**How people use it**

- “Google changed its algorithm, and our site dropped in the rankings.”
- “Even folding laundry has its own algorithm in our house.”

**FAQ**

- Is an algorithm the same as a program? — No. An algorithm is the idea of the steps; a program is those steps written for a computer.
- How is an algorithm different from a program? — An algorithm is the idea of the steps: what to do, in what order. A program is those steps written in a language a computer can run.
- What is “the algorithm” on social media? — It is the set of rules that decides which posts to show you and in what order, based on what you watch and how you react.
- Where does the word come from? — From the name of al-Khwarizmi, a ninth-century Persian scholar. The Latin spelling of his name in translations of his math book became the word.

Topic: Tech
Published: 2026-11-15
Source URL: https://eli5.net/en/w/algorithm
日本語: https://eli5.net/w/algorithm
