:: wikimiki.org ::
| Function (mathematics) |
Function (mathematics)In mathematics, a function is a relation, such that each element of a set (the domain) is associated with a unique element of another (possibly the same) set (the codomain, not to be confused with the range). The concept of a function is fundamental to virtually every branch of mathematics and every quantitative science.
The terms function, mapping, map and transformation are usually used synonymously. The term operation is frequently used for binary functions; functions whose domain is a set of functions, or a vector space, are often called operators (see also operator (programming)).
Intuitive introduction
Essentially, a function is a "rule" or procedure that assigns an "output" value to each given "input" value. The following are examples of functions:
- In a group of people, each person has a favorite colour—from the set of red, orange, yellow, green, cyan, blue, indigo, or violet. Here, the input is the person, and the output is one of the 8 colours. The favorite colour is a function of the person. For example, John has favorite colour red, while Kim has favorite colour violet. Note that more than one person may be associated with a given colour (e.g., John and Kim may both like red), but one person cannot have more or less than one favorite color.
- A stone is dropped from different stories of a tall building. The dropped stone may take 2 seconds to fall from the second story, and 4 seconds to fall from the 8th story. Here, the input is the story, and the output is the number of seconds. The relevant function describes the relationship between the time it takes the stone to reach the ground and the story. (See acceleration)
The "rule" defining a function can be specified by a formula, a relationship, or simply a table listing the outputs against inputs. The most important feature of a function is that it is consistent, or deterministic, always producing the same output from a given input. In this way, a function may be thought of as a mechanism or "machine" (a "black box") consistently converting a given valid input into its unique associated output. In certain technical contexts, the input is often called the argument of the function, and the output the value of the function.
A very common type of function occurs when the argument (input) and the value (output) are both numbers, the functional relationship is expressed by a formula, and the value (output) of the function is obtained by direct substitution of the argument into the formula. Consider for example
:
which for any number x, assigns to x the associated value the square of x.
A straightforward generalization is to allow functions depending on several arguments. For instance,
:
is a function which takes the input, two expressions x and y, and assigns to it its product (output), xy. It might seem that this is not really a function as we described above, because this "rule" depends on two inputs. However, if we think of the two inputs together as a single pair (x, y), then we can interpret g as a function -- the argument (unified single input) is the ordered pair (x, y), and the function value (output) is xy.
Such functions whose input consists of ordered pairs are called "binary" or "2-ary".
In the sciences, we often encounter functions that are not given by (known) formulas. Consider for instance the temperature distribution on earth over time: this is a function which takes location and time as arguments and gives as output value the temperature at the indicated location at the indicated moment in time.
We have seen that the intuitive notion of function is not limited to computations using single numbers and not even limited to computations; the mathematical notion of function is still more general and is not limited to situations involving numbers. Rather, a function links a "domain" (set of inputs) to a "codomain" (set of possible outputs) in such a way that every element of the domain is associated to precisely one element of the codomain. Functions are abstractly defined as certain relations, as will be seen below. Because of this generality, the function concept is fundamental to virtually every branch of mathematics and the quantitative sciences.
History
As a mathematical term, "function" was coined by Leibniz in 1694, to describe a quantity related to a curve, such as a curve's slope or a specific point of a curve. The functions Leibniz considered are today called differentiable functions, and they are the type of function most frequently encountered by nonmathematicians. For this type of function, one can talk about limits and derivatives; both are measurements of the change of output values associated to a change of input values, and these measurements are the basis of calculus.
The word function was later used by Euler during the mid-18th century to describe an expression or formula involving various arguments, e.g. f(x) = sin(x) + x3.
During the 19th century, mathematicians started to formalize all the different branches of mathematics. Weierstrass advocated building calculus on arithmetic rather than on geometry, which favoured Euler's definition over Leibniz's (see arithmetization of analysis).
By broadening the definition of functions, mathematicians were then able to study "strange" mathematical objects such as continuous functions that are nowhere differentiable. These functions were first thought to be only theoretical curiosities, and they were collectively called "monsters" as late as the turn of the 20th century. However, powerful techniques from functional analysis have shown that these functions are in some sense "more common" than differentiable functions. Such functions have since been applied to the modeling of physical phenomena such as Brownian motion.
Towards the end of the 19th century, mathematicians started trying to formalize all of mathematics using set theory, and they sought to define every mathematical object as a set. Dirichlet and Lobachevsky independently and almost simultaneously gave the modern "formal" definition of function (see formal definition below).
In this definition, a function is a special case of a relation. In most cases of practical interest, however, the differences between the modern definition and Euler's definition are negligible.
The notion of function as a rule for computing, rather than a special kind of relation, has been formalized in mathematical logic and theoretical computer science by means of several systems, including the lambda calculus, the theory of recursive functions and the Turing machine.
Formal definition
Formally a function f from a set X to a set Y, written f : X → Y, is an ordered triple (X, Y, G(f)), where G(f) is a subset of the cartesian product X × Y, such that for each x in X, there is a unique y in Y such that the ordered pair (x, y) is in G(f). X is called the domain of f, Y is called the codomain of F, and G(f) is called the graph of f. For each "input value" x in the domain, the corresponding unique "output value" y in the codomain is denoted by f(x).
Equivalently a function f can be defined as a relation between X and Y which satisfies:
# f is total, or entire: for all x in X, there exists a y in Y such that x f y (x is f-related to y), i.e. for each input value, there is at least one output value in Y.
# f is many-to-one, or functional: if x f y and x f z, then y = z. i.e., many input values can be related to one output value, but one input value cannot be related to many output values.
A relation between X and Y that satisfies condition (1) is a multivalued function. Every function is a multivalued function, but not every multivalued function is a function. A relation between X and Y that satisfies condition (2) is a partial function. Every function is a partial function, but not every partial function is a function. In this encyclopedia, the term "function" will mean a relation satisfying both conditions (1) and (2), unless otherwise stated.
Consider the following three examples:
| image:notMap1.png | This relation is total but not many-to-one; the element 3 in X is related to two elements b and c in Y. Therefore, this is a multivalued function, but not a function. |
| image:notMap2.png | This relation is many-to-one but not total; the element 1 in X is not related to any element of Y. Therefore, this is a partial function, but not a function. | |
| image:mathmap2.png | This relation is both total and many-to-one, and so it is a function from X to Y. Note that the emphasis is on "-to-one" as "many" may actually mean "one". The function can be given explicitly by specifying its graph G(f) = or as
: | | | |