Modular ArithmeticModular arithmetic (sometimes called clock arithmetic) is a system of arithmetic for integers, where numbers "wrap around" after they reach a certain value called the modulus. You will already be familiar with modular arithmentic. We use it when we 'tell the time' on a simple 12 hour clock. If the time is 11 o'clock now, then 2 hours later it will be 1 o'clock. Simple addition would suggest that the later time should be 11 + 2 = 13 o'clock, but this is not the answer because clock time "wraps around" every 12 hours; in simple clock time, there is no "15 o'clock". If the clock starts at midday them then 21 hours later the time will be 9 o'clock the next day, rather than 33 o'clock.
As soon as the hour number reaches 12 it starts over again from zero. It resets. The '12' being the reset is termed 'arithmetic modulo 12'. 12 is congruent not only to 12 itself, but also to 0 Therefore the time called "12:00" could also be called "0:00" so, for a 12 hour clock we can write this in mathematical shorthand... 0 ≡ 12 (mod 12)
|
|