Closure, Semigroup and Monoid: Worked Algebraic Structure Examples
Learn a reliable order for testing closure, associativity and identity. Worked tables and counterexamples show exactly when a structure becomes a semigroup or monoid.
KnowledgeGate Team
Exam prep & CS education

Closure, associativity, semigroup and monoid are easy to memorise as separate definitions. The trouble starts when a question changes the set or operation, and the entire classification shifts. Use one order of checks and one operation table to test a candidate set-operation pair through the monoid conditions. A one-operation algebraic structure uses a single binary operation. Group Theory and Algebraic Structures: Groups, Rings and Fields Explained continues from monoids to groups, rings and fields; first, test closure, associativity and a two-sided identity in full.
1. Algebraic structures: move from closure to monoid in the right order
Start with a non-empty set S and a rule *. It is a binary operation on S only when every pair in S × S produces an element of S. This closed pair (S, *) is commonly called a magma in the one-operation hierarchy. A closed associative operation forms a semigroup. A semigroup with a two-sided identity forms a monoid.
The implications run one way. Every monoid is a semigroup, and every semigroup has a closed associative operation. Each converse needs extra evidence. An inverse for every element turns the monoid into a group.
There is one terminology detail. If a question declares *: S × S → S, closure is built into “binary operation”. If it merely gives a formula, you must still test closure.

2. Closure: test the result against the stated set
Closure requires a * b ∈ S for every a, b ∈ S. One successful pair proves nothing. One counterexample disproves closure.
Take S = {0, 1, 2, 3} under addition modulo 4. Here 3 ⊕ 2 = 1, which returns to S. A complete proof must cover arbitrary elements or every cell of the finite table.
Now take the odd integers under ordinary addition. They are not closed because 3 + 5 = 8, and 8 is not odd. All integers are closed under addition because the sum of any two integers is again an integer.
For a finite table, scan every body entry. Each must appear among the row and column labels. A table on {0, 1, 2, 3} containing 4 is not closed unless the stated rule reduces it, as modulo 4 does.
3. Associativity: brackets change, operand order does not
Associativity means (a * b) * c = a * (b * c) for every triple a, b, c ∈ S. Closure alone does not guarantee it. Ordinary subtraction is closed on the integers, yet
(5 - 3) - 1 = 2 - 1 = 1,
while
5 - (3 - 1) = 5 - 2 = 3.
Associativity changes the brackets but keeps a, b and c in the same order. Commutativity asks whether a * b = b * a, so a calculation that swaps operands does not prove associativity.
The proof burden also matters. One failed triple disproves associativity, while a few successful triples do not prove it. A four-element set has 4³ = 64 ordered triples. If the operation comes from a known associative law, prove it algebraically for arbitrary elements instead of sampling convenient cases.
4. Worked example: classify addition modulo 4 step by step
Let S = {0, 1, 2, 3} and define a ⊕ b = (a + b) mod 4. Its complete Cayley table is:
| 0 | 1 | 2 | 3 |
|---|---|---|---|---|
0 | 0 | 1 | 2 | 3 |
1 | 1 | 2 | 3 | 0 |
2 | 2 | 3 | 0 | 1 |
3 | 3 | 0 | 1 | 2 |
All 16 body entries are in S, so closure holds.
For arbitrary a, b, c ∈ S,
(a ⊕ b) ⊕ c = (((a + b) mod 4) + c) mod 4 = (a + b + c) mod 4,
and
a ⊕ (b ⊕ c) = (a + ((b + c) mod 4)) mod 4 = (a + b + c) mod 4.
Thus ⊕ is associative. For (3, 2, 1):
(3 ⊕ 2) ⊕ 1 = 1 ⊕ 1 = 2,
3 ⊕ (2 ⊕ 1) = 3 ⊕ 3 = 2.
Row 0 proves 0 ⊕ a = a, and column 0 proves a ⊕ 0 = a. Hence 0 is a two-sided identity and (S, ⊕) is a monoid. Its inverse pairs are (0, 0), (1, 3) and (2, 2), so it is also a group, an extra property not needed for the monoid test.

5. Semigroup without identity, and why the identity must be two-sided
Consider P = {1, 2, 3, ...} under ordinary addition. The sum of two positive integers is positive, so the operation is closed. Integer addition is associative. Therefore, (P, +) is a semigroup.
It is not a monoid. If e were an additive identity, a + e = a would force e = 0, but 0 ∉ P. Compare this with the non-negative integers N₀ = {0, 1, 2, ...}. Addition remains closed and associative, while 0 ∈ N₀ and 0 + a = a + 0 = a. Hence (N₀, +) is a monoid.
An identity must work on both sides, especially for a non-commutative operation. It is also unique. If e and f are both two-sided identities, then e * f = f because e is a left identity, and e * f = e because f is a right identity. Therefore, e = f.
One-sided identities are not enough. On S = {x, y}, define a * b = b. The operation is associative because both (a * b) * c and a * (b * c) equal c. Every element is a left identity because e * a = a, but no element is a right identity: x * y = y and y * x = x. This semigroup has no two-sided identity, so it is not a monoid.
6. How exams turn the definitions into short classification problems
Common tasks: classify a pair, find an identity, or disprove it at the first failure.
For integers, define a * b = a + b + 2. Closure holds. Also,
(a * b) * c = (a + b + 2) + c + 2 = a + b + c + 4,
a * (b * c) = a + (b + c + 2) + 2 = a + b + c + 4.
Thus * is associative. Also, a * e = a gives e = -2, and a * (-2) = (-2) * a = a. Therefore (ℤ, *) is a monoid.
Drill the table: check all 16 cells, explain why one triple is not a proof, find 0 from its row and column, then classify. Continue with Discrete Mathematics MCQs for mixed practice.
7. Closure, associativity and identity traps to avoid
Trap | Why it fails | Better check |
|---|---|---|
One pair for closure | Other pairs may fail | Prove all pairs |
One successful triple | Other triples may fail | Prove all triples |
Reordered operands | Tests commutativity | Keep the order |
Left identity only | A monoid needs both sides | Check row and column |
Identity outside | Identity must belong to | Test membership |
Every semigroup is a monoid | Identity may be absent | Find a two-sided identity |
The identity row proves e * a = a; its column proves a * e = a. A neat table does not prove associativity.
Check closure, associativity, then a two-sided identity. Stop at the first failure.
8. Closure, semigroup and monoid: the short version
Closure keeps every result inside the set. Associativity makes that closed structure a semigroup. A two-sided identity inside the set makes it a monoid. Inverses come later for a group. Remember S = {0, 1, 2, 3}, 3 ⊕ 2 = 1, and identity 0 as your memory check. For a structured route, use Engineering Mathematics for GATE Exam. Build the wider plan with GATE Guidance by Sanchit Sir and the GATE category.
Keep learning

Graphical Method in Linear Programming: Feasible Region, Corner Points and Optimality with a Worked Example
Learn the two-variable graphical method in the right order, then solve and audit a complete maximisation model without trusting the sketch alone.

Duality in LP: Construct the Dual, Solve a Worked Example, and Apply Key Properties
Learn a reliable matrix-first method to form an LP dual, solve both programs to value 21, and use duality properties to check optimality and avoid sign errors.

Commutative Property and Abelian Groups: Tests, Worked Examples and Exam Traps
Learn how to separate commutativity from the other group axioms, test custom operations step by step, and avoid the usual classification traps.

Classification of Finite and Infinite Groups: Orders, Cyclicity and Worked Examples
Learn how group axioms, group order, element order and generators classify finite and infinite groups through complete, checkable examples.