Applied Mathematics · Ch 1 — Numbers, Quantification and Numerical Applications
Modular Arithmetic
Modular Arithmetic
Modular arithmetic is the branch of arithmetic for integers that deals only with remainders, ignoring how many times one number divides into another. It builds on Euclid's division algorithm from earlier classes: for any dividend and divisor (with , ), there exist unique integers (the quotient) and (the remainder) such that
The modulo operator, written , isolates just the remainder from this relationship — it tells you what is left over after is divided by . For instance, , since dividing 29 by 3 leaves a remainder of 2. A familiar everyday model is a 12-hour clock: 13 o'clock is displayed as 1 o'clock because , i.e., . What matters is not how many full cycles occur, only where the count ends up — this "wrap-around" behaviour is the essence of modular arithmetic.
The values , and may be positive, negative, or zero (except , which cannot be zero), but the remainder is always non-negative and strictly less than . Two special cases are worth remembering: when , the remainder is (e.g., ); and when , the remainder is simply itself (e.g., ).
Properties of the modulo operator
The modulo operator obeys four properties that make large computations manageable:
Property 1: for any integer .
Property 2 (addition):
Property 3 (subtraction):
Property 4 (multiplication):
Property 1 says that adding any whole multiple of the divisor leaves the remainder unchanged. Properties 2-4 let you reduce each part of a sum, difference, or product first and only then combine them - invaluable when the raw numbers are large. For example, to find you replace each factor by its remainder mod and multiply those small remainders instead.
Addition, subtraction and multiplication modulo
These properties give rise to three closed operations on remainders. For positive integers , and a modulus :
Addition modulo :
Subtraction modulo :
Multiplication modulo :
Each operation first combines and in the ordinary way and then keeps only the remainder on division by , so the result always lies in . When a subtraction turns out negative, the non-negative remainder is still taken - for instance , since .
Where modular arithmetic is used
Because it captures anything that repeats in cycles, modular arithmetic appears far beyond the classroom: ISBN and bank-account (IBAN) numbers use modulo checksums to catch typing errors, calendars use arithmetic modulo to find the day of the week for any date, and the twelve-tone musical scale rests on arithmetic modulo - the same "clock" idea that makes five hours after o'clock read as o'clock.
Illustration 2. Using and (so that ), complete Table 2. For each value of , compute , then , and finally .
Since , we tabulate:
| 4 | 20 | 38 | 3 |
| 7 | 35 | 53 | 3 |
| 8 | 40 | 58 | 3 |
| 8 | 3 | ||
| 3 | |||
| 12 | 60 | 78 | 3 |
What the table shows: every entry in the last column equals , which is exactly . This confirms Property 1 — adding any integer multiple of the divisor to leaves the remainder unchanged: . (For the negative rows note that remainders stay non-negative, e.g. , so .)
Illustration 3. Complete the table below, where , and are positive integers, and verify the addition property . Here .
| 17 | 25 | 4 | 1 | 1 | 2 | 2 | |
| 84 | 37 | 9 | 3 | 1 | 4 | 4 | |
| 39 | 34 | 17 | 5 | 0 | 5 | 5 | |
| 171 | 245 | 3 | 0 | 2 | 2 | 2 |
In every row the fourth column matches the last column , verifying the addition property.
Illustration 4. Complete the table below, where , and are positive integers, and verify the subtraction property . Here .
| 37 | 25 | 4 | 1 | 1 | 0 | 0 | |
| 84 | 37 | 9 | 3 | 1 | 2 | 2 | |
| 39 | 34 | 17 | 5 | 0 | 5 | 5 | |
| 245 | 171 | 3 | 2 | 0 | 2 | 2 |
Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your NCERT textbook's own diagram.
On a 12-hour clock, hours repeat every 12 — clock arithmetic is arithmet …