![Binary function](https://www.english.nina.az/image-resize/1600/900/web/wikipedia.jpg)
In mathematics, a binary function (also called bivariate function, or function of two variables) is a function that takes two inputs.
Precisely stated, a function is binary if there exists sets such that
where is the Cartesian product of and
Alternative definitions
Set-theoretically, a binary function can be represented as a subset of the Cartesian product , where
belongs to the subset if and only if
. Conversely, a subset
defines a binary function if and only if for any
and
, there exists a unique
such that
belongs to
.
is then defined to be this
.
Alternatively, a binary function may be interpreted as simply a function from to
. Even when thought of this way, however, one generally writes
instead of
. (That is, the same pair of parentheses is used to indicate both function application and the formation of an ordered pair.)
Examples
Division of whole numbers can be thought of as a function. If is the set of integers,
is the set of natural numbers (except for zero), and
is the set of rational numbers, then division is a binary function
.
In a vector space V over a field F, scalar multiplication is a binary function. A scalar a ∈ F is combined with a vector v ∈ V to produce a new vector av ∈ V.
Another example is that of inner products, or more generally functions of the form , where x, y are real-valued vectors of appropriate size and M is a matrix. If M is a positive definite matrix, this yields an inner product.
Functions of two real variables
Functions whose domain is a subset of are often also called functions of two variables even if their domain does not form a rectangle and thus the cartesian product of two sets.
Restrictions to ordinary functions
In turn, one can also derive ordinary functions of one variable from a binary function. Given any element , there is a function
, or
, from
to
, given by
. Similarly, given any element
, there is a function
, or
, from
to
, given by
. In computer science, this identification between a function from
to
and a function from
to
, where
is the set of all functions from
to
, is called currying.
Generalisations
The various concepts relating to functions can also be generalised to binary functions. For example, the division example above is surjective (or onto) because every rational number may be expressed as a quotient of an integer and a natural number. This example is injective in each input separately, because the functions f x and f y are always injective. However, it's not injective in both variables simultaneously, because (for example) f (2,4) = f (1,2).
One can also consider partial binary functions, which may be defined only for certain values of the inputs. For example, the division example above may also be interpreted as a partial binary function from Z and N to Q, where N is the set of all natural numbers, including zero. But this function is undefined when the second input is zero.
A binary operation is a binary function where the sets X, Y, and Z are all equal; binary operations are often used to define algebraic structures.
In linear algebra, a bilinear transformation is a binary function where the sets X, Y, and Z are all vector spaces and the derived functions f x and fy are all linear transformations. A bilinear transformation, like any binary function, can be interpreted as a function from X × Y to Z, but this function in general won't be linear. However, the bilinear transformation can also be interpreted as a single linear transformation from the tensor product to Z.
Generalisations to ternary and other functions
The concept of binary function generalises to ternary (or 3-ary) function, quaternary (or 4-ary) function, or more generally to n-ary function for any natural number n. A 0-ary function to Z is simply given by an element of Z. One can also define an A-ary function where A is any set; there is one input for each element of A.
Category theory
In category theory, n-ary functions generalise to n-ary morphisms in a multicategory. The interpretation of an n-ary morphism as an ordinary morphisms whose domain is some sort of product of the domains of the original n-ary morphism will work in a monoidal category. The construction of the derived morphisms of one variable will work in a closed monoidal category. The category of sets is closed monoidal, but so is the category of vector spaces, giving the notion of bilinear transformation above.
See also
- Arity
- Unary operation
- Unary function
- Binary operation
- Iterated binary operation
- Ternary operation
References
- Clarke, Bertrand; Fokoue, Ernest; Zhang, Hao Helen (2009-07-21). Principles and Theory for Data Mining and Machine Learning. p. 285. ISBN 9780387981352. Retrieved 16 August 2016.
- Stewart, James (2011). Essentials of Multivariate Calculus. Toronto: Nelson Education. p. 591.
In mathematics a binary function also called bivariate function or function of two variables is a function that takes two inputs Precisely stated a function f displaystyle f is binary if there exists sets X Y Z displaystyle X Y Z such that f X Y Z displaystyle f colon X times Y rightarrow Z where X Y displaystyle X times Y is the Cartesian product of X displaystyle X and Y displaystyle Y Alternative definitionsSet theoretically a binary function can be represented as a subset of the Cartesian product X Y Z displaystyle X times Y times Z where x y z displaystyle x y z belongs to the subset if and only if f x y z displaystyle f x y z Conversely a subset R displaystyle R defines a binary function if and only if for any x X displaystyle x in X and y Y displaystyle y in Y there exists a unique z Z displaystyle z in Z such that x y z displaystyle x y z belongs to R displaystyle R f x y displaystyle f x y is then defined to be this z displaystyle z Alternatively a binary function may be interpreted as simply a function from X Y displaystyle X times Y to Z displaystyle Z Even when thought of this way however one generally writes f x y displaystyle f x y instead of f x y displaystyle f x y That is the same pair of parentheses is used to indicate both function application and the formation of an ordered pair ExamplesDivision of whole numbers can be thought of as a function If Z displaystyle mathbb Z is the set of integers N displaystyle mathbb N is the set of natural numbers except for zero and Q displaystyle mathbb Q is the set of rational numbers then division is a binary function f Z N Q displaystyle f mathbb Z times mathbb N to mathbb Q In a vector space V over a field F scalar multiplication is a binary function A scalar a F is combined with a vector v V to produce a new vector av V Another example is that of inner products or more generally functions of the form x y xTMy displaystyle x y mapsto x mathrm T My where x y are real valued vectors of appropriate size and M is a matrix If M is a positive definite matrix this yields an inner product Functions of two real variablesFunctions whose domain is a subset of R2 displaystyle mathbb R 2 are often also called functions of two variables even if their domain does not form a rectangle and thus the cartesian product of two sets Restrictions to ordinary functionsIn turn one can also derive ordinary functions of one variable from a binary function Given any element x X displaystyle x in X there is a function fx displaystyle f x or f x displaystyle f x cdot from Y displaystyle Y to Z displaystyle Z given by fx y f x y displaystyle f x y f x y Similarly given any element y Y displaystyle y in Y there is a function fy displaystyle f y or f y displaystyle f cdot y from X displaystyle X to Z displaystyle Z given by fy x f x y displaystyle f y x f x y In computer science this identification between a function from X Y displaystyle X times Y to Z displaystyle Z and a function from X displaystyle X to ZY displaystyle Z Y where ZY displaystyle Z Y is the set of all functions from Y displaystyle Y to Z displaystyle Z is called currying GeneralisationsThe various concepts relating to functions can also be generalised to binary functions For example the division example above is surjective or onto because every rational number may be expressed as a quotient of an integer and a natural number This example is injective in each input separately because the functions f x and f y are always injective However it s not injective in both variables simultaneously because for example f 2 4 f 1 2 One can also consider partial binary functions which may be defined only for certain values of the inputs For example the division example above may also be interpreted as a partial binary function from Z and N to Q where N is the set of all natural numbers including zero But this function is undefined when the second input is zero A binary operation is a binary function where the sets X Y and Z are all equal binary operations are often used to define algebraic structures In linear algebra a bilinear transformation is a binary function where the sets X Y and Z are all vector spaces and the derived functions f x and fy are all linear transformations A bilinear transformation like any binary function can be interpreted as a function from X Y to Z but this function in general won t be linear However the bilinear transformation can also be interpreted as a single linear transformation from the tensor product X Y displaystyle X otimes Y to Z Generalisations to ternary and other functionsThe concept of binary function generalises to ternary or 3 ary function quaternary or 4 ary function or more generally to n ary function for any natural number n A 0 ary function to Z is simply given by an element of Z One can also define an A ary function where A is any set there is one input for each element of A Category theoryIn category theory n ary functions generalise to n ary morphisms in a multicategory The interpretation of an n ary morphism as an ordinary morphisms whose domain is some sort of product of the domains of the original n ary morphism will work in a monoidal category The construction of the derived morphisms of one variable will work in a closed monoidal category The category of sets is closed monoidal but so is the category of vector spaces giving the notion of bilinear transformation above See alsoArity Unary operation Unary function Binary operation Iterated binary operation Ternary operationReferencesClarke Bertrand Fokoue Ernest Zhang Hao Helen 2009 07 21 Principles and Theory for Data Mining and Machine Learning p 285 ISBN 9780387981352 Retrieved 16 August 2016 Stewart James 2011 Essentials of Multivariate Calculus Toronto Nelson Education p 591