In mathematics, a semigroup with two elements is a semigroup for which the cardinality of the underlying set is two. There are exactly five distinct nonisomorphic semigroups having two elements:
The semigroups LO2 and RO2 are antiisomorphic. O2, ({0,1}, ∧) and (Z2, +2) are commutative, LO2 and RO2 are noncommutative. LO2, RO2 and ({0,1}, ∧) are bands and also inverse semigroups.
Choosing the set A = { 1, 2 } as the underlying set having two elements, sixteen binary operations can be defined in A. These operations are shown in the table below. In the table, a matrix of the form
indicates a binary operation on A having the following Cayley table.
In this table:
The Cayley table for the semigroup ({0,1}, ) is given below:
This is the simplest non-trivial example of a semigroup that is not a group. This semigroup has an identity element, 1, making it a monoid. It is also commutative. It is not a group because the element 0 does not have an inverse, and is not even a cancellative semigroup because we cannot cancel the 0 in the equation 1·0 = 0·0.