Binary Operation: Definition, Properties & Examples

#Algebra
TL;DR
A binary operation on a set $S$ is a rule that takes two elements of $S$ and returns exactly one element that is still in $S$. Addition and multiplication on the integers are binary operations; division on the integers is not, because $6 \div 4$ lands outside the set. The properties worth knowing are closure, commutativity, associativity, the identity element, and the inverse element.
BT
Bhanzu TeamLast updated on September 4, 202614 min read

What Is A Binary Operation?

A binary operation on a set $S$ is a rule that assigns to every ordered pair of elements from $S$ a single element of $S$. In symbols, a binary operation $\ast$ takes an input from $S \times S$ and produces an output in $S$:

$$\ast : S \times S \to S$$

Two facts sit inside that one line. The word "binary" means the operation needs two inputs. The output must also belong to $S$, the same set the inputs came from, and that second condition is called closure. Closure is not an extra rule bolted on afterwards, it is baked into the arrow $\to S$.

The everyday operations you already know are the first examples. Addition combines $3$ and $4$ into $7$, and multiplication combines them into $12$. Each is a function that takes two numbers and returns one. A binary operation is the general name for that pattern, studied on its own so the same reasoning works far beyond ordinary numbers, including on sets, matrices, and symmetries.

Because a binary operation is a function of two variables, it belongs to the wider world of relations and functions. The input is a pair, the output is a single value, and every pair gets exactly one output.

What Does Closure Mean For A Binary Operation?

Closure means the result of the operation never leaves the set. If $a$ and $b$ are in $S$, then $a \ast b$ must also be in $S$. When that fails for even one pair, the operation is not a binary operation on $S$.

Addition is closed on the integers $\mathbb{Z}$: add any two whole numbers, positive or negative, and the answer is another integer. Multiplication is closed there too. Subtraction is also closed on $\mathbb{Z}$, since $2 - 5 = -3$ is still an integer.

Division tells a different story. Take the integers again:

$$6 \div 4 = 1.5 \notin \mathbb{Z}$$

The two inputs are integers, but the output is not. So division is not a binary operation on $\mathbb{Z}$. Move to the non-zero rationals or real numbers and division becomes closed, which shows the same operation can pass or fail depending on the set you choose. The set is half of the definition.

Subtraction shows the same set-sensitivity. On the natural numbers $\mathbb{N} = {1, 2, 3, \dots}$, the pair $3$ and $5$ breaks it: $3 - 5 = -2$, which is not a natural number. So subtraction is a binary operation on $\mathbb{Z}$ but not on $\mathbb{N}$.

Which Operations Are Valid Binary Operations On Each Number Set?

Most confusion about binary operations is really confusion about closure. This one table settles the common cases. A tick means the operation is closed on that set, so it is a valid binary operation there.

Table: Whether each operation is a valid binary operation on the standard number sets.

Operation

Natural numbers $\mathbb{N}$

Integers $\mathbb{Z}$

Rationals $\mathbb{Q}$

Reals $\mathbb{R}$

Addition $+$

Yes

Yes

Yes

Yes

Multiplication $\times$

Yes

Yes

Yes

Yes

Subtraction $-$

No ($3-5 \notin \mathbb{N}$)

Yes

Yes

Yes

Division $\div$

No

No ($6\div4 \notin \mathbb{Z}$)

No (cannot divide by $0$)

No (cannot divide by $0$)

Read the set first, then the operation. Division fails on every standard set because dividing by zero has no answer, though it becomes closed once zero is removed. The lesson repeats: an operation is only "binary on $S$" when the whole $S \times S$ grid stays inside $S$.

Is A Binary Operation Always Commutative Or Associative?

No. A binary operation is not automatically commutative or associative. These are extra properties an operation may or may not have, and checking them is a separate step from checking closure.

An operation $\ast$ on $S$ is commutative when the order of the inputs does not change the answer:

$$a \ast b = b \ast a \quad \text{for all } a, b \in S$$

Addition and multiplication are commutative: $3 + 4 = 4 + 3$. Subtraction is not, and one counterexample is enough to prove it:

$$2 - 1 = 1 \qquad \text{but} \qquad 1 - 2 = -1$$

An operation is associative when regrouping three inputs does not change the answer:

$$(a \ast b) \ast c = a \ast (b \ast c) \quad \text{for all } a, b, c \in S$$

Addition passes. Subtraction fails, and again one case proves it:

$$(5 - 3) - 2 = 0 \qquad \text{but} \qquad 5 - (3 - 2) = 4$$

Example 1: Test $a \ast b = a + 2b$ on the integers for commutativity.

Compute both orders with $a = 1$, $b = 3$.

$1 \ast 3 = 1 + 2(3) = 7$

$3 \ast 1 = 3 + 2(1) = 5$

Since $7 \neq 5$, the operation is not commutative. This is the "wrong path" many learners take, assuming any operation can be reordered like addition. One unequal pair settles it.

Final answer: $a \ast b = a + 2b$ is closed on $\mathbb{Z}$ but not commutative.

What Are Identity And Inverse Elements?

These two ideas are separate, and mixing them up is one of the most common errors in the topic, so hold them apart from the start.

An identity element is a single special element $e$ in $S$ that leaves every element unchanged:

$$a \ast e = e \ast a = a \quad \text{for all } a \in S$$

For addition the identity is $0$, because $a + 0 = a$. For multiplication the identity is $1$, because $a \times 1 = a$. There is at most one identity for a given operation, and it works for the whole set at once. This mirrors the role of the identity matrix in matrix multiplication, where multiplying by $I$ changes nothing.

An inverse element is different. Once an identity $e$ exists, the inverse of a particular element $a$ is the element $b$ that combines with $a$ to give back $e$:

$$a \ast b = b \ast a = e$$

Under addition, the inverse of $5$ is $-5$, because $5 + (-5) = 0$. Under multiplication on the non-zero rationals, the inverse of $5$ is $\tfrac{1}{5}$, because $5 \times \tfrac{1}{5} = 1$. The identity is one element for the entire set; an inverse is attached to each element individually.

Inverses also depend on the set. On the natural numbers, $3$ has no additive inverse, because $-3$ is not a natural number. The identity ($0$) may sit outside $\mathbb{N}$ as well, which is exactly why the naturals under addition do not form a group while the integers do.

What Are Examples And Non-Examples Of Binary Operations?

The fastest way to build intuition is to sort real operations into "yes" and "no." A yes needs two inputs from $S$ and one output back in $S$.

Valid binary operations:

  • Addition on the integers. Closed, commutative, associative, identity $0$, every element has an inverse.

  • Multiplication on the real numbers. Closed, commutative, associative, identity $1$; every non-zero element has an inverse.

  • Union and intersection on sets. For subsets of a fixed universal set, $A \cup B$ and $A \cap B$ are again subsets, so both are binary operations. See operations on sets for the full rules.

  • Maximum of two numbers, written $a \ast b = \max(a, b)$. Closed on the reals, commutative, associative, but no inverse in general.

Not binary operations (on the stated set):

  • Division on the integers. $6 \div 4$ leaves $\mathbb{Z}$, so closure fails.

  • Subtraction on the natural numbers. $3 - 5$ leaves $\mathbb{N}$.

  • Square root on the reals. It takes one input, not two, so it is a unary operation, not a binary one.

That last non-example is worth a second look. "Binary" is about the number of inputs, not about binary digits or base-2. A rule that acts on a single element, like negation or square root, is unary. A binary operation always needs a pair.

How Do You Read A Binary Operation Table?

A binary operation on a small finite set can be written out in full as a table, sometimes called a Cayley table. The row element is the first input, the column element is the second, and the cell where they meet holds $a \ast b$.

Here is addition modulo $4$ on $S = {0, 1, 2, 3}$. "Modulo $4$" means you add normally, then keep only the remainder after dividing by $4$, so $3 + 2 = 5$ becomes $1$.

