Examples of monoids
A monoid is an algebraic structure with a single associative binary operation and an identity element. Formally, a monoid is a set $M$ with a binary operation $\cdot$ such that:
- Closure: For all $a, b \in M$, $a \cdot b \in M$.
- Associativity: For all $a, b, c \in M$, $(a \cdot b) \cdot c = a \cdot (b \cdot c)$.
- Identity: There exists an element $e \in M$ such that for all $a \in M$, $e \cdot a = a \cdot e = a$.
Here are some common examples of monoids:
1. Natural Numbers with Addition
- Set: $\mathbb{N}_0 = {0, 1, 2, \ldots}$
- Operation: Addition $(+)$
- Identity: 0
2. Strings with Concatenation
- Set: All strings over an alphabet $\Sigma^*$
- Operation: String concatenation
- Identity: Empty string $\varepsilon$
3. Integers with Multiplication
- Set: $\mathbb{Z}$
- Operation: Multiplication $(\cdot)$
- Identity: 1
4. Boolean Values with AND or OR
-
Set: ${\text{true}, \text{false}}$
- With AND: Identity is
true
- With OR: Identity is
false
- With AND: Identity is
5. Matrices with Matrix Multiplication
- Set: All $n \times n$ matrices over a field
- Operation: Matrix multiplication
- Identity: Identity matrix $I_n$
6. Functions from a Set to Itself (Endofunctions)
- Set: All functions $f: X \to X$
- Operation: Function composition
- Identity: Identity function $\text{id}_X$
7. Lists under Concatenation
- Set: Lists of elements (e.g., integers)
- Operation: Concatenation of lists
- Identity: Empty list
[]
Let me know if you want examples from programming (e.g., Haskell, Python), category theory, or more abstract algebra.
No comments:
Post a Comment