Module 1 · 16 min read · Free chapter
Monoids and groups
A semigroup is closed and associative, a monoid adds an identity and a group adds inverses. By Lagrange's theorem the order of a subgroup divides the order of the group. A cyclic group of order n has φ(n) generators, and the smallest non-abelian group has order 6.
Start from zero: arithmetic on a clock
A train leaves at 20:00 and the journey takes 7 hours. When does it arrive? Not at 27:00, because the station clock wraps round after 24, so the answer is 03:00. Adding hours on a clock is a new kind of arithmetic, where .
This clock addition keeps some familiar habits. Adding 0 changes nothing, every time has a "go back" time that returns you to 00:00, and the order of brackets in a chain of additions does not matter. Ordinary multiplication of whole numbers keeps some of these habits too, but not all, since you cannot undo multiplication by 2 inside the whole numbers.
This chapter asks a simple question: which rules does an operation obey? Collections of rules give names to structures: semigroup, monoid and group. Once you know the structure, a whole set of results comes free.
Why it matters. Groups are the mathematics of symmetry and of reversible operations. They are behind error-correcting codes, the arithmetic of public-key cryptography and the hashing of strings, and GATE asks short but sharp questions on them.
Binary operations and closure
A binary operation on a set takes two elements a, of and returns one element , which must again be in . That last requirement is closure. Addition is a binary operation on the integers, but subtraction is not a binary operation on the natural numbers, because is not natural.
A set with one binary operation is sometimes called a groupoid or magma. Two properties are checked first. The operation is associative if for all a, , , and commutative if for all a, .
On a finite set, a binary operation is just a filled-in table. A set of elements gives an table with cells, and each cell can hold any of the elements. So there are binary operations on it. A commutative operation is fixed by the diagonal and the cells above it, which number , so there are commutative ones.
Worked example. On a set of 2 elements there are binary operations, and of them are commutative. On a set of 3 elements there are binary operations, and are commutative.
Why it matters. Closure is the most common reason a candidate structure fails in a GATE question. The table view also shows why so few operations are associative, since that property must be checked for every triple.
Semigroups, monoids and groups
Structures are built by adding one rule at a time. A semigroup is a set with a closed and associative operation. A monoid is a semigroup with an identity element , such that for every a. A group is a monoid in which every element a has an inverse , with .
If the operation of a group is also commutative, the group is abelian. So the ladder is: closed, then associative (semigroup), then identity (monoid), then inverses (group), then commutative (abelian group).
| Structure | Semigroup? | Monoid? | Group? |
|---|---|---|---|
| with from 1 | yes | no identity | no |
| with from 0 | yes | yes, | no inverses |
| yes | yes, | no, 2 has no inverse | |
| yes | yes | yes, abelian | |
| nonzero rationals under | yes | yes | yes, abelian |
| Strings under concatenation | yes | yes, empty string | no |
Note that is not even a semigroup, because but . Also, is a monoid but not a group, because 0 has no inverse; removing 0 repairs it.
Worked example. Define on the integers. It is closed and associative, since both groupings give . The identity is 1, because , and the inverse of a is , because . So is an abelian group.
Why it matters. The structure names are a shorthand for which algebra is allowed. In a monoid you can combine and have a neutral starting value, which is exactly what a parallel "reduce" or "fold" operation in programming needs.
Basic group laws and group tables
A few laws follow from the group axioms in one or two lines each. The identity is unique: if and are both identities, then . Each element has a unique inverse, , and the inverse of a product reverses the order: .
The cancellation laws say that implies , and implies . Multiply on the left or right by to see this. As a result, the equation always has exactly one solution, .
Cancellation has a striking effect on the operation table of a finite group. In each row, the entries for different are all different, so every element appears exactly once in each row, and likewise in each column. Such a table is a Latin square, which gives a quick test: a table with a repeated entry in a row cannot be a group.
Worked example. Fill the table of a group of order 3. The row and column of copy the headers. In row a, the entry cannot be a (else ) and cannot be (else would have to be , giving ), so and . The rest is then forced, and the group is cyclic: a, , .
A useful fact for GATE: if every element satisfies , the group is abelian. The reason is that each element is its own inverse, so .
Why it matters. These laws let you solve equations in any group as if it were ordinary algebra, except that you must keep the order of factors. The Latin-square test lets you reject a non-group table in seconds.
Order of an element and groups of integers mod n
The order of a group, written , is its number of elements. The order of an element a is the smallest positive integer with . In a finite group every element has a finite order, and an element and its inverse have the same order.
The most common finite groups in exams are built from remainders. is the set under addition , and it is an abelian group of order . In , the element 2 has order 3, because , while 1 and 5 have order 6.
Multiplication is trickier. The set under is never a group, because 0 has no inverse. The units , the numbers a with , do form a group under , and its order is Euler's . When is prime, every non-zero remainder is a unit, so under is a group of order .
Worked example. In under multiplication mod 7, find the order of 3. The powers are 3, , 6, , and . So 3 has order 6, which equals the order of the group, and 3 generates the whole group.
By contrast, under multiplication mod 6 is not a group. For example , which is not in the set, so closure already fails. The units mod 6 are only , a group of order .
Why it matters. The group of units is the stage on which RSA and Diffie–Hellman key exchange are performed. Element orders decide how secure such schemes are, and GATE often asks which of several mod-n structures is a group.
Subgroups and Lagrange's theorem
A subgroup of a group is a subset that is itself a group under the same operation. Every group has the two trivial subgroups and . In , the set is a subgroup, because sums of its elements mod 12 stay inside and each has an inverse inside.
Checking all the axioms is not needed. The one-step test says that a non-empty subset is a subgroup exactly when for all a, in . For a finite non-empty subset, closure alone is enough, because the powers of each element eventually return to .
Two subgroups always meet in a subgroup, since their intersection passes the one-step test. Their union, however, is usually not a subgroup. In , and are subgroups, but their union is not, because is missing. In fact the union is a subgroup only when one subgroup contains the other.
Lagrange's theorem is the main counting tool. If is a subgroup of a finite group , then divides . The reason is that the cosets aH, the copies of shifted by each a, all have elements and split into disjoint blocks.
Worked example. A group of order 12 can only have subgroups of order 1, 2, 3, 4, 6 or 12. A group of order 7, a prime, can have only and itself as subgroups, so every non-identity element generates the whole group and the group is cyclic.
The converse of Lagrange's theorem is false. The alternating group , the 12 even permutations of four objects, has no subgroup of order 6, even though 6 divides 12. For cyclic groups, however, the converse does hold, as the next section shows.
Why it matters. Lagrange's theorem rules out impossible answers in seconds. It also gives Fermat's little theorem, , which is used in primality tests and in cryptography.
Cyclic groups and generators
A group is cyclic if some element a produces every element as a power, . Such an a is a generator. is cyclic with generator 1, and is cyclic with generator 1 as well.
Cyclic groups are the simplest groups. Every cyclic group is abelian, since . Every subgroup of a cyclic group is again cyclic. And for each divisor of , a cyclic group of order has exactly one subgroup of order , so here the converse of Lagrange's theorem holds.
How many generators are there? In the element generates the group exactly when . So a cyclic group of order has generators, and more generally it has elements of order for each divisor of .
Worked example. In , the generators are the with , namely 1, 5, 7 and 11, so there are of them. The element 8 has order and generates the subgroup . The divisors of 12 are 1, 2, 3, 4, 6 and 12, so has exactly six subgroups.
For a group of prime order , every element except has order , so every such element is a generator and there are generators. A non-cyclic example is the Klein four-group , in which every non-identity element has order 2, so no single element produces all four.
Why it matters. Cyclic groups model anything that repeats, from clock arithmetic to the rotation of a circular buffer. The count of generators is the most common group question in GATE.
GATE-style questions on structures
GATE questions on this topic follow a few patterns, and a fixed checklist answers most of them. Check closure first, then associativity, then the identity, then inverses, and finally commutativity. Stop at the first failure and name the structure that the earlier steps give.
Pattern 1: an unusual operation. Let on the natural numbers . It is closed and associative, and the identity is 1, since for every a. But no element above 1 has an inverse, because forces . So it is a commutative monoid, not a group.
Pattern 2: small groups. Every group of order 1, 2, 3 or 5 is cyclic, since these orders are prime or 1. A group of order 4 is either the cyclic group or the Klein four-group , and both are abelian. So every group of order at most 5 is abelian, and the smallest non-abelian group is , the 6 permutations of three objects.
Pattern 3: counting. The symmetric group has elements and is non-abelian for . The number of elements of order 2 in is , namely the element 5. The number of generators of is .
Worked example. On the set under multiplication mod 8, the table shows , and . Every element is its own inverse, so the group is abelian with every non-identity element of order 2. It is therefore a copy of the Klein four-group, not of , even though it has 4 elements.
Why it matters. A clear checklist turns a confusing definition into four quick tests. It also guards against the most common slip, which is declaring a group without checking that every element has an inverse.
Descriptive lens: how written papers ask this
Written papers for scientist posts and university-level tests ask about groups in four ways:
- Verify that a given set and operation form a semigroup, monoid or group, showing each axiom.
- Prove a standard result, such as the uniqueness of the identity or .
- State and prove Lagrange's theorem using cosets, and draw a consequence from it.
- Find the generators and subgroups of a given cyclic group.
Practice questions (our own, not previous-year questions).
- Show that the integers form an abelian group under , and find the identity and the inverse of a. (8 marks)
- State and prove Lagrange's theorem for finite groups, and deduce that a group of prime order is cyclic. (12 marks)
- List all generators and all subgroups of and draw the subgroup diagram. (10 marks)
Answer plan for question 2.
- State the theorem: if is a subgroup of a finite group , then divides .
- Define the left coset aH as the set of all products ah with in , and show that each coset has exactly elements because forces .
- Show that two cosets are either equal or disjoint, so the cosets split into blocks of equal size.
- Conclude that equals the number of cosets times , so divides .
- Deduce that in a group of prime order , the subgroup generated by any has order dividing and greater than 1, so it is the whole group and is cyclic.
Quick revision
- A binary operation must be closed, and a set of elements has of them.
- Semigroup means closed and associative, monoid adds an identity, and group adds inverses.
- is a semigroup, is a monoid, and is an abelian group.
- The identity and inverses are unique, and .
- Each element appears once in every row and column of a group table.
- under is a group exactly when is prime.
- Lagrange's theorem says that divides , but has no subgroup of order 6.
- A cyclic group of order has generators and one subgroup for each divisor of .
- Groups of order at most 5 are abelian, and of order 6 is the smallest non-abelian group.
- If for every element, the group is abelian.