Jump to content

Modular arithmetic

From Simple English Wikipedia, the free encyclopedia
Time-keeping on a clock gives an example of modular arithmetic.

Modular arithmetic (sometimes also called Clock arithmetic) is a way of doing arithmetic with integers. Much like a clock, once the numbers reach a certain value, called modulus, they go back to zero. The first person to talk about modular arithmetic was Carl Friedrich Gauß

In modular arithmetic, a particular base is used. This base is the modulus. With a clock, the base is 12 and the numbers that can be used are 0 through 11. The base can be any number greater than zero.

Modulo is sometimes said to be the remainder of the integer division of two integers. It is the remainder of the number divided by the base. For example, 19 modulo 12 is the remainder when 19 is divided by 12. The answer to that question is 7. 19 divided by 12 is 1 with a remainder of 7. The formula to find a number's value is written as number mod base = value. The value is the remainder after the division of number / base

Numbers in modular arithmetic are shown as "numberbase" or "number mod base".

1512

or as

15 mod 12

Examples

Examples of modular arithmetic:

In base 12 (like clock)
1012 = 10 mod 12 = |remainder(10 / 12)| = 10
1112 = 11 mod 12 = |remainder(11 / 12)| = 11
1212 = 12 mod 12 = |remainder(12 / 12)| = 0
1312 = 13 mod 12 = |remainder(13 / 12)| = 1
2312 = 23 mod 12 = |remainder(23 / 12)| = 11
2412 = 24 mod 12 = |remainder(24 / 12)| = 0
In base 3
13 = 1 mod 3 = 1
33 = 3 mod 3 = 0
23 + 23 = (2 mod 3) + (2 mod 3) = 2 + 2 = 43 = 4 mod 3 = |remainder(4 / 3)| = 1
53 + 63 = (5 mod 3) + (6 mod 3) = 2 + 0 = 2
In base 10
910 + 110 = 1010 = 0
610 + 610 = 1210 = 2
1110 + 710 = 1810 = 8

Congruence

Modular arithmetic can also be used to show the idea of congruence. Two numbers a and b are congruent modulo n, if they have the same remainder, when they are divided by n. For example, the numbers 22 and 34 are congruent (modulo 12), because if they are divided by 12, they both have a remainder of 10.

Uses

Modular arithmetic is useful in many fields of science. Most notably is useful in cryptography, computer science, chemistry, music.

Template:Link FA Template:Link FA