A semigroup is a SS together with an associative ⋅:S×S→S\cdot : S \times S \to S, meaning that for all a,b,c∈Sa,b,c \in S,

(a⋅b)⋅c  =  a⋅(b⋅c).(a\cdot b)\cdot c \;=\; a\cdot(b\cdot c).

Semigroups are the weakest common algebraic setting in which repeated products are unambiguous (associativity lets you omit parentheses). A is a semigroup with an identity element, and a is a monoid in which every element has an inverse.

Examples
  • (N,+)(\mathbb{N},+) is a semigroup (addition is associative).
  • (N≥1,×)(\mathbb{N}_{\ge 1},\times) is a semigroup (multiplication is associative).
  • The set of all n×nn\times n real matrices under matrix multiplication is a semigroup.
  • (Edge case) If one allows empty algebraic structures, the empty set has a unique binary operation  ∅×∅→∅ \,\emptyset\times\emptyset\to\emptyset\, and is a semigroup, but it cannot be a monoid (no identity element exists).