= Binary operation
{title2=$\ast:S\times S\to S$}
{wiki}
A <binary operation> on a <set> $S$ is a <function> $\ast:S\times S\to S$. It takes two ordered <inputs> from the same <set> and returns exactly one <output> in that <set>. The <codomain> is part of the definition: ordinary <subtraction> is a <binary operation> on the <integers>, but not on the positive <integers>, since $2-3=-1$ leaves that <set>. Ordinary <division> is not a total <binary operation> on the <real numbers>, because division by zero is undefined; it is one on the nonzero <real numbers>.
The same <set> can carry several different <binary operations>. On $S=\{0,1,2\}$, both $a\ast b=(a+b)\bmod3$ and $a\diamond b=(a-b)\bmod3$ return an element of $S$, using <modular arithmetic>. Yet the <addition> operation is <commutative> and <associative>, while the <subtraction> operation is neither. Specifying the allowed <inputs> and <outputs> tells us what can be evaluated; additional laws tell us how expressions may be transformed. https://openmathbooks.org/someabstract/pdf/primer.pdf[Grassl and Mingus, Some Abstract Algebra: A Primer and Interactive Workbook, binary operations]{ref}.
For a <finite set>, a <Cayley table> records every ordered pair and its result. This turns abstract laws into checkable examples. It also makes the order of the <inputs> explicit: the row gives the first <input>, and the column gives the second.
Back to article page