Modular Arithmetic — Clock Problems, Remainder Theorem Basics

medium CBSE JEE-MAIN 3 min read

Question

What is modular arithmetic, how does it connect to clock problems, and how do we use the remainder theorem?


Solution — Step by Step

amodna \mod n gives the remainder when aa is divided by nn.

17mod5=2(because 17=3×5+2)17 \mod 5 = 2 \quad \text{(because } 17 = 3 \times 5 + 2\text{)} 23mod7=2(because 23=3×7+2)23 \mod 7 = 2 \quad \text{(because } 23 = 3 \times 7 + 2\text{)}

We write ab(modn)a \equiv b \pmod{n} to mean ”aa and bb leave the same remainder when divided by nn.”

So 172(mod5)17 \equiv 2 \pmod{5} and 232(mod7)23 \equiv 2 \pmod{7}.

A clock is modular arithmetic with n=12n = 12. After 12, the numbers wrap around:

  • 3 hours after 11 o’clock: 11+3=142(mod12)11 + 3 = 14 \equiv 2 \pmod{12} (2 o’clock)
  • 50 hours from now (starting at 9): 9+50=5911(mod12)9 + 50 = 59 \equiv 11 \pmod{12} (11 o’clock)

Days of the week use mod7\mod 7. If today is Monday (day 1), what day is it after 100 days? 100mod7=2100 \mod 7 = 2, so it is 2 days after Monday = Wednesday.

If ab(modn)a \equiv b \pmod{n} and cd(modn)c \equiv d \pmod{n}, then:

  • Addition: a+cb+d(modn)a + c \equiv b + d \pmod{n}
  • Multiplication: a×cb×d(modn)a \times c \equiv b \times d \pmod{n}
  • Power: akbk(modn)a^k \equiv b^k \pmod{n}

These let us simplify large computations. For example, find the last digit of 71007^{100}:

The last digit = 7100mod107^{100} \mod 10.

7177^1 \equiv 7, 7297^2 \equiv 9, 7337^3 \equiv 3, 741(mod10)7^4 \equiv 1 \pmod{10}.

The cycle repeats every 4. Since 100=25×4100 = 25 \times 4, we get 71001(mod10)7^{100} \equiv 1 \pmod{10}.

Last digit = 1.

graph TD
    A[Modular Arithmetic Problem] --> B{What are we finding?}
    B -->|Remainder| C[Divide and find remainder directly]
    B -->|Last digit| D[Work mod 10, find cycle pattern]
    B -->|Day of week| E[Work mod 7]
    B -->|Clock time| F[Work mod 12 or mod 24]
    D --> G[Find power cycle length]
    G --> H[Reduce exponent mod cycle length]
    H --> I[Compute small power]

Why This Works

Modular arithmetic works because remainders have consistent algebraic properties. When we add, subtract, or multiply, the remainders follow the same rules as the original numbers. This “modular consistency” is why we can reduce massive computations (like 71007^{100}) to tiny ones.

JEE Main frequently asks “find the remainder when xx is divided by yy” type questions. The trick is always to find the cycle pattern first, then reduce the exponent. Last two digits problems use mod100\mod 100; last digit problems use mod10\mod 10.


Alternative Method

For finding remainders of polynomials divided by (xa)(x - a), use the Remainder Theorem: the remainder when f(x)f(x) is divided by (xa)(x - a) equals f(a)f(a).

Example: Remainder when x32x+1x^3 - 2x + 1 is divided by (x3)(x - 3): f(3)=276+1=22f(3) = 27 - 6 + 1 = 22. So the remainder is 22.


Common Mistake

Students try to compute 71007^{100} directly and then find the remainder. This is impossible without a calculator. The whole point of modular arithmetic is to reduce FIRST, then compute. Find the cycle pattern of remainders (like 7,9,3,17, 9, 3, 1 repeating for mod10\mod 10), then use the pattern to jump to the answer. Always reduce before computing, never after.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →