How to Do Multiplication and Division in Modular Arithmetic

Learn more about performing modular arithmetic, how it’s related to finding remainders in division, and how it can help you predict the future.

Jason Marshall, PhD
5-minute read
Episode #54

How Subtraction Works in Modular Arithmetic

Up first: subtraction. This one is pretty easy, actually…so long as you have a good understanding of how to think about doing modular addition. And that’s because—just as with normal non-modular arithmetic—modular subtraction is basically the opposite of modular addition. Whereas you can think of modular addition as counting forward in the clockwise direction around the face of a “clock,” you can think of modular subtraction as counting backward around that “clock.”

For example, what’s (2 – 4) (mod 12)? Well, all you have to do is think about starting at 2 on a normal 12-hour clock, and then counting backwards 4 numbers: from 2 to 1, then to 12, 11, and finally 10. So (2 – 4) (mod 12) ≡ 10. Remember, the “≡” symbol here means these things are “congruent”—which is a word we use so we don’t get confused with the idea of “equality” in normal arithmetic.

Okay, how about arithmetic modulo 5: What’s (2 – 4) (mod 5)? Well, in this case, you need to think of a clock that has a zero at the top and then a 1, 2, 3, and 4 going around it in a clockwise direction. So, starting at 2 on this clock and working backwards 4 spaces—1, 0, 4, 3—we find that (2 – 4) (mod 5) ≡ 3.

How Multiplication and Division Work in Modular Arithmetic

Now that we can do both addition and subtraction, we just need to figure out how multiplication and division work in modular arithmetic. All you need to do is first figure out the answer to your multiplication or division problem using normal non-modular arithmetic, and then convert that number into its modular form. In other words, to find the answer to (3 x 7) (mod 12), first figure out what 3 x 7 is in regular arithmetic—it’s 21. Next, figure out what 21 is congruent to in math modulo 12. You can find the answer by starting at 0 on a normal 12-hour clock and then counting clockwise 21 spaces. Eventually, you’ll arrive at 9. That’s all there is to it! And division works the same way.


About the Author

Jason Marshall, PhD

Jason Marshall is the author of The Math Dude's Quick and Dirty Guide to Algebra. He provides clear explanations of math terms and principles, and his simple tricks for solving basic algebra problems will have even the most math-phobic person looking forward to working out whatever math problem comes their way.

You May Also Like...

The Quick and Dirty Tips Privacy Notice has been updated to explain how we use cookies, which you accept by continuing to use this website. To exercise your choices about cookies, please see Cookies and Online Tracking.