Ma · Mathematics

What Is Modulo Reduction, and How Do You Use It?

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose the modulus

    Specify the positive integer m that determines which numbers count as equivalent.

  2. 2. Replace by a remainder

    Reduce each integer to its remainder from 0 through m minus 1.

  3. 3. Do the calculation

    Add, subtract, or multiply the reduced values, then reduce the result again.

  4. 4. Check for division

    Cancel a factor only when the conditions for modular cancellation are satisfied.

Modulo reduction means replacing an integer with a simpler integer that has the same remainder when divided by a chosen positive integer. This is useful for simplifying calculations and proving statements about divisibility or remainders.

For example, reducing modulo 5 replaces 17 by 2, because both leave remainder 2 upon division by 5. The notation is 17≡2(mod5)17 \equiv 2 \pmod{5}, read as “17 is congruent to 2 modulo 5.”

What congruence means

For integers aa and bb and a positive integer mm,

a≡b(modm)a \equiv b \pmod{m}

means that mm divides a−ba-b. Equivalently, aa and bb have the same remainder when divided by mm.

A common convention is to represent each congruence class by its least nonnegative remainder: one of 0,1,…,m−10,1,\ldots,m-1. Thus, modulo 5, the integer −2-2 is represented by 3, since −2≡3(mod5)-2 \equiv 3 \pmod{5}.

Congruence is not the same as ordinary equality. The statement 17≡2(mod5)17 \equiv 2 \pmod{5} does not say that 17 equals 2; it says their difference is divisible by 5.

Which operations allow reduction?

You may replace an integer by a congruent one inside sums, differences, and products. If a≡a′(modm)a \equiv a' \pmod{m} and b≡b′(modm)b \equiv b' \pmod{m}, then

a+b≡a′+b′(modm),a−b≡a′−b′(modm),ab≡a′b′(modm).a+b \equiv a'+b' \pmod{m}, \qquad a-b \equiv a'-b' \pmod{m}, \qquad ab \equiv a'b' \pmod{m}.

The same rule applies to powers with nonnegative integer exponents: if a≡b(modm)a \equiv b \pmod{m}, then an≡bn(modm)a^n \equiv b^n \pmod{m}. In practice, reduce intermediate results as you go so the numbers stay small.

Worked example

Calculate (38⋅47+29) mod 11(38 \cdot 47 + 29) \bmod 11, meaning find the least nonnegative remainder after division by 11.

First reduce each number modulo 11:

38≡5,47≡3,29≡7(mod11).38 \equiv 5, \qquad 47 \equiv 3, \qquad 29 \equiv 7 \pmod{11}.

Substitute these simpler values and calculate:

38⋅47+29≡5⋅3+7=22≡0(mod11).38 \cdot 47 + 29 \equiv 5 \cdot 3 + 7 = 22 \equiv 0 \pmod{11}.

So the remainder is 0, and the original expression is divisible by 11. You can verify this directly: 38⋅47+29=1815=11⋅16538 \cdot 47 + 29 = 1815 = 11 \cdot 165.

Reducing powers

Reduction is also useful when a power is large. To find 210 mod 72^{10} \bmod 7, note that 23=8≡1(mod7)2^3=8 \equiv 1 \pmod{7}. Therefore,

210=(23)3⋅2≡13⋅2=2(mod7).2^{10} = (2^3)^3 \cdot 2 \equiv 1^3 \cdot 2 = 2 \pmod{7}.

The least nonnegative remainder is 2. The key is to find a small power or repeating pattern, then use it to simplify the exponentiation.

Common mistakes

Treating congruence as equality

The statement 38≡5(mod11)38 \equiv 5 \pmod{11} allows you to replace 38 by 5 in a calculation modulo 11. It does not allow that replacement in an ordinary integer equation.

Forgetting to reduce the final result

An answer such as 22 is congruent to 0 modulo 11, but the least nonnegative remainder is 0. Reduce the final value if the problem asks for a remainder.

Canceling a factor without checking

In ordinary arithmetic, you can divide both sides of an equation by any nonzero number. Modular congruences are different: a factor is safely cancellable modulo mm when it has a multiplicative inverse modulo mm. An integer cc has such an inverse exactly when its greatest common divisor with mm is 1.

For example, from 2x≡2(mod6)2x \equiv 2 \pmod{6}, you cannot conclude x≡1(mod6)x \equiv 1 \pmod{6} by canceling 2. The original congruence says that 6 divides 2(x−1)2(x-1), which is equivalent to 3 dividing x−1x-1. Thus the correct result is x≡1(mod3)x \equiv 1 \pmod{3}.

A quick checklist

When reducing a calculation modulo mm, identify the modulus, replace values with convenient congruent remainders, and use addition, subtraction, or multiplication as usual. Reduce again whenever it helps. If you need to divide or cancel, first check whether the factor has an inverse modulo mm; otherwise the modulus or solution set may change.

References

  1. Elementary Number Theory
  2. A Friendly Introduction to Number Theory

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.