We know what a group is. The natural next question is: what can a group actually look like? Start as small as possible. How many groups have $1$ element? $2$? $3$? The answer every time is "just one," but that answer needs a careful meaning of "just one," because $(\{1\}, \cdot)$ and $(\{0\}, +)$ are clearly different sets with different operations. Along the way we'll pick up the tools to say what we mean: multiplication tables, isomorphism, Abelian groups, and cyclic groups. Practice sits right after each idea, and the Mixed Practice at the bottom takes that hint away.
Every argument on this page runs on three facts from Groups & Basic Properties: the identity is unique, each element has exactly one inverse, and you can cancel ($ab = ac \implies b = c$, and $ba = ca \implies b = c$).
Keep those three facts close: uniqueness of the identity, uniqueness of inverses, and cancellation. They're what pin the small groups down.
Let $G = \{g\}$. There's only one possible binary operation $*\colon G \times G \to G$, because there's only one possible output. It's given by $g * g = g$. Let's check that it's a group.
The order of a group, $|G|$, is just the cardinality of its underlying set from the Sets page: the number of elements.
Show that $G = \{g\}$ with $g * g = g$ is a group.
There was nothing to choose, so there was nothing that could go wrong. And any other group of order $1$ looks exactly the same, which is the page's first classification.
A group with one element. It's its own identity, its own inverse, and its own only friend.
There is one group of order $1$, up to "isomorphism."
Proof. The example shows a group of order $1$ exists. If $\{g\}$ and $\{h\}$ are two groups of order $1$, each has just one possible operation, $g * g = g$ and $h \circ h = h$. Renaming $g$ as $h$ turns the first one-entry table into the second, so the two are the same group with different names. $\blacksquare$
Those scare quotes are doing a lot of work. Here are three groups of order $1$:
$$(\{g\}, *), \qquad (\{1\}, \cdot), \qquad (\{0\}, +).$$
The sets and binary operations here are all different, but these are all groups of order $1$. After relabeling, they are essentially the same as algebraic objects: rename $1$ (or $0$) as $g$, and $1 \cdot 1 = 1$ (or $0 + 0 = 0$) becomes $g * g = g$. The next section makes "after relabeling" precise.
For a small group, the cleanest way to see the whole operation at once is to write out every product in a grid.
It's called a multiplication table even when the operation is addition. Algebraists call everything multiplication and dare you to complain.
Suppose that $S = \{s_1, \dots, s_n\}$ and that $*$ is a binary operation on $S$. The multiplication table for $*$ is the $n \times n$ table whose $(i, j)$-th entry is $s_i * s_j$:
$$\begin{array}{c|cccc} * & s_1 & s_2 & \cdots & s_n \\ \hline s_1 & s_1 * s_1 & s_1 * s_2 & \cdots & s_1 * s_n \\ s_2 & s_2 * s_1 & s_2 * s_2 & \cdots & s_2 * s_n \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ s_n & s_n * s_1 & s_n * s_2 & \cdots & s_n * s_n \end{array}$$
Read it like a times table: the row tells you the left factor and the column tells you the right factor. That order matters, since $s_i * s_j$ and $s_j * s_i$ don't have to be equal.
Now we can say what "essentially the same" means. Two groups are the same if renaming the elements of one turns its table into the table of the other.
"The renamed table matches" is the equation $\phi(g_1 * g_2) = \phi(g_1) \circ \phi(g_2)$ for all $g_1, g_2 \in G$: the left side is the renamed entry in row $g_1$, column $g_2$, and the right side is the entry of $H$'s table in row $\phi(g_1)$, column $\phi(g_2)$. Later, this equation becomes the official definition, and it works for infinite groups too, where there's no table to write down.
Two finite groups $(G, *)$ and $(H, \circ)$ are isomorphic, written $G \cong H$, if there is a bijection $\phi\colon G \to H$ that relabels the multiplication table of $G$ into the multiplication table of $H$: rename every element $g$ of $G$ as $\phi(g)$, and every entry of the table for $*$ becomes the matching entry of the table for $\circ$.
The relabeling has to be a bijection: every element of $G$ gets its own new name, and every name in $H$ gets used. If two elements of $G$ got the same name, or some element of $H$ were left over, the tables couldn't line up. In particular, $|G| = |H|$.
That's the Functions page's bijection, put to work: a perfect one-to-one matching between the elements of $G$ and the elements of $H$.
Here's the smallest possible check, on the three groups of order $1$ from above.
Show that $(\{1\}, \cdot) \cong (\{0\}, +)$.
$$\begin{array}{c|c} \cdot & 1 \\ \hline 1 & 1 \end{array} \qquad\qquad \begin{array}{c|c} + & 0 \\ \hline 0 & 0 \end{array}$$
Let $\phi(1) = 0$. It's a bijection, and renaming $1$ as $0$ turns the left table into the right one. So the two groups are isomorphic.
For order $1$ that's almost silly. It gets interesting once there's a choice of how to fill the table.
Suppose $G$ is a group with $|G| = 2$. One of the elements has to be the identity, so write $G = \{e, x\}$, and consider the multiplication table:
$$\begin{array}{c|cc} \cdot & e & x \\ \hline e & e & x \\ x & x & e \end{array}$$
Three of the four entries are forced by $e$ alone. The fourth is where the work is. Watch it get filled in.
That one cancellation is the whole proof.
There is only one group of order $2$, up to isomorphism.
Proof. Let $G = \{e, x\}$ be a group of order $2$.
So every group of order $2$ has the table above, with its two elements named $e$ and $x$. Given two groups of order $2$, sending identity to identity and the other element to the other element turns one table into the other, so they are isomorphic. And a group of order $2$ exists: $(\{1, -1\}, \cdot)$ in the next example is one. $\blacksquare$
Here's "another" group of order $2$.
Show that $(\{1, -1\}, \cdot)$ is isomorphic to the group above.
$$\begin{array}{r|rr} \cdot & 1 & -1 \\ \hline 1 & 1 & -1 \\ -1 & -1 & 1 \end{array}$$
Let $\phi(e) = 1$ and $\phi(x) = -1$. Renaming $e$ as $1$ and $x$ as $-1$ turns the table for $\{e, x\}$ into this one, entry by entry. So $(\{1, -1\}, \cdot) \cong \{e, x\}$.
Same table, new names. That's all an isomorphism is, and the table doesn't care what the names are.
Notice that the identity had to go to the identity. Sending $e \mapsto -1$ and $x \mapsto 1$ is still a bijection, but then the top-left entry $e \cdot e = e$ would turn into $(-1) \cdot (-1) = -1$, which is false. That's always true, and you'll prove it in a moment.
The first exercise is a warning about what isn't a group.
Here is the multiplication table of $(\{0, 1\}, \cdot)$. It has an identity, and it's a binary operation on a set with $2$ elements. Explain why it is not a group.
$$\begin{array}{c|cc} \cdot & 0 & 1 \\ \hline 0 & 0 & 0 \\ 1 & 0 & 1 \end{array}$$
The identity is $1$ (its row and column copy the headers). But $0$ has no inverse: $0 \cdot 0 = 0$ and $0 \cdot 1 = 0$, so nothing times $0$ gives $1$. So $(\{0, 1\}, \cdot)$ is not a group.
You can also see it from the order-$2$ proof: in a group of order $2$, the non-identity element squares to the identity. Here the non-identity element is $0$, and $0^2 = 0 \neq 1$.
And the promised proof. Use the "Sneak Peek" form of the relabeling, $\phi(g_1 * g_2) = \phi(g_1) \circ \phi(g_2)$.
Suppose $\phi\colon G \to H$ is a bijection with $\phi(g_1 * g_2) = \phi(g_1) \circ \phi(g_2)$ for all $g_1, g_2 \in G$. Let $e_G$ and $e_H$ be the identities. Prove that $\phi(e_G) = e_H$.
Proof. Let $h \in H$. Since $\phi$ is surjective, $h = \phi(g)$ for some $g \in G$. Then
$$\phi(e_G) \circ h = \phi(e_G) \circ \phi(g) = \phi(e_G * g) = \phi(g) = h,$$
and in the same way $h \circ \phi(e_G) = \phi(g * e_G) = h$. So $\phi(e_G)$ is an identity element of $H$. The identity of a group is unique, so $\phi(e_G) = e_H$. $\blacksquare$
Suppose $G$ is a group with $|G| = 3$. Write $G = \{e, x, y\}$. This time four entries are not forced by the identity, and each one seems to have three options. It turns out there's still no choice at all:
$$\begin{array}{c|ccc} \cdot & e & x & y \\ \hline e & e & x & y \\ x & x & y & e \\ y & y & e & x \end{array}$$
There is one group of order $3$, up to isomorphism.
Proof. Let $G = \{e, x, y\}$ be a group of order $3$.
So every group of order $3$ has the table above, and renaming its elements to match gives an isomorphism between any two of them. And a group of order $3$ exists: renaming $e, x, y$ as $0, 1, 2$ turns the table into the table of $(\{0, 1, 2\}, +)$ with addition modulo $3$, which is associative because addition of integers is. $\blacksquare$
Here's the proof as a picture. Each open cell starts with three candidates, and the three facts from the top of the page strike out all but one.
Look at the finished table: every row and every column contains $e$, $x$, and $y$ exactly once. That's not a coincidence.
The Sudoku rule. In the multiplication table of any group, every element appears exactly once in each row and exactly once in each column. A row can't repeat: if $ab = ac$, then $b = c$ by cancellation. And every element shows up: $c$ appears in row $a$ at column $a^{-1}c$, since $a(a^{-1}c) = c$. (Columns work the same way.) So if you're filling in a group table and an entry repeats in a row or column, stop: that's not a group. Other books call a multiplication table a Cayley table, and a table with no repeats in any row or column a Latin square.
The Sudoku rule is also the fastest way to fill a gap in a bigger group table. Try one: each new version is a group of order $4$, $5$, or $6$ under new names.
Loading practice engine...
The Sudoku rule is something every group table has, but it isn't enough to make a table a group. Here's a table that passes it and still fails.
Show that this table on $\{e, x, y\}$ follows the Sudoku rule but is not the table of a group.
$$\begin{array}{c|ccc} \cdot & e & x & y \\ \hline e & x & e & y \\ x & e & y & x \\ y & y & x & e \end{array}$$
The rows are $x, e, y$ and $e, y, x$ and $y, x, e$, and the columns are the same three lists, so nothing repeats in any row or column. But no row copies the headers $e, x, y$, so no element acts like an identity. A group needs one, so this isn't a group.
So it took the identity and the Sudoku rule together to pin order $3$ down. That pair is also a fast way to redo the proof. Row $x$ already has $x$ (in column $e$), so $x^2$ and $xy$ are $e$ and $y$ in some order. If $x^2 = e$, then $xy = y$, and column $y$ would have $y$ twice. So $x^2 = y$ and $xy = e$, and the Sudoku rule fills in the rest. Try building the table yourself, including the two classic wrong turns.
Tap a cell to cycle its entry. The checklist tests the group axioms as you go, and repeated entries in a row or column shake.
Now pick out the real group table from three near misses. Each wrong one breaks exactly the kind of rule the checklist was testing.
Loading practice engine...
If you tried the mission where $x$ is the identity, you saw that the letter $e$ isn't magic. The identity is whichever element acts like one, so find it by what it does, not by its name.
Loading practice engine...
Once you've found the identity, inverses are one row away: look along the element's row until you hit the identity, and read off the column.
Loading practice engine...
The table is the same table with the names shuffled, and renaming is exactly what isomorphism is about. So let's do some renaming on purpose. The three-element groups below are $(\{0, 1, 2\}, +)$ with addition modulo $3$, and the rotations $r_0, r_{2\pi/3}, r_{4\pi/3}$ of a triangle (more on those further down).
Drag the name tiles onto the slots to build $\phi$ (or tap a slot to cycle it). The middle table is $G$'s table after renaming, sorted like $H$'s table.
For addition modulo $3$ there were two isomorphisms: $x \mapsto 1, y \mapsto 2$ and $x \mapsto 2, y \mapsto 1$. Both work because $x$ and $y$ play interchangeable roles in the table ($x^2 = y$ and $y^2 = x$). Find the same thing in a different group.
Let $\omega = e^{2\pi i/3} = -\frac{1}{2} + \frac{\sqrt{3}}{2} i$, so $\omega^3 = 1$. Write the multiplication table of $(\{1, \omega, \omega^2\}, \cdot)$ and find every isomorphism from $\{e, x, y\}$ to it.
Using $\omega^3 = 1$, so $\omega^2 \cdot \omega^2 = \omega^4 = \omega$:
$$\begin{array}{c|ccc} \cdot & 1 & \omega & \omega^2 \\ \hline 1 & 1 & \omega & \omega^2 \\ \omega & \omega & \omega^2 & 1 \\ \omega^2 & \omega^2 & 1 & \omega \end{array}$$
An isomorphism must send $e \mapsto 1$ (the identity goes to the identity). That leaves two bijections, and both work:
So there are exactly $2$ isomorphisms.
A group of order $3$ is too small to hide anything inside it. Any subgroup bigger than $\{e\}$ contains $x$ or $y$, and then it contains the other one too ($x^2 = y$ and $y^2 = x$), so it's the whole group. That makes it one of the simple groups.
Look back at the three tables for orders $1$, $2$, and $3$. Two patterns jump out. First, each table is a mirror image of itself across the diagonal from top-left to bottom-right.
That's commutativity in disguise. A group is Abelian when $gh = hg$ for all $g, h \in G$ (see Groups & Basic Properties). The entry in row $g$, column $h$ is $gh$, and its mirror image across the diagonal is $hg$. Symmetric table, commuting elements: same thing. Watch the fold.
All of the groups so far are Abelian. Plenty of operations aren't commutative, though, and their tables show it right away. Here's one that isn't a group, but makes the point.
Define $a * b = 2a + b \bmod 3$ on $\{0, 1, 2\}$. Write its table and show that $*$ is not commutative.
$$\begin{array}{c|ccc} * & 0 & 1 & 2 \\ \hline 0 & 0 & 1 & 2 \\ 1 & 2 & 0 & 1 \\ 2 & 1 & 2 & 0 \end{array}$$
Row $0$, column $1$ holds $0 * 1 = 2 \cdot 0 + 1 = 1$. Its mirror cell, row $1$, column $0$, holds $1 * 0 = 2 \cdot 1 + 0 = 2$. The mirror cells differ, so $0 * 1 \neq 1 * 0$ and $*$ is not commutative.
Tap around a few tables and compare mirror cells yourself.
The smallest group that isn't Abelian has order $6$, and you'll meet it on the next page.
The second pattern is that each group is built out of a single element. In the order-$3$ table, $x^2 = y$ and $x^3 = x \cdot x^2 = xy = e$, so everything is a power of $x$.
Three nested quantifiers, $\exists\, \forall\, \exists$, coming up. As on the Logic & Equivalence page, the order matters: one $g$ has to work for every $h$, but each $h$ is allowed its own $n$.
A cyclic group is a group $G$ with the property that $$\exists g \in G \text{ such that } \forall h \in G, \ \exists n \in \mathbb{Z} \text{ such that } h = g^n.$$
The element that does the generating gets a name of its own.
An element $g \in G$ is a generator (or generating element) of $G$ if every $h \in G$ equals $g^n$ for some $n \in \mathbb{Z}$.
So a cyclic group is a group with a generator. There's compact notation for "all the powers of an element."
For $x \in G$, write $\langle x \rangle = \{x^n : n \in \mathbb{Z}\}$ if $G$ is written multiplicatively (or $\{nx : n \in \mathbb{Z}\}$ if $G$ is written additively).
With this notation, $G$ is cyclic iff $G = \langle g \rangle$ for some $g \in G$ ($G$ is generated by $g$).
Here are the groups from this page, written as cyclic groups. Watch how the powers wrap around.
1) Group with 1 element
$G = \{g\} = \langle g \rangle$ ($g^n = g$ for all $n \in \mathbb{Z}$). We'll call it $C_1$.
With two elements, the powers start alternating.
2) Group with 2 elements
$G = \{e, x\} = \langle x \rangle$, where $e = x^0 = x^2$ and $x = x^1$. We'll call it $C_2$.
$$\begin{align*} e &= \dots = x^{-4} = x^{-2} = x^0 = x^2 = x^4 = \dots \\ x &= \dots = x^{-3} = x^{-1} = x^1 = x^3 = x^5 = \dots \end{align*}$$
The even powers are $e$ and the odd powers are $x$. With three elements, the powers cycle with period $3$.
3) Group with 3 elements
$G = \{e, x, y\} = \{x^0, x^1, x^2\} = \langle x \rangle$. We'll call it $C_3$.
$$\begin{align*} e &= \dots = x^{-6} = x^{-3} = x^0 = x^3 = x^6 = \dots \\ x &= \dots = x^{-5} = x^{-2} = x^1 = x^4 = x^7 = \dots \\ y &= \dots = x^{-4} = x^{-1} = x^2 = x^5 = x^8 = \dots \end{align*}$$
Here's that sorting as a picture: every exponent drops into the row of the element it gives.
Each row is a residue class modulo $3$ in disguise: $x^a = x^b$ exactly when $a \equiv b \pmod 3$. That's the same sorting of $\mathbb{Z}$ into rows as Residue Rows on the Logic & Equivalence page.
Nothing about the number $3$ was special.
For every $n$ there's a group that works exactly like these three: $n$ elements, all of them powers of one element $x$, wrapping around after $n$ steps.
For each $n \in \mathbb{N}$, there is exactly one cyclic group of order $n$, up to isomorphism:
$$C_n = \langle x \rangle = \{x^0, x^1, x^2, \dots, x^{n-1}\}, \qquad x^n = e.$$
It is isomorphic to $(\mathbb{Z}/n\mathbb{Z}, +)$.
So "the cyclic group of order $n$" makes sense, and $C_1$, $C_2$, $C_3$ above are the first three.
The Cyclic Groups page proves this Fact and asks the next question: which elements of $C_n$ are generators? (In $C_3$, both $x$ and $y$ are.)
Many books write ℤₙ (Z with a subscript n) for ℤ/nℤ. This site always writes ℤ/nℤ: it says "the integers, with multiples of n counted as 0," and later courses use ℤₚ for something else entirely (the p-adic integers).
Powers repeat modulo $n$:
So to simplify any power $x^k$, reduce $k$ modulo $n$. The last line is worth pulling out on its own: negative powers are just positive powers in disguise.
$x^{-1000003}$ in $C_3$? Easy. $-1000003 = 3(-333335) + 2$, so it's just $x^2$. I did that for fun.
$$\begin{align*} x^{-1} &= x^{n-1} & (x x^{n-1} &= x^n = e) \\ x^{-2} &= x^{n-2} & (x^2 x^{n-2} &= x^n = e) \\ x^{-k} &= x^{n-k} & (x^k x^{n-k} &= x^n = e) \end{align*}$$
A cyclic group is a clock with $n$ positions: multiplying by $x$ moves one tick forward, multiplying by $x^{-1}$ moves one tick back, and $n$ ticks bring you home. The same clock shows up dressed in several different outfits.
In each version, the element playing the role of $x$ is "one step": the number $1$, the root $e^{2\pi i/n}$, and the rotation by $\frac{2\pi}{n}$. The rotations are the least obvious of the three, so here's the check for a triangle.
Example ($n = 3$): $G = \{r_0, r_{2\pi/3}, r_{4\pi/3}\}$ under composition of maps $\circ$, where $r_\theta\colon \mathbb{R}^2 \to \mathbb{R}^2$ is counterclockwise rotation by $\theta$ about the origin $(0, 0)$. Check that $(G, \circ)$ is a group, and that $G \cong C_3$.
Let $r = r_{2\pi/3}$. Then $r^0 = r_0 = e$, $r^1 = r_{2\pi/3}$, $r^2 = r_{4\pi/3}$, and $r^3 = r_{2\pi} = r_0$. Thus $G = \{r^0, r^1, r^2\} \cong C_3$.
Here's the generator at work: three turns, and the triangle is home.
Spin the clock yourself. Change $n$, step forward and backward, and switch between the four outfits: they all move together.
Multiply by $x$ or $x^{-1}$ to move around $C_n$. The exponent keeps counting, but the element wraps around. Switch the labels to see the other versions of $C_n$.
Practice the wrap-around by hand. Each version picks a cyclic group and one of its outfits.
Loading practice engine...
Inverses are the Note on Inverses at work: $x^{-k} = x^{n-k}$, the steps that finish the lap.
Loading practice engine...
Now mix the outfits. Each card below is an element of $C_6$ written in a different outfit, and each belongs to exactly one power of $x$.
Drag each card onto the power of $x$ it equals. In each outfit, $x$ is one step: $1$ in $\mathbb{Z}/6\mathbb{Z}$, $\omega = e^{2\pi i/6}$, and the rotation $r_{\pi/3}$.
Not everything that looks like a clock is one. Which of these groups really is a version of $C_n$?
Loading practice engine...
An isomorphism out of $C_n$ is decided by one choice: where $x$ goes. Since the renamed table has to match, $\phi(x^k) = \phi(x)^k$, which in an additive outfit like $\mathbb{Z}/n\mathbb{Z}$ means $k$ copies of $\phi(x)$ added up.
Loading practice engine...
Every cyclic group so far was finite. There's exactly one more kind.
4) Infinite cyclic group: $(\mathbb{Z}, +)$
$\mathbb{Z} = \{n \cdot 1 : n \in \mathbb{Z}\} = \langle 1 \rangle$ (additive notation).
In additive notation, "powers" of $1$ are multiples $n \cdot 1$, and the negative multiples cover the negative integers. Here the clock never comes back around: $n \cdot 1 = 0$ only when $n = 0$.
Trying to classify groups of order $n$ by looking at multiplication tables is computationally infeasible for large $n$. For example, there are $n^{n^2}$ possible binary operations on a set of cardinality $n$: the table has $n^2$ entries, and each one can be any of $n$ elements.
$n = 4$ gives $4^{16} = 4{,}294{,}967{,}296$ tables. I am not checking those by hand.
The identity and the Sudoku rule cut that down enormously, which is why orders $1$ through $3$ fell so quickly. Here's how much, counted by computer for $n = 3$, $4$, and $5$.
Up to order $4$, the identity and the Sudoku rule do all the work: every table that survives them is a group. At order $5$, $56$ tables survive and only $6$ of them are groups, so associativity finally has a job. Here's one of the $50$ that fail. Find a triple that breaks it.
Pick $a$, $b$, and $c$. The table computes $(ab)c$ along the orange cells and $a(bc)$ along the blue ones.
Past order $3$, then, we need smarter tools than brute force.
Order $4$ is the first time there's a real choice: there are exactly two groups of order $4$. The Spicy Bonus below finds them both, and the next page carries on up to order $8$.
Every question so far came right after its idea, which is a hint. Down here the hint is gone. First, true or false: a claim about anything on this page, some of them the kind that sounds right and isn't. Decide, then read why.
Loading practice engine...
Next, a proof from this page with one step missing.
Loading practice engine...
Next, the mixed set. Every question type on this page except true or false goes into one hat, and each click draws a new one at random. Flip the switch to type your answer; a few types need their answer choices, and they'll say so.
Loading practice engine...
Last, the Spicy Bonus. Push the order-$3$ argument one step further. This time the cases really do split.
Prove that there are exactly two groups of order $4$, up to isomorphism: $C_4$, and a group in which every element $g$ satisfies $g^2 = e$.
Proof. Let $G = \{e, a, b, c\}$ be a group of order $4$. We fill in the table using the Sudoku rule. No element other than $e$ can square to itself: $g^2 = g$ gives $g = e$ by cancellation.
Case 1: some element squares to something other than $e$. Call it $a$. Then $a^2 \neq e$ and $a^2 \neq a$, so $a^2$ is $b$ or $c$. Rename if necessary so that $a^2 = b$. Row $a$ now holds $ae = a$ and $aa = b$, so $ab$ is $e$ or $c$. If $ab = e$, the last entry of row $a$ is $ac = c = ec$, and cancellation gives $a = e$, a contradiction. So $a^3 = ab = c$, and the last entry of row $a$ is $a^4 = ac = e$. So $G = \{e, a, a^2, a^3\} = \langle a \rangle$ with $a^4 = e$, and every product is $a^i a^j = a^{i+j}$ with the exponent reduced modulo $4$. That's the table of $C_4$.
Case 2: every element squares to $e$. Row $a$ holds $ae = a$ and $aa = e$, so $ab$ is $b$ or $c$; $ab = b$ would give $a = e$, so $ab = c$, and then $ac = b$. The same argument in column $a$ gives $ba = c$ and $ca = b$. Row $b$ holds $be = b$, $ba = c$, and $bb = e$, so $bc = a$. Column $b$ holds $eb = b$, $ab = c$, and $bb = e$, so $cb = a$. With $c^2 = e$, every entry is forced:
$$\begin{array}{c|cccc} \cdot & e & a & b & c \\ \hline e & e & a & b & c \\ a & a & e & c & b \\ b & b & c & e & a \\ c & c & b & a & e \end{array}$$
Both tables really are groups. Case 1 is $C_4$. For Case 2, $(\{1, 3, 5, 7\}, \cdot)$ with multiplication modulo $8$ has exactly this table under $e \mapsto 1, a \mapsto 3, b \mapsto 5, c \mapsto 7$ (for example $3 \cdot 5 = 15 \equiv 7$ and $3^2 = 9 \equiv 1$), and associativity comes from multiplication of integers.
They are not isomorphic. In $C_4$, $a^2 \neq e$. In the Case 2 group, every element squares to $e$. An isomorphism $\phi$ from the Case 2 group to $C_4$ would give $\phi(g)^2 = \phi(g^2) = \phi(e) = e$ for every $g$, and every element of $C_4$ is some $\phi(g)$, so every element of $C_4$ would square to $e$, which is false.
So there are exactly two groups of order $4$, up to isomorphism. $\blacksquare$