binary operation
Binary operation

In mathematics, binary operation is a rule for combining two elements to produce another element. More specifically, a binary operation on a set is binary function (a function that takes two inputs) that maps every pair of elements of the set to an element of the set.
Symbolically, a binary operation \[\ast\] on a set \[S\] is a mapping of the elements of the Cartesian product \[S\times S\] to \[S\], i.e. \[\ast:S\times S\to S\]. For convenience we usually write \[a\ast b\] instead of \[\ast(a,b)\].
Here are three examples of what does and does not constitute a binary operation.
- Let \[S=\mathbb{R}\] and \[\ast\] be \[+\]. For \[a,b\in \mathbb{R}\], \[a\ast b=a+b\] and \[a+b\in \mathbb{R}\]. This is a binary function.
- Let \[S=\mathbb{Z}\] and \[a\ast b=\text{max} \left\{ a,b \right\}\], i.e. the largest of \[a\] and \[b\]. This is a binary function.
- Let \[S=\mathbb{R}\] and \[a\ast b=\frac{a}{b}\]. This is NOT a binary function as it's not defined when \[b=0\].
Commutative and associative binary operations
Let \[\ast\] be a operation on a set \[S\]. \[\ast\] is:
-
Commutative, if \[\forall\, a,b\in S,\,a\ast b=b\ast a\]
.svg.png)
-
Associative, if \[\forall\, a,b,c\in S,\,a\ast(b\ast c)=(a\ast b)\ast c\]
.svg.png)
Note that \[\forall\] represents "for all".