Modular Arithmetic

Modular arithmetic is the arithmetic of congruences, sometimes known informally as "clock arithmetic." In modular arithmetic, numbers "wrap around" upon reaching a given fixed quantity, which is known as the modulus (which would be 12 in the case of hours on a clock, or 60 in the case of minutes or seconds on a clock).

Formally, modular arithmetic is the arithmetic of any nontrivial homomorphic image of the ring of integers. For any such homomorphic image R of Z, there is an integer n such that R is isomorphic to the ring Z_n of integers modulo n. The addition in the ring Z_n is determined from addition in Z by computing the remainder, upon division by n, of the sum a+b of two integers a and b. Similarly, for multiplication in the ring Z_n, one multiplies two integers a and b, and computes the remainder upon division of ab by n.

For each positive integer n, the ring Z_n has n elements, namely the equivalence classes of each of the nonnegative integers less than n, under the equivalence relation R that is defined according to the rule aRb iff n divides b-a. It is natural and common to denote the equivalence class [a] (under the equivalence relation R) of a nonnegative integer a<n by a.

For example, in arithmetic modulo 12 (for which the associated ring is C_(12)), the allowable numbers are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, and 11. This arithmetic is sometimes referred to as "clock arithmetic" because the additive structure here is the same as that used to determine times for a twelve-hour clock, except that 0 is often replaced, on a clock, by 12. Example calculations in arithmetic modulo 12 include statements like "11+1=0", or "7+8=3", or "5·7=11," although the equal sign = is commonly replaced with the congruence sign = in such statements to indicate that modular arithmetic is being used. More explicitly still, a notation such as

 11+1=0 (mod 12)

is frequently used.

Arithmetic modulo 2 is sometimes referred to as "Boolean arithmetic", because the ring C_2 is the canonical example of a Boolean ring.

See also

Boolean Ring, Congruence, Modulus, Residue

Portions of this entry contributed by Matt Insall (author's link)

Explore with Wolfram|Alpha

Cite this as:

Insall, Matt and Weisstein, Eric W. "Modular Arithmetic." From MathWorld--A Wolfram Web Resource.

Subject classifications