User:Isheden/sandbox6

Introduction
Informally we can think of a function as a machine that takes an object as input and spits out a corresponding object as output. The symbol for the input to a function is often represented by the letter x or, if the input is a particular time, by the letter t. The symbol for the output is often represented by the letter y. The function itself is often called f, and thus the notation y = f(x) indicates that a function named f has an input named x and an output named y.



If a function is often used, it may be given a special name as, for example, the signum function of a real number x, defined as follows:
 * $$ \sgn(x) = \begin{cases}

-1 & \text{if } x < 0, \\ 0 & \text{if } x = 0, \\ 1 & \text{if } x > 0. \end{cases}$$

The set of all permitted inputs to a given function is called the domain of the function. The set of all resulting outputs is called the image or range of the function. The image is often a subset of a set of permissable outputs, called the codomain of the function. Thus, for example, the function f(x) = x2 could take as its domain the set of all real numbers, as its image the set of all non-negative real numbers, and as its codomain the set of all real numbers. In that case, we would describe f as a real-valued function of a real variable. It is not enough to say "f is a function" without specifying the domain and the codomain, unless these are known from the context. A formula such as $$f(x)=\sqrt{x^2-5x+6}$$ is not a properly defined function on its own, however it is standard to take the largest possible subset of R as the domain (in this case x ≤ 2 or x ≥ 3) and R as the codomain.(Bloch, pp. 129-134)

Different formulas or algorithms may describe the same function. For instance f(x) = (x+1)(x−1) is exactly the same function as f(x) = x2−1. Furthermore, a function does need not be described by a formula, expression, or algorithm, nor need it deal with numbers at all: the domain and codomain of a function may be arbitrary sets. One example of a function that acts on non-numeric inputs takes English words as inputs and returns the first letter of the input word as output.

Intuitively, a function is a rule that assigns to each element x in a set X a unique element y in a set Y. However, it is not quite accurate to speak of a function as being a rule. . The difficulty in defining a function in this way is that the terms "rule" and "assign" are not defined earlier, and therefore this definition, although intuitively appealing, is not logically precise. Defining function as a rule of assignment leads to going in circles.(Bloch, pp. 129-134)

A function can be described more accurately as a collection of pairs of elements with the following property: if (a, b) and (c, d) are both in the collection, then b = c. Thus, the collection does not contain two different pairs with the same first element. If x is in the domain of f, it follows that there is a unique y such that (x, y) is in f, and this unique y is denoted by f(x).

The terms transformation, operator, map, and mapping are synonymous to function, although by convention they are only used in some specific contexts. Other specific types of functions include functionals.