## Clocks, Groups, and Commutative Rings

Before moving onto the next topic, let us take stock of some of what we have seen before. We began by examining braids and the "strange arithmetic" they exhibit under the operation of concatenation. Then, we saw a similar "arithmetic" that could be applied to permutations under the operation of composition -- only to see again many of the same "nice properties" encountered when looking at braids. These in turn were largely shared with the more familiar rules for combining powers. As one has hopefully guessed, there are many contexts in which these "nice properties" (and others) appear.

Indeed -- more recently, we have examined the arithmetic of integers and how this compares to that for polynomials. Unlike braids and permutations, with integers and polynomials we can actually examine two different operations (addition and subtraction). Addition for each seemed to share many of the "nice" properties enjoyed by braids and permutations. However, multiplication shared fewer (for example, multiplicative inverses are not generally present).

Seeing these differences, it will be helpful to develop some verbiage that we can attach to any "arithmetics" we might explore to identify more succinctly exactly what properties are enjoyed by their related operation(s)

To this end, let us remind ourselves of the key properties shared by braids under concatenation, permutations under composition, (non-zero) powers under multiplication, and integers and polynomials under addition:

In each case, we had a set of elements that we were combining and an operation for combining them. If we denote this set by $G$ and write the operation in a multiplicative way (even though it might represent something different -- e.g., concatenation, composition, even addition), then in each case:

 When we combine any two elements of $G$ with the operation in question, we get another element of $G$ (i.e., $G$ is closed with regard to this operation.) The operation is associative for all elements $x$, $y$, and $z$ in $G$. That is to say, $(xy)z = x(yz)$. There is some element $I$ (also sometimes denoted by $1$) in $G$ that serves as an identity (i.e., for any $x$ in $G$, we have $x \cdot I = I \cdot x = x$). Every element $x$ in $G$ has an inverse element $x^{-1}$ in $G$, where $x \cdot x^{-1} = x^{-1} \cdot x = I$

Interestingly, regardless of the context in which the properties above appear, there are often smaller groups of elements sitting inside each such set $G$ that exhibit the same exact properties.

As an example of this, consider the set $G$ of all permutations on $4$ elements: $1$, $2$, $3$, and $4$. Note that there are $4! = 24$ permutations in $G$. Now consider the smaller group $G_1$ (sitting inside of $G$) that consists of the following $4$ permutations (written in cycle notation): $$G_1 = \{(1), (1,2,3,4), (1,3)(2,4), (1,4,3,2)\}$$

Note first that this smaller group $G_1$ is itself closed under composition too -- as can be seen in the table below. $$\begin{array}{r|c|c|c|c|} & (1) & (1,2,3,4) & (1,3)(2,4) & (1,4,3,2)\\\hline (1) & (1) & (1,2,3,4) & (1,3)(2,4) & (1,4,3,2)\\\hline (1,2,3,4) & (1,2,3,4) & (1,3)(2,4) & (1,4,3,2) & (1)\\\hline (1,3)(2,4) & (1,3)(2,4) & (1,4,3,2) & (1) & (1,2,3,4)\\\hline (1,4,3,2) & (1,4,3,2) & (1) & (1,2,3,4) & (1,3)(2,4)\\\hline \end{array}$$

As can also be seen above: $(1)$ serves as the identity; inverses for each permutation in $G_1$ exist and can also be found in $G_1$ (specifically, $(1,2,3,4)^{-1} = (1,4,3,2)$, $[(1,3)(2,4)]^{-1} = (1,3)(2,4)$, and $(1)^{-1} = (1)$); and associativity holds automatically in $G_1$ because it holds in the larger group $G$.

There are other groups of permutations in the larger set of $24$ that behave similarly. For example, we would see the same properties hold in all of the following groups of permutations: $$\begin{array}{rcl} G_2 &=& \{(1), (1,2,3), (1,3,2)\}\\ G_3 &=& \{(1), (1,4)(2,3)\}\\ G_4 &=& \{(1), (1,2,4), (1,4,2)\}\\ G_5 &=& \{(1), (1,3), (2,4), (1,3)(2,4)\} \end{array}$$ The above list is not exhaustive -- there are many other such groups.

While the context was slightly different, Evariste Galois saw similar groups of elements sitting inside other groups of elements, but sharing the same properties. In documents finished only late at night the morning before he engaged in a dual that would end in his death at the young age of $20$ in 1832, Galois laid the foundations for what would be an entirely new branch of mathematics called group theory.

In this new branch of mathematics, we define a group to be a combination of a set $G$ and an operation that satisfies the previously enumerated four properties (i.e., closure, associativity, an identity, and inverses).

Recalling that in some of the groups we looked at (e.g., powers of a given variable under multiplication, integers under addition) we had the additional "nice property" of commutativity, whereas in others we didn't -- we call a group whose operation is commutative an abelian group, named after the Norwegian mathematician Niels Henrik Abel.

Related joke -- Question: "What's purple and commutes?" Answer: "an abelian grape!" 😂

Armed with the verbiage of groups, we can now more succinctly describe the even broader common features shared by the arithmetics of the integers (which recall are denoted by $\mathbb{Z}$) and polynomials with integer coefficients (which we denote by $\mathbb{Z}[x]$).

In doing so, remember that quotients of integers can sometimes be integers, but need not be. Similarly, quotients of polynomials are sometimes expressible as a polynomial, but other times they are not. Recalling that a quotient is just a product of an element and its multiplicative inverse, we see that the root of both of these behaviors stems from the absence of a guarantee that multiplicative inverses exist in the set of integers or the set of polynomials.

Also note that when dealing with two operations -- as one has with both integers and polynomials (i.e., addition and multipication) -- one should also consider how they interact with one another. For both integer and polynomials, the primary driver of these interactions is the distributive property.

With these two observations made, let us make a new definition to describe what is left as common behavior between integer and polynomial arithmetic.

Let us call a set of elements $R$ in combination with two operations (generically, addition and multiplication) a commutative ring when the following properties hold:

(The name here admittedly seems like an odd choice at the moment -- but fear not -- we will explain it momentarily.)

 $R$ under addition forms an abelian group Multiplication of elements in $R$ is closed, associative, commutative, and has an identity. Multiplication distributes over addition. That is to say, $a(b+c) = ab + ac$ and $(b+c)a = ba+ca$.

Importantly, integers and polynomials are not the only rings we can find. In fact, the name ring is perhaps better explained by another context with the same properties -- one inspired by the humble clock!

We all know how to add two integers in the normal way -- but have you ever thought about the strange arithmetic we see when adding hours on a clock?

If it is 3 o'clock and we add 5 hours to the time, that will put us at 8 o'clock, so we could write $3 + 5 = 8$.

However, if it is 11 o'clock and we add 6 hours, the time will be $5$ o'clock, so we should write $11 + 6 = 5$, right?

Hmmm.. clearly clock addition is a bit different than normal integer addition!

Of course, one should notice that if we ever add 12 hours to a given time, the clock doesn't effectively change -- so in this strange arithmetic it must be true that for any time $x$, we have $x + 12 = x$.

That means that $12$ serves as an additive identity for standard clock arithmetic. If we like, we might replace this value with a more recognizable symbol of $0$ on our clocks, as shown below (just remember $0 = 12$ in this arithmetic). This comes with an added benefit -- we can now find sums by adding the numbers in the normal way, but then finding the remainder of the sum upon division by $12$.

With this new flash of inspiration, note that $9 + 10 = 19$ which leaves a remainder of $7$ upon division by $12$, so $9 + 10 = 7$ on a standard clock.

With an additive identity comes the question of whether there are additive inverses. Of course the answer is yes! The additive inverse of any value $x$ is simply the integer value that we can add to it to get $12$ (i.e., zero). For $1$, this is $11$. For $2$, this is $10$. In general, for $x$ this is $12-x$.

As we only have twelve possible "hours" (notably, a finite number) that we can consider on any given (traditional) clock, we can create an "addition table" that covers every possible pair's sum, as shown below: $$\begin{array}{c|cccccccccccc} + & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11\\\hline 0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11\\ 1 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 0\\ 2 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 0 & 1\\ 3 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 0 & 1 & 2\\ 4 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 0 & 1 & 2 & 3\\ 5 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 0 & 1 & 2 & 3 & 4\\ 6 & 6 & 7 & 8 & 9 & 10 & 11 & 0 & 1 & 2 & 3 & 4 & 5\\ 7 & 7 & 8 & 9 & 10 & 11 & 0 & 1 & 2 & 3 & 4 & 5 & 6\\ 8 & 8 & 9 & 10 & 11 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\ 9 & 9 & 10 & 11 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8\\ 10 & 10 & 11 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\ 11 & 11 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \end{array}$$

First notice that this "addition" is clearly closed as we see no products outside $\{0,1,2,\cdots,11\}$.

The diagonal symmetry quickly reveals this addition is commutative and associativity follows from the associativity of the normal addition coupled with the fact that identical sums will have the same remainders upon division by $12$.

However, there is a clock multiplication that makes sense too! From any time, if we wait 2 hours on 3 separate occasions, the clock will now read $2 \cdot 3 = 6$ hours past what it originally read. That said, if we had waited 5 hours on 4 separate occasions, the clock will read the same time but plus $8$ hours. So must we not conclude that $4 \cdot 5 = 8$? Of course we must!

Here again, we can make these calculations by finding the "normal" product but then reducing the final value to just its remainder upon division by $12$. Thus, $4 \cdot 5 = 20 = 1 \cdot 12 + 8 = 8$. Certainly, such a "multiplication" is closed in that we never see a remainder outside of $\{0,1,2,3,\cdots,11\}$.

Further, we again inherit commutativity and associativity for clock products given the presence of these properties with "normal products" and the fact that identical products will have the same remainders upon division by $12$.

However, just as multiplicative inverses are not guaranteed with respect to integers $\mathbb{Z}$ or polynomials $\mathbb{Z}[x]$, clock multiplication doesn't guarantee every element has a multiplicative inverse either. To see this, consider the below "multiplication table" for our normal $12$-hour clock arithmetic. The value $1$ certainly plays the role of a multiplicative identity. Remembering that the inverse of some $x$ is the value $x^{-1}$ where $x \cdot x^{-1}$ is the multiplicative identity, note that some rows and columns don't contain the value $1$!

There is a certain expectation that $x=0$ wouldn't have a multiplicative inverse (even in the reals, $0$ doesn't have a multiplicative inverse), but we can also see this to be true for $2,3,4,6,8,9$, and $10$:

$$\begin{array}{c|cccccccccccc} \times & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11\\\hline 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 1 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11\\ 2 & 0 & 2 & 4 & 6 & 8 & 10 & 0 & 2 & 4 & 6 & 8 & 10\\ 3 & 0 & 3 & 6 & 9 & 0 & 3 & 6 & 9 & 0 & 3 & 6 & 9\\ 4 & 0 & 4 & 8 & 0 & 4 & 8 & 0 & 4 & 8 & 0 & 4 & 8\\ 5 & 0 & 5 & 10 & 3 & 8 & 1 & 6 & 11 & 4 & 9 & 2 & 7\\ 6 & 0 & 6 & 0 & 6 & 0 & 6 & 0 & 6 & 0 & 6 & 0 & 6\\ 7 & 0 & 7 & 2 & 9 & 4 & 11 & 6 & 1 & 8 & 3 & 10 & 5\\ 8 & 0 & 8 & 4 & 0 & 8 & 4 & 0 & 8 & 4 & 0 & 8 & 4\\ 9 & 0 & 9 & 6 & 3 & 0 & 9 & 6 & 3 & 0 & 9 & 6 & 3\\ 10 & 0 & 10 & 8 & 6 & 4 & 2 & 0 & 10 & 8 & 6 & 4 & 2\\ 11 & 0 & 11 & 10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 \end{array}$$

The last property we mentioned above as shared by integers and polynomials is that multiplication distributes over addition. This is true in clock arithmetic too, and for the same reasons that commutativity and associativity held for both addition and multiplication. Identical sums/products will have identical remainders upon division by 12.

### Modified Clocks

The 12-hour clock with which we are most familiar is ancient -- dating back to the Babylonians. However, there is nothing really special about $12$ (aside from it is evenly divisible by several things). What if we built our clocks to have only $10$ hours? ..or $7$ hours? ..or some other number of hours?

In each case, we can find a new clock arithmetic based on remainders upon division by that number of hours that exhibits all the same properties seen above.

As before, we can describe these new finite arithmetics (so called as they involve a finite number of elements) completely through their corresponding "addition tables" and "multiplication tables".

For example, below are the tables describing the $10$-hour clock arithmetic:

$\displaystyle{\begin{array}{c|cccccccccc} + & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\\hline 0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ 1 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 0 \\ 2 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 0 & 1 \\ 3 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 0 & 1 & 2 \\ 4 & 4 & 5 & 6 & 7 & 8 & 9 & 0 & 1 & 2 & 3 \\ 5 & 5 & 6 & 7 & 8 & 9 & 0 & 1 & 2 & 3 & 4 \\ 6 & 6 & 7 & 8 & 9 & 0 & 1 & 2 & 3 & 4 & 5 \\ 7 & 7 & 8 & 9 & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\ 8 & 8 & 9 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ 9 & 9 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \end{array}}$     $\displaystyle{\begin{array}{c|cccccccccc} \times & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\\hline 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ 2 & 0 & 2 & 4 & 6 & 8 & 0 & 2 & 4 & 6 & 8 \\ 3 & 0 & 3 & 6 & 9 & 2 & 5 & 8 & 1 & 4 & 7 \\ 4 & 0 & 4 & 8 & 2 & 6 & 0 & 4 & 8 & 2 & 6 \\ 5 & 0 & 5 & 0 & 5 & 0 & 5 & 0 & 5 & 0 & 5 \\ 6 & 0 & 6 & 2 & 8 & 4 & 0 & 6 & 2 & 8 & 4 \\ 7 & 0 & 7 & 4 & 1 & 8 & 5 & 2 & 9 & 6 & 3 \\ 8 & 0 & 8 & 6 & 4 & 2 & 0 & 8 & 6 & 4 & 2 \\ 9 & 0 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 \\ \end{array}}$

Notice again that closure, associativity, and commutativity for both this $10$-hour clock "addition" and its "multiplication" are essentially inherited by the same properties for the regular addition and multiplication of integers. For similar reasons, distributivity of multiplication over addition holds and $0$ again plays the role of an additive identity, $1$ plays the role of a multiplicative identity, and additive inverses for all values exist.

However, we can't say the same for multiplication. Not every non-zero value appears to have a multiplicative inverse. Notably, this includes $2$, $4$, $5$, $6$, and $8$. However, despite that little bit of "un-niceness" we have still satisfied all the properties required for $10$-hour clock arithmetic to form a ring.

Here's what $7$-hour clock arithmetic looks like in table form:

$\displaystyle{\begin{array}{c|cccccccccc} + & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\\hline 0 & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\ 1 & 1 & 2 & 3 & 4 & 5 & 6 & 0 \\ 2 & 2 & 3 & 4 & 5 & 6 & 0 & 1 \\ 3 & 3 & 4 & 5 & 6 & 0 & 1 & 2 \\ 4 & 4 & 5 & 6 & 0 & 1 & 2 & 3 \\ 5 & 5 & 6 & 0 & 1 & 2 & 3 & 4 \\ 6 & 6 & 0 & 1 & 2 & 3 & 4 & 5 \\ \end{array}}$     $\displaystyle{\begin{array}{c|cccccccccc} \times & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\\hline 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\ 2 & 0 & 2 & 4 & 6 & 1 & 3 & 5 \\ 3 & 0 & 3 & 6 & 2 & 5 & 1 & 4 \\ 4 & 0 & 4 & 1 & 5 & 2 & 6 & 3 \\ 5 & 0 & 5 & 3 & 1 & 6 & 4 & 2 \\ 6 & 0 & 6 & 5 & 4 & 3 & 2 & 1 \\ \end{array}}$

In $7$-hour clock arithmetic, we again have all of the properties needed to be a ring -- although this arithmetic is arguably even "nicer", however. Note that this time, we have multiplicative inverses for every non-zero value. Fascinatingly, whenever the number of hours on the clock is prime, this is the case!

Of course, just as there was nothing particularly special about $12$-hour clock arithmetic -- there is nothing particularly special about $10$-hour or $7$-hour clock arithmetics. We would see the ring properties hold for any $n$-hour clock arithmetic, where $n \ge 2$.

With so many clock-inspired arithmetics that can be built that exhibit the same properties of integers and polynomials as their hour hands go round and round during the calculations of sums and products, do you see how perhaps the term ring is a fairly natural one?.

‡ : When using the more general term "ring", we have no guarantee that multiplication is commutative.

† : Sadly, proving this takes us too far afield from the content we need to cover. So we will not do so here. The interested student however, is encouraged to read about how the Euclidean algorithm can be used to find linear combinations and related multiplicative inverses -- a discussion typically found in any textbook on number theory.