Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 3

Modular Arithmetic Basics

Recommended resources

Hello! Welcome to the third lesson in our course.

In our last lesson, we mastered the Euclidean Algorithm, a powerful tool for finding the greatest common divisor (GCD) built directly upon the Division Algorithm. We saw how it works by repeatedly finding remainders.

Today, we'll explore the world of remainders more deeply. Our goal is to define modular congruence and perform arithmetic with congruences. This concept formalizes the idea of "clock arithmetic" and provides the foundation for the new algebraic structures we'll be studying throughout this course. You'll find that this topic brings together the ideas of divisibility and remainders into a powerful new system.

1. An Intuitive Start: Clock Arithmetic

Before diving into formal definitions, let's build some intuition. You've used modular arithmetic your whole life, probably without thinking about it, every time you've told time. If it's 10:00 AM and you have a 4-hour meeting, you know it will end at 2:00 PM, not 14:00. In a sense, on a 12-hour clock, 14 "is the same as" 2.

This idea of numbers "wrapping around" is the core of modular arithmetic. The following video provides an excellent introduction using this clock analogy.

■ What is Modular Arithmetic? | An introduction to the strange world of mathematical time-telling

Watch the video 'What is Modular Arithmetic?' from the maths unboxed channel to get a feel for how modular arithmetic works in a familiar context.

Watch the first 5 minutes and 24 seconds (from 0:00 to 5:24). Pay attention to how the clock analogy is extended to different 'hour' clocks (different moduli) and how this relates to finding the remainder.

As the video explains, we have several ways to think about this:

  • The Clock Method: What time would it be on a clock with n hours?
  • The Remainder Method: What is the remainder when you divide a number by n?

For example, 16 is "the same as" 4 on a 12-hour clock because the remainder of 16 divided by 12 is 4.


2. Formalizing Congruence

Now, let's translate this intuition into a precise mathematical statement.

We use the symbol to denote congruence. The statement is read as "a is congruent to b modulo n". The integer is called the modulus.

There are two equivalent ways to define this:

Definition 1: Based on Divisibility
Two integers and are congruent modulo if their difference, , is a multiple of .

This is the formal definition you'll most often see in textbooks.

Definition and Example of Modular Congruence
This image shows the formal definition of modular congruence based on divisibility, along with a simple example: \(7 \equiv 4 \pmod 3\) because 3 divides their difference, \(7-4=3\).

Definition 2: Based on Remainders
Two integers and are congruent modulo if they have the same remainder when divided by .

This directly connects to our clock intuition and the Division Algorithm from our first lesson. The following video elegantly links these two definitions together.

Modular Arithmetic Basics: Congruence mod n

The video 'Modular Arithmetic Basics: Congruence mod n' by Mu Prime Math provides a clear, formal explanation of what congruence means.

Watch the first 5 minutes and 25 seconds (from 0:00 to 5:25). Focus on understanding how the three definitions presented—divisibility, the algebraic form a = kn+b, and same remainders—are all equivalent.

Having these equivalent definitions is powerful. The divisibility definition is often best for proofs, while the remainder definition is usually best for computations.


3. Arithmetic with Congruences

The reason modular congruence is so useful is that it preserves the operations of addition and multiplication. This allows us to build a consistent system of arithmetic.

The fundamental rules are:
If and , then:

  1. Addition:
  2. Multiplication:
  3. Powers: for any positive integer . (This is a direct consequence of the multiplication rule).

Since you have experience with proofs, it's worthwhile to see why these rules hold. The algebraic arguments are quite direct.

Modular Arithmetic Basics: Congruence mod n

Let's return to the 'Modular Arithmetic Basics' video to see the proofs for these arithmetic rules.

Watch from 8:54 to 14:22. The video demonstrates the proofs for adding congruences and multiplying by a constant. Notice how the proofs rely on the divisibility definition of congruence.

The real power of these rules is computational. They allow us to simplify large calculations by reducing intermediate numbers modulo . Instead of calculating with big numbers and finding the remainder at the end, we can find remainders at every step.

This next video shows this principle in action.

■ What is Modular Arithmetic? | An introduction to the strange world of mathematical time-telling

Now, let's go back to the 'maths unboxed' video to see how these rules are used to make calculations much easier.

Watch from 7:18 to 11:27. This part demonstrates with clear examples how to compute expressions like 401 + 62 modulo 4 and 132 * 14 mod 7 by simplifying the numbers first.

Let's try an example that combines these rules.

Test your understanding!

Find the remainder of when divided by 100.
(In other words, evaluate )

Show answer

Instead of computing the large number, we can reduce each part modulo 100 first.

Now, substitute these simpler values into the expression:

We're not done yet. We can reduce modulo 100.
Since , we have .

So,

The remainder is 19. This was much easier than calculating and then dividing by 100.


4. Properties of Congruence: An Equivalence Relation

The congruence relation shares three fundamental properties with the standard equality relation . For any integers and a modulus :

  1. Reflexive:
    • (Any number is congruent to itself.)
  2. Symmetric: If , then
    • (You can swap the sides.)
  3. Transitive: If and , then
    • (If is like and is like , then is like .)

A relation that satisfies these three properties is called an equivalence relation. This is a central concept in abstract algebra because it allows us to partition a set into disjoint subsets, called equivalence classes. We'll explore this more in the coming lessons.


Conclusion

In this lesson, we established the fundamental concepts of modular arithmetic. This is the bedrock upon which we will build our first major algebraic structure.

Key Takeaways:

  • Congruence Modulo n: means that divides , or equivalently, that and have the same remainder when divided by .
  • Modular Arithmetic: We can perform addition and multiplication with congruences. The key computational trick is to reduce numbers modulo at each step to keep the calculations simple.
  • Equivalence Relation: Congruence is an equivalence relation, meaning it is reflexive, symmetric, and transitive, just like equality.

Preview of the Next Lesson:
Now that we understand how to do arithmetic with congruences, we are ready to formalize our "clock". We will define the set of integers modulo n, written as , which consists of the remainders . We will then investigate the properties of this set under addition and see that it forms a structure known as a cyclic group.