Table: The operation $\oplus$ is addition modulo 4 on the set {0, 1, 2, 3}.

$\oplus$

0

1

2

3

0

0

1

2

3

1

1

2

3

0

2

2

3

0

1

3

3

0

1

2

The table proves several things at a glance: every cell holds a member of $S$, so the operation is closed. The grid is symmetric across the main diagonal, which means $a \oplus b = b \oplus a$, so it is commutative. Row $0$ repeats the headers unchanged, so $0$ is the identity. And every row contains a $0$, which locates each element's inverse: the inverse of $3$ is $1$, because $3 \oplus 1 = 0$.

Why Do Binary Operations Matter?

Binary operations were pulled out and named because mathematicians noticed the same handful of rules governing objects that look nothing alike. Adding integers, multiplying fractions, combining symmetries of a triangle, and joining sets all obey versions of closure, associativity, and identity. Naming the pattern lets one proof cover all of them at once.

That abstraction pays off in two directions:

  • It builds the ladder of algebraic structures. A set with one associative binary operation is a semigroup; add an identity and it becomes a monoid; add inverses for every element and it becomes a group. Groups, rings, and fields are all just sets carrying one or two binary operations with specified properties. The whole tower of modern algebra rests on this single idea.

  • It separates the operation from the numbers. Once you can reason about "an associative operation with an identity," you no longer need to reprove facts for addition, then again for multiplication, then again for function composition. You prove it once for any operation with those properties, and it holds everywhere the properties hold.

The reason closure sits at the centre is now clearer. Without closure there is no structure to study, because applying the operation could throw you out of the system entirely. Binary operations are the grammar of algebra, and closure is the rule that keeps every sentence inside the language.

Who Invented The Idea Of A Binary Operation?

The operations came first by thousands of years; the idea of studying an operation as an object in its own right is surprisingly modern. People added and multiplied for millennia before anyone asked what a general "operation" was.

Two figures anchor the story:

  • Évariste Galois (1811–1832, France) built the concept of a group while studying when equations can be solved, working with an operation on the symmetries of a problem years before the general definition of a binary operation existed.

  • Arthur Cayley (1821–1895, England) gave operations an abstract, tabulated form, turning "an operation" into a mathematical object and laying the groundwork for the modern definition $\ast : S \times S \to S$.

Where Are Binary Operations Used In The Real World?

The two-in-one-out pattern runs under a lot of technology, usually invisibly.

  • Computing and logic: the operations AND, OR, and XOR each take two bits and return one bit, so a processor is a vast network of binary operations on the set ${0, 1}$.

  • Cryptography: modular arithmetic, the same addition-modulo idea from the table above, is a binary operation at the heart of RSA and many encryption schemes.

  • Error detection: a checksum combines data values with a binary operation so a single flipped bit changes the result and gets caught.

  • Databases: joining and intersecting tables mirror union and intersection, binary operations on collections of records.

  • Physics and graphics: composing two rotations or two transformations is a binary operation on the set of symmetries, which is why the order can matter.

One idea, "combine two, stay inside the set," runs logic gates, secret codes, and data systems that otherwise share nothing. Mathematics is the common language across fields that look unrelated.

What Are The Most Common Binary Operation Mistakes?

These three errors account for most lost marks on binary operations, and each matches a counterexample that appears throughout university lecture notes on the topic.

Forgetting to check closure

Where it slips in:

A learner declares division a binary operation on the integers, or subtraction a binary operation on the natural numbers, without testing whether the output stays in the set.

Don't do this:

Do not assume an operation is valid just because you can compute it. Being able to calculate $6 \div 4$ does not make division closed on $\mathbb{Z}$.

The correct way:

Test the output against the set. Find one pair whose result leaves $S$ and the operation is not binary on $S$. For division on $\mathbb{Z}$, $6 \div 4 = 1.5 \notin \mathbb{Z}$ ends the discussion.

Assuming every operation is commutative or associative

Where it slips in:

A learner reorders or regroups inputs to make the arithmetic easier, treating an unfamiliar operation like ordinary addition.

Don't do this:

