Reference articles on history, science, culture and more
Encyclopedia

Binary operation

Mathematical operation with two operands

Image credit is listed at the end of this article.

In mathematics, a binary operation or dyadic operation is a kind of binary function, i.e. given a pair of input values (called operands), it produces an output value. For example, addition is a binary operation: 3+4=7. A binary operation is an operation of arity two.

Some definitions require the two inputs and the output to be elements of the same set.

Binary operations are usually written using infix notation such as a\star b rather than by functional notation of the form f(a,b). Multiplication and exponentiation are frequently written without operator, but with exponents as superscript.

In abstract algebra, a binary operation on a set S is a mapping of the elements of the Cartesian product S\times S to S:

\,f\colon S\times S\rightarrow S.

If the mapping is total, (S,f) is a magma. However, if f is a partial mapping, then f is a partial binary operation, which can be one of the operations in a partial algebra on S, such as the partial groupoid (S,f).

A binary operation f on a set S may be viewed as a ternary relation on S, that is, the set of triples (a,b,f(a,b)) in S\times S\times S for all a and b in S.

Binary operations are the keystone of most structures that are studied in algebra, in particular in semigroups, monoids, groups, rings, fields, and vector spaces.

01Examples

Arithmetic operations like addition (a+b), subtraction (a-b), and multiplication (a\times b or, using juxtaposition, ab) are binary operations on numbers. Division (a/b or a\div b) is only a partial binary operation on the set of rational numbers and the set of real numbers, because division by zero is undefined, but a (total) binary operation on the set of positive real numbers.

Union (X\cup Y), intersection (X\cap Y), and set difference (X\backslash Y) are binary operations on sets. There are 16 binary operations on binary variables, such as 'AND', 'OR', and 'XOR'.

If a broad definition of "binary operation" is used, such that the inputs and output do not have to be from the same set, then scalar multiplication (a{\vec {v}}) is an binary operator from a scalar and a vector to a vector, and dot product ({\vec {u}}\cdot {\vec {v}}) is a binary operator from two vectors to a scalar.

Function composition (g\circ h) is a binary operation on compatible functions.

02Properties

Ways to classify binary operations include:

Watch videos about Binary operationExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Binary operation, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.