Definite implies that each instruction which forms part of the algorithm must be unambiguous and capable of being performed in a reasonable amount of time. This can be regarded as an indefinite instruction as the appropriate degree of granularity is not precisely defined and might be interpreted in different ways by different developers. This can be regarded as a more acceptable instruction as there is a clear criterion which determines when the instruction has been completed. An instruction to count all possible integer values is definite but cannot be regarded as an acceptable part of an algorithm as the instruction cannot be completed in a finite amount of time. An alternative instruction to count the number of grains of sand on a beach can be completed in a finite amount of time, but the amount of time which it would take might be unreasonable within the context of the overall purpose of the algorithm.
Algorithms exist for many purposes and are expressed in many different ways.
Examples of algorithms include recipes in cookery books, servicing instructions in a computer's hardware manual or knitting patterns. All computer programs are expressions of algorithms, where the instructions are expressed in the computer language being used to develop the program. Computer programs are described as expressions of algorithms as an algorithm is a general technique for achieving some purpose which can be expressed in a number of different ways. In the previous section two different sorting algorithms were introduced, each of which could be used to reorder a list into some defined sequence. It would be possible to express the same algorithms as instructions to a human who had a similar requirement to reorder some list, for example to sort a list of medical record cards into a sequence determined by the date of birth on the card.