Hello! Welcome to the sixth and final lesson of our first module on number theory foundations.
In the last lesson, we explored the additive group and discovered it is always cyclic. We also found a fascinating connection to number theory: the generators of are precisely the elements that are relatively prime to (i.e., ).
Today, we shift our focus from addition to multiplication within . As we'll see, that same condition—being relatively prime to —reappears in a new and crucial role. It is the key that unlocks which elements have multiplicative inverses. Our learning outcome for this lesson is to identify the group of units U(n), determine which elements have multiplicative inverses, and compute them.
This lesson will bridge our study of modular arithmetic with the formal study of groups, which begins in the next module.
1. The Challenge of Multiplicative Inverses in
In the additive world of , every element has an inverse. Does the same hold true for multiplication? Let's investigate. A multiplicative inverse of an element is an element such that .
Not all non-zero elements in have a multiplicative inverse. For example, in , is there an element such that ? Trying all possibilities:
None of these products is 1. So, 2 has no multiplicative inverse in . Because of this, the set with multiplication cannot form a group.
This raises the question: can we form a group by considering only the elements that do have multiplicative inverses?
(Abstract Algebra 1) Units Modulo n
The following video introduces this exact problem using \mathbb{Z}_8 and shows how we can construct a group by selecting only certain elements.
Watch from the beginning to 4:14. The first part (up to 1:30) confirms our finding that not all elements in \mathbb{Z}_8 have multiplicative inverses. The second part (starting at 2:22) introduces the condition for selecting elements that do form a group.
2. Identifying the Group of Units, U(n)
As the video demonstrated, the elements that have multiplicative inverses are precisely those that are relatively prime to the modulus . This set of elements is called the group of units of , denoted U(n).
Definition: The group of units U(n) is the set of all integers such that and . The group operation is multiplication modulo .
For , we find the integers where :
Thus, the elements of the group of units of are .
The video (Abstract Algebra 1) Units Modulo n goes on to construct the multiplication table for and verify that it satisfies the four group axioms (Closure, Associativity, Identity, and Inverses).

Test your understanding!
List the elements of the group of units .
Show answer
We need to find all integers between 1 and 11 such that .
The numbers are: 1, 5, 7, 11.
So, .
The key takeaway is that the existence of a multiplicative inverse for an element in is equivalent to the condition . This is a fundamental theorem of number theory.
3. Computing Multiplicative Inverses
We know when an inverse exists, but how do we find it? The tool for this comes from a result we saw in a previous lesson: Bezout's Identity.
Recall that for any two integers and , there exist integers and such that:
If an element is in , we know . So, for some integers and , we have:
Now, let's consider this equation modulo . The second term, , is a multiple of , so . This simplifies the equation to:
This is exactly the definition of a multiplicative inverse! The integer is the multiplicative inverse of modulo .
The practical algorithm for finding these integers and is the Extended Euclidean Algorithm. The following resource explains how to use it. Given your interest in coding, you'll be pleased to see it also provides a Python implementation.
[PDF] Lecture 5: Finite Fields (PART 2)
The following document from a computer security course provides an excellent, practical explanation of how to find multiplicative inverses. It connects Bezout's Identity to the Extended Euclidean Algorithm and provides clear, step-by-step examples.
Please study the following three parts of this document: Section 5.6 and 5.6.2 (pages 31-36): Start at 'FINDING MULTIPLICATIVE INVERSES...' and read through '...multiplicative inverse of a modulo n'. This section formalizes the connection between Bezout's Identity and finding inverses. Section 5.6.6 (pages 44-45): This section, 'Two Examples That Illustrate the Extended Euclid’s Algorithm', is the most important. Work through the example of finding the multiplicative inverse of 17 modulo 32. Follow the backward substitution process carefully. Section 5.7 (pages 46-50): Skim this section, 'THE EXTENDED EUCLID’S ALGORITHM IN PERL AND PYTHON'. Focus on the Python implementation (FindMI.py). Notice how the while loop directly implements the steps of the algorithm. This shows how a constructive proof can be translated directly into code.
Let's walk through an example to solidify the computation.
Problem: Find the multiplicative inverse of 7 in .
First, we check that the inverse exists: , so it does. We use the Euclidean Algorithm to find the GCD, keeping track of the equations:
- (The GCD is 1)
Now, we work backwards, solving for the remainder at each step and substituting upwards.
From step (3), solve for 1:
From step (2), solve for 2 () and substitute it into the equation above:
From step (1), solve for 5 () and substitute it into our current equation:
Finally, combine the terms for 7 and 26:
This is now in the form . Specifically, .
The coefficient of 7 is -11. So, the inverse of 7 is -11. To get a value in , we find , which is 15.
Therefore, the multiplicative inverse of 7 in is 15.
We can check: . And , so .
Test your understanding!
Find the multiplicative inverse of 8 in .
Show answer
First, we use the Euclidean Algorithm:
Now, work backwards (backward substitution):
From (3):
From (2), substitute for 2 ():
From (1), substitute for 3 ():
Combine terms:
The coefficient of 8 is -10.
.
The inverse of 8 modulo 27 is 17.
Check: . . It works.
Conclusion
This lesson concludes our foundational module on number theory. We've come full circle, from basic concepts like the division algorithm and GCD to constructing algebraic groups from the integers modulo .
Key Takeaways:
- An element has a multiplicative inverse if and only if .
- The set of such elements forms the group of units, U(n), under multiplication modulo .
- The Extended Euclidean Algorithm is the computational method used to find the multiplicative inverse of an element. It is a direct application of Bezout's Identity.
Preview of the Next Module:
We have now encountered two primary examples of finite groups: the additive group and the multiplicative group . In the next module, we will abstract away from these specific examples to formally define what a group is. We will explore the group axioms in detail and encounter new types of groups, including groups of matrices and permutations. Your background in linear algebra will be particularly useful as we begin to study matrix groups.