Algorithm
...

Intuitively, an algorithm is a sequence of steps that we can carry out to obtain the answer to a given problem, like a recipe.

However, to formalize this idea, we must distinguish between recipes that always produce the correct response, and recipes that may fail to do so under some circumstances:

  • A procedure is a finite sequence of steps to solve a given problem, that always produces the correct solution if it stops. However, it may not stop.
  • An algorithm is a procedure that always stops.

These two notions are formalized in the concept of a Turing machine.