Modular Arithmetic: Examples & Practice Problems

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Modular Arithmetic: Rules & Properties

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
 Replay
Your next lesson will play in 10 seconds
  • 0:00 Modular Arithmetic
  • 1:35 Basic Examples
  • 4:31 Application
  • 5:45 Lesson Summary
Save Save Save

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Log in or Sign up

Timeline
Autoplay
Autoplay
Speed Speed

Recommended Lessons and Courses for You

Lesson Transcript
Instructor: Laura Pennington

Laura received her Master's degree in Pure Mathematics from Michigan State University. She has 15 years of experience teaching collegiate mathematics at various institutions.

In this lesson, we will have a quick review of modular arithmetic and then use examples to practice this useful type of math. You will get even more practice on a quiz when you've finished the lesson.

Modular Arithmetic

Practice makes perfect, and that's exactly what this lesson is about; practice in modular arithmetic. Modular arithmetic is sometimes called clock arithmetic, because the rules in modular arithmetic are the same rules that apply to telling the time. In a clock, there are 12 hours, and once you get to 12:00, the next hour starts over at 1:00. In modular arithmetic, 12 would be called the modulus, and it's the number we start over at.

As a quick review, rmodn is equal to the remainder when we divide r by n. Addition, subtraction, and multiplication in modular arithmetic obey two basic rules.

  1. If a + b = c, then (a + b)modn is congruent to cmodn.
  2. If amodn is congruent to dmodn and bmodn is congruent to emodn, then (a + b)modn is congruent to dmodn + emodn.

In each of these rules, the plus sign can be replaced by a subtraction or multiplication sign. These rules state that we can first perform the operation and then find that number modn, or we can find each of the numbers modn and then perform the operation on them. It's important to note that when dealing with subtraction, you may get negative numbers. When this happens, you add multiples of the modulus n until you get a number between 0 and n - 1. This is demonstrated in our second example. These rules are much easier to see in action, so let's go through a couple of examples now to make these rules a little less confusing.

Basic Examples

Use the rules of modular arithmetic to solve the following problems.

1.) As in our initial clock example, let's work in modulus 12. Assume it is 7:00, and we want to know what time it will be 10 hours from now.

Solution:

Basically, this is asking us to find (7 + 10)mod12. To perform this operation, we first add 7 + 10 to get 17, so (7 + 10)mod12 is congruent to 17mod12. Next, we find 17mod12. To find 17mod12, we find the remainder when 17 is divided by 12, which is 5. Therefore, (7 + 10)mod12 is congruent to 5mod12. This tells us that if it is 7:00, then 10 hours from now, it will be 5:00. The following image shows the work that's described in a nice compact form.

Work For Example 1
modpractice8

2.) Working in modulus 5, find (73 - 64)mod5.

Solution:

If we subtract first, we have 73 - 64 = 9, so (73 - 64)mod5 is congruent to 9mod5. Now we just need to find the remainder when 9 is divided by 5, which is 4. Therefore, (73 - 64)mod5 is congruent to 4mod5.

We can also first find that 73mod5 is congruent to 3mod5 and that 64mod5 is congruent to 4mod5. By our rules, we have that (73 - 64)mod5 is congruent to 3mod5 - 4mod5 which is congruent to -1mod5. We have a negative number, so we add multiples of 5 until we get a number between 0 and 4. If we add 5 to -1, we get 4, which falls in our range, so this is our answer. We see that once again, we get that (73 - 64)mod5 is congruent to 4mod5.

All of the work is demonstrated in the following image.

Work For Example 2
modpractice2

3.) Working in modulus 17, find (18*20)mod17.

Solution:

To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account
Support