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


{\displaystyle 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
⋆
b


{\displaystyle a\star b}

rather than by functional notation of the form



f
(
a
,
b
)


{\displaystyle 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


{\displaystyle S}

is a mapping of the elements of the Cartesian product



S
×
S


{\displaystyle S\times S}

to



S


{\displaystyle S}

:

f
:
S
×
S
→
S
.


{\displaystyle \,f\colon S\times S\rightarrow S.}

If the mapping is total,



(
S
,
f
)


{\displaystyle (S,f)}

is a magma. However, if



f


{\displaystyle f}

is a partial mapping, then



f


{\displaystyle f}

is a partial binary operation, which can be one of the operations in a partial algebra on



S


{\displaystyle S}

, such as the partial groupoid



(
S
,
f
)


{\displaystyle (S,f)}

.
A binary operation



f


{\displaystyle f}

on a set



S


{\displaystyle S}

may be viewed as a ternary relation on



S


{\displaystyle S}

, that is, the set of triples



(
a
,
b
,
f
(
a
,
b
)
)


{\displaystyle (a,b,f(a,b))}

in



S
×
S
×
S


{\displaystyle S\times S\times S}

for all



a


{\displaystyle a}

and



b


{\displaystyle b}

in



S


{\displaystyle 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.

v
→





{\displaystyle {\vec {u}}\cdot {\vec {v}}}

) is a binary operator from two vectors to a scalar.
Function composition (



g
∘
h


{\displaystyle g\circ h}

) is a binary operation on compatible functions.

Properties

Ways to classify binary operations include:

The commutative property:



a
⋆
b
=
b
⋆
a


{\displaystyle a\star b=b\star a}

The associative property:



(
a
⋆
b
)
⋆
c
=
a
⋆
(
b
⋆
c
)


{\displaystyle (a\star b)\star c=a\star (b\star c)}

Having an identity element



e


{\displaystyle e}

:



a
⋆
e
=
a
=
e
⋆
a


{\displaystyle a\star e=a=e\star a}

Each element of



S


{\displaystyle S}

having an inverse element:




a

−
1


⋆
a
=
e
=
a
⋆

a

−
1




{\displaystyle a^{-1}\star a=e=a\star a^{-1}}

See also
Iterated binary operation: repeated application of a binary operation to reduce a collection of values to a single combined value
Operator (computer programming): a construct in computing that often represents a binary operation
Unary operation: an operation with arity one
Ternary operation: an operation with arity three

Notes

References
Fraleigh, John B. (1976), A First Course in Abstract Algebra (2nd ed.), Reading: Addison-Wesley, ISBN 0-201-01984-1
Hall, Marshall Jr. (1959), The Theory of Groups, New York: Macmillan
Hardy, Darel W.; Walker, Carol L. (2002), Applied Algebra: Codes, Ciphers and Discrete Algorithms, Upper Saddle River, NJ: Prentice-Hall, ISBN 0-13-067464-8
Rotman, Joseph J. (1973), The Theory of Groups: An Introduction (2nd ed.), Boston: Allyn and Bacon

External links
Weisstein, Eric W. "Binary Operation". MathWorld.