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, is not equal to anymore, but rather equal to . Similarly, , because 7 hours before it’s 4 o’clock, it was 9 o’clock. As a consequence, we can say that the numbers , , and have the same meaning as because they have the same place on the dial, hence , , , and are equivalent to each other, or in a mathematical sense, , , and are congruent to since division by gives the same remainder.
Get hands-on with 1400+ tech skills courses.