A **binary operation** is a calculation that combines two elements (operands) from a set to produce another element of the same set. In formal mathematics, it is defined as a function \( B: S \times S \to S \), where \( S \) is a set and \( S \times S \) denotes the Cartesian product of \( S \) with itself.
Articles by others on the same topic
A binary operation on a set is a function . 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 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 , both and return an element of , 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. [ref]
https://openmathbooks.org/someabstract/pdf/primer.pdf. Grassl and Mingus, Some Abstract Algebra: A Primer and Interactive Workbook, binary operations
.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.