Mathwords logoMathwords

Monoid — Definition, Formula & Example

A monoid is a set with one way of combining elements. Grouping does not change the result of that operation, and the set contains a neutral element that leaves everything unchanged. Unlike a group, a monoid does not require elements to have inverses.

A monoid is a triple (M,∗,e)(M, \ast, e) where MM is a set and ∗:M×M→M\ast : M \times M \to M is a binary operation. It must satisfy two axioms. (1) Associativity: (a∗b)∗c=a∗(b∗c)(a \ast b) \ast c = a \ast (b \ast c) for all a,b,c∈Ma, b, c \in M. (2) Identity: there is an element e∈Me \in M with e∗a=a∗e=ae \ast a = a \ast e = a for all a∈Ma \in M. Equivalently, a monoid is a semigroup with a two-sided identity element. That identity is necessarily unique.

Key Formula

(a∗b)∗c=a∗(b∗c),e∗a=a∗e=a(a \ast b) \ast c = a \ast (b \ast c), \qquad e \ast a = a \ast e = a
Where:
  • a,b,ca, b, c = Any elements of the set M
  • ∗\ast = The binary operation, which must produce an element of M (closure)
  • ee = The identity element of M

Worked Example

Problem: Show that the integers under multiplication, (Z,×)(\mathbb{Z}, \times), form a monoid. Then show that they do not form a group.
Step 1: Closure holds because the product of two integers is an integer. Multiplication of integers is associative. Check one instance with 2, 3, and 5.
(2×3)×5=6×5=30,2×(3×5)=2×15=30(2 \times 3) \times 5 = 6 \times 5 = 30, \qquad 2 \times (3 \times 5) = 2 \times 15 = 30
Step 2: The identity is 11, since 1×a=a×1=a1 \times a = a \times 1 = a for every integer aa. For example, take a=7a = 7.
1×7=7×1=71 \times 7 = 7 \times 1 = 7
Step 3: A group would also need every element to have an inverse. For 22, you would need an integer xx with 2x=12x = 1. The only solution is x=12x = \tfrac{1}{2}, which is not an integer.
2x=1  ⟹  x=12∉Z2x = 1 \implies x = \tfrac{1}{2} \notin \mathbb{Z}
Answer: (Z,×)(\mathbb{Z}, \times) is a monoid with identity 11. It is not a group, because elements such as 22 (and 00) have no multiplicative inverse in Z\mathbb{Z}.

Why It Matters

Monoids show up throughout computer science. Strings under concatenation form a monoid with the empty string as identity. In automata theory, each regular language has an associated finite syntactic monoid. Parallel frameworks such as MapReduce rely on associativity and an identity to split a fold across machines and merge the partial results safely.

Common Mistakes

Mistake: Treating any closed, associative operation as a monoid, such as the positive integers {1,2,3,… }\{1, 2, 3, \dots\} under addition.
Correction: That structure is only a semigroup. Its identity would have to be 00, and 00 is not in the set. Always confirm that an identity element exists inside the set and works on both sides.

Related Terms