Modular Arithmetic

Learn about modular arithmetic, congruence relations, and residue classes in this lesson.

What is modular arithmetic?

Modular arithmetic is a system for the arithmetic of integers (or, to be precise: of congruences) that operates on the remainders of the integers divided by a fixed value called the modulus.

The system works similarly to the idea of clock arithmetic, where the sequence of numbers runs stepwise, starting from number 1, and after reaching the number 12, the numbers wrap around, and the sequence of numbers repeats itself again from 1. As a result, 11+311+3 is not equal to 1414 anymore, but rather equal to 22. Similarly, 47=94-7=9, because 7 hours before it’s 4 o’clock, it was 9 o’clock. As a consequence, we can say that the numbers 8-8, 1616, and 2828 have the same meaning as 44 because they have the same place on the dial, hence 8-8, 44, 1616, and 2828 are equivalent to each other, or in a mathematical sense, 8-8, 1616, and 2828 are congruent to 44 since division by 1212 gives the same remainder.

Get hands-on with 1400+ tech skills courses.