Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Modular arithmetic is a way to do math with repeating cycles, such as hours on a clock, days of the week, or positions around a wheel. Instead of keeping the full value of a number, we focus on its remainder after division by a chosen modulus. This makes large numbers easier to compare and is useful in calendars, cryptography, computer science, and number theory.

Congruences give a precise language for saying that two numbers land in the same place in a cycle.

Understanding Math: Modular Arithmetic and Congruences

A congruence is not ordinary equality. It groups integers into families that have the same remainder. For modulus five, the family containing two includes seven, twelve, negative three, and every number reached by adding or subtracting five.

This viewpoint is useful because one small representative can stand for infinitely many numbers. A number is congruent to zero modulo n precisely when it is a multiple of n. That simple idea turns many divisibility tests into short calculations.

Negative numbers need careful handling. The remainder is usually selected from zero up to one less than the modulus. When negative one is divided by five, it can be written as negative five plus four, so its chosen remainder is four.

Therefore negative one is congruent to four modulo five. A helpful habit is to add enough copies of the modulus until the result lies in the standard remainder range. This prevents a common mistake where a student treats a negative remainder as a completely different answer.

Addition, subtraction, and multiplication work neatly because replacing a number by a congruent number changes it by a multiple of the modulus. For example, to find the remainder of seventy three times twenty eight on division by nine, reduce first. Seventy three has remainder one, while twenty eight has remainder one.

Their product has remainder one. Powers become manageable in the same way.

To find a large power modulo seven, calculate the first few powers and watch for a repeating pattern. The pattern often repeats much sooner than the original numbers become large.

Division is more limited. In ordinary arithmetic, a fraction can often be simplified by dividing both sides by the same number. In modular arithmetic, this is only allowed when that number has a multiplicative inverse for the chosen modulus.

A number has an inverse modulo n when it shares no factor greater than one with n. For example, three has an inverse modulo seven because three times five leaves remainder one on division by seven.

By contrast, two has no inverse modulo six because every product of two is even and can never leave remainder one. This explains why some congruence equations have one answer, several answers, or no answer.

Students meet these ideas in check digits, rotating schedules, computer programming, and simple ciphers. A program often uses the remainder after division to keep an index inside a fixed list. For a list with ten positions, moving forward from position eight by five steps reaches position three.

In a shift cipher, each letter is given a position and shifted by a fixed amount, with positions wrapping around after the last letter. When solving problems, write the modulus clearly, reduce numbers often, and check whether a step uses division. The modulus is part of every statement, so changing it can completely change the result.

Key Facts

  • a ≡ b mod n means n divides a - b.
  • a mod n is the remainder when a is divided by n, usually chosen from 0 to n - 1.
  • If a ≡ b mod n and c ≡ d mod n, then a + c ≡ b + d mod n.
  • If a ≡ b mod n and c ≡ d mod n, then ac ≡ bd mod n.
  • To reduce a large expression mod n, reduce each part first, then combine the remainders.
  • The linear congruence ax ≡ b mod n has a solution only if gcd(a, n) divides b.

Vocabulary

Modulus
The modulus is the positive integer n that sets the cycle length in modular arithmetic.
Remainder
The remainder is what is left after dividing an integer by the modulus.
Congruent
Two integers are congruent modulo n if they have the same remainder when divided by n.
Residue
A residue is a representative remainder value for a congruence class modulo n.
Linear Congruence
A linear congruence is an equation of the form ax ≡ b mod n, where x is the unknown integer.

Common Mistakes to Avoid

  • Treating a ≡ b mod n as ordinary equality is wrong because congruence means the numbers differ by a multiple of n, not that they are identical.
  • Forgetting to reduce negative numbers correctly is wrong because the standard remainder should usually be between 0 and n - 1, such as -3 ≡ 9 mod 12.
  • Canceling factors without checking is wrong because division in modular arithmetic is only valid when the factor has a multiplicative inverse modulo n.
  • Assuming every congruence ax ≡ b mod n has one solution is wrong because solutions depend on gcd(a, n), and there may be no solution or multiple solutions.

Practice Questions

  1. 1 Find the least nonnegative residue of 137 mod 12, then explain where 137 lands on a mod 12 clock.
  2. 2 Solve the congruence 5x ≡ 3 mod 7 for x in the set {0, 1, 2, 3, 4, 5, 6}.
  3. 3 Explain why 26, 50, and 74 are all congruent modulo 24, and describe what that means on a 24-hour clock.