A recipe with no judgement
What Makes Something an Algorithm?
An algorithm is a set of steps so precise that following them needs no thinking.
-
Step 1 of 5
Ordinary instructions rely on judgement.
A recipe saying season to taste assumes a cook who can decide. A machine has no taste and no opinion, so that instruction is useless to it.
-
Step 2 of 5
Every step must have exactly one meaning.
There can be no room for interpretation. Each instruction has to produce the same result whoever, or whatever, carries it out.
-
Step 3 of 5
Decisions are allowed if the test is precise.
If this, then that is perfectly fine as long as the condition can be checked without opinion, such as comparing two numbers.
-
Step 4 of 5
Repetition does the heavy lifting.
A short list of steps repeated many times can sort thousands of items. The instructions stay small while the work becomes large.
-
Step 5 of 5
It has to stop.
A procedure that never finishes is not much use. A genuine algorithm reaches an end for every input it is designed to handle.
The word comes from al-Khwarizmi, a ninth-century Persian mathematician whose name reached Latin as Algoritmi.
The short version
An algorithm is a sequence of steps precise enough to need no judgement, with definite decisions, and it always finishes.
Try it yourself
Write instructions for making toast, then have someone follow them absurdly literally. Every vague step becomes obvious immediately.
Topics