Do not assume $a \ast b = b \ast a$ or $(a \ast b) \ast c = a \ast (b \ast c)$. These hold only when you have proven them for that specific operation.

The correct way:

Prove commutativity and associativity in general, or disprove them with a single counterexample. Subtraction settles both: $2 - 1 \neq 1 - 2$, and $(5-3)-2 \neq 5-(3-2)$.

Confusing the identity element with an inverse element

Where it slips in:

A learner is asked for the additive inverse of $5$ and answers $0$, mixing the element that changes nothing with the element that undoes $5$.

Don't do this:

Do not treat identity and inverse as the same thing. The identity is one element for the whole set; an inverse is specific to each element and returns the identity.

The correct way:

Separate the two questions. The identity under addition is $0$ ($a + 0 = a$). The inverse of $5$ is the element that gives $0$ back, namely $-5$, because $5 + (-5) = 0$.

Practice Problems On Binary Operations

Work each one, then check against the answer that follows.

  1. Is subtraction a binary operation on the set of real numbers $\mathbb{R}$?
    (Answer: Yes. For any real $a, b$, the value $a - b$ is real, so subtraction is closed on $\mathbb{R}$.)

  2. Define $a \ast b = a + b - ab$ on the real numbers. Find $2 \ast 3$.
    (Answer: $2 + 3 - (2)(3) = 5 - 6 = -1$.)

  3. For the operation in problem 2, find the identity element $e$.
    (Answer: Solve $a + e - ae = a$, giving $e(1 - a) = 0$ for all $a$, so $e = 0$.)

  4. Is division a binary operation on the set of non-zero real numbers?
    (Answer: Yes. Dividing two non-zero reals gives a non-zero real, so it is closed on that set.)

  5. Using addition modulo $5$ on ${0,1,2,3,4}$, find the inverse of $2$.
    (Answer: $3$, because $2 \oplus 3 = 5 \equiv 0 \pmod 5$.)

  6. Is the operation $a \ast b = a^{b}$ commutative on the positive integers?
    (Answer: No. $2 \ast 3 = 8$ but $3 \ast 2 = 9$, so $a^{b} \neq b^{a}$ in general.)

Where Should You Go Next After Binary Operations?

Binary operations are the doorway into abstract algebra, and a few natural paths open from here.

  1. Relations and functions. A binary operation is a function of two variables, so tightening your grip on functions makes the definition feel obvious.

  2. Operations on sets. Union and intersection are binary operations on sets, and they show closure and identity in a non-number setting.

  3. Types of functions. Injective, surjective, and bijective functions decide when inverses exist, which is the same question binary operations raise about inverse elements.

If your child is building these foundations, a live Bhanzu trainer teaches binary operations starting from the "why" (the closure rule and the structures it builds) in the Bhanzu algebra program.

Book a Free Demo

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is a binary operation in simple words?
A binary operation is a rule that takes two elements from a set and gives back one element of the same set. Addition is the clearest example: two numbers go in, one number comes out.
Is subtraction a binary operation?
Yes on the integers and reals, where the result always stays in the set. No on the natural numbers, because a subtraction like $3 - 5$ gives $-2$, which is not a natural number.
What is the difference between the identity element and an inverse element?
The identity element is one special element that leaves every element unchanged, such as $0$ for addition. An inverse element is tied to a particular element and combines with it to produce the identity, such as $-5$ being the additive inverse of $5$.
Does "binary" mean base-2 or binary numbers?
No. Here "binary" refers to the two inputs the operation takes, not to base-2 or binary digits. An operation with one input, like square root, is called unary instead.
How do you know if a binary operation is commutative from its table?
Check whether the table is symmetric across the main diagonal. If the entry in row $a$, column $b$ equals the entry in row $b$, column $a$ for every pair, the binary operation is commutative.
Where do students learn binary operations in school?
They appear in India's NCERT senior-secondary syllabus under relations and functions, and in the UK's A-Level Further Mathematics, then again in first-year university group theory, where they become the foundation of abstract algebra.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →