Binary Operator — Definition, Formula & Examples
A binary operator is an operation that takes exactly two inputs (called operands) and combines them to produce a single output. Addition, subtraction, multiplication, and division are all binary operators you already use every day.
A binary operator on a set is a function that assigns to each ordered pair of elements in exactly one element in . When the output always remains in , the set is said to be closed under that operation.
Key Formula
Where:
- = The binary operator (the rule applied to the two inputs)
- = The set from which both inputs are drawn and in which the output lands
How It Works
A binary operator sits between two operands: . The operator could represent addition, multiplication, or any rule you define. For the operation to be well-defined, every valid pair of inputs must produce exactly one output. Properties like commutativity () and associativity () may or may not hold, depending on the specific operator.
Worked Example
Problem: Define a binary operator on the integers by the rule . Evaluate and determine whether is commutative.
Evaluate: Substitute and into the rule.
Test commutativity: Now compute using the same rule.
Compare: Since , the two results differ.
Answer: , and the operator is not commutative because swapping the operands changes the result.
Why It Matters
Binary operators are the foundation of algebraic structures like groups, rings, and fields studied in abstract algebra and discrete mathematics. Understanding them is essential in computer science, where operations on data types (bitwise AND, OR, XOR) are all binary operators that drive Boolean circuits and algorithms.
Common Mistakes
Mistake: Confusing a binary operator (two operands) with a unary operator (one operand).
Correction: Negation () and the absolute value () act on a single input, making them unary. A binary operator always requires two inputs, like .
