Modular Mathematics, An Introduction

Introduction

Modular mathematics is often compared to "clock arithmetic", since everyone is familiar with the clock. If lunch starts at 11:00 and lasts three hours, it is over at 2:00. We all know how to wrap around 12 and start over at 1. This would accurately reflect modular mathematics if we erased the twelve at the top of the clock and wrote in a zero.

If m is an integer > 1, the numbers "mod m" are restricted from 0 to m-1 inclusive. (The variable m is often used, as it is the first letter in the word modulus.) If the sum of two numbers exceeds m-1, subtract m to bring the result back into the proper range. Similarly, if x-y is negative, add m back in. In general, the result of every mathematical operation is divided by m, and the remainder is used.

Verify that addition and multiplication remain commutative, associative, and distributive mod m. In other words, we can add up 100 numbers, then take the remainder mod m, or take remainders after each number is added; the result is the same. This also holds for multiplication, so nice ring-like properties, such as a+b = b+a, are inherited.