The current term of choice for a problem-solving procedure, algorithm, is commonly used nowadays for the set of rules a machine (and especially a computer) follows to achieve a particular goal. It does not always apply to computer-mediated activity, however.
Algorithms are used as specifications for performing calculations and data processing. More advanced algorithms can use conditionals to divert the code execution through various routes (referred to as automated decision-making) and deduce valid inferences (referred to as automated reasoning).
Algorithms exist for many such infinite classes of questions; Euclid’s Elements, published about 300 bce, contained one for finding the greatest common divisor of two natural numbers.
Algorithms use a set of initial data or input, process it through a series of logical steps or rules, and produce the output (i.e., the outcome, decision, or result).
A finite set of unambiguous instructions that, given some set of initial conditions, can be performed in a prescribed sequence to achieve a certain goal and that has a recognizable set of end conditions. [Variant (probably influenced by arithmetic) of algorism.]