A function is an abstract model of computation: you give it some input, and
it produces a result. The essential aspect is that the result is completely determined by the input: if you repeatedly apply the same function to the same
argument, you will always obtain the same result. Examples of functions include:
• An inquiry to a telephone directory service: you supply a person’s name,
and the service provides the corresponding telephone number;
• The mathematical sin function: you give it an angle, and the function
returns the sin of that angle;
• An addition circuit in a computer’s processor; you give it a pair of binary
numbers, and it returns the binary representation of their sum.