Page 5-13
Operations in modular arithmetic
Addition in modular arithmetic
of modulus
n,
which is a positive integer,
follow the rules that if
j
and
k
are any two nonnegative integer numbers, both
smaller than
n
, if
j+k
≥
n
, then
j+k
is defined as
j+k-n
. For example, in the
case of the clock, i.e., for
n
= 12, 6+9 “=” 3. To distinguish this ‘equality’
from infinite arithmetic equalities, the symbol
≡
is used in place of the equal
sign, and the relationship between the numbers is referred to as a
congruence
rather than an equality. Thus, for the previous example we would write
6+9
≡
3 (mod 12),
and read this expression as “
six plus nine is congruent to three,
modulus twelve
.” If the numbers represent the hours since midnight, for
example, the congruence 6+9
≡
3 (mod 12), can be interpreted as saying
that “six hours past the ninth hour after midnight will be three hours past
noon.” Other sums that can be defined in modulus 12 arithmetic are: 2+5
≡
7 (mod 12); 2+10
≡
0 (mod 12); 7+5
≡
0 (mod 12); etcetera.
The rule for
subtraction
will be such that if
j – k < 0
, then
j-k
is defined as
j-k+n
.
Therefore,
8-10
≡
2 (mod 12),
is read “
eight minus ten is congruent to two,
modulus twelve
.” Other examples of subtraction in modulus 12 arithmetic
would be 10-5
≡
5 (mod 12); 6-9
≡
9 (mod 12); 5 – 8
≡
9 (mod 12); 5 –10
≡
7 (mod 12); etcetera.
Multiplication
follows the rule that if
j
⋅
k > n
, so that
j
⋅
k = m
⋅
n + r
, where
m
and
r
are nonnegative integers, both less than
n
, then
j
⋅
k
≡
r
(mod
n
). The result of
multiplying
j
times
k
in modulus
n
arithmetic is, in essence, the integer
remainder of
j
⋅
k
/
n
in infinite arithmetic, if
j
⋅
k>n
. For example, in modulus 12
arithmetic we have 7
⋅
3 = 21 = 12 + 9, (or, 7
⋅
3/12 = 21/12 = 1 + 9/12,
i.e., the integer reminder of 21/12 is 9). We can now write 7
⋅
3
≡
9 (mod
12), and read the latter result as “
seven times three is congruent to nine,
modulus twelve
.”
The operation of
division
can be defined in terms of multiplication as follows,
r/k
≡
j
(mod
n
), if,
j
⋅
k
≡
r
(mod
n
). This means that
r
must be the remainder
of
j
⋅
k/n
. For example, 9/7
≡
3 (mod 12), because 7
⋅
3
≡
9 (mod 12). Some
divisions are not permitted in modular arithmetic. For example, in modulus 12
arithmetic you cannot define 5/6 (mod 12) because the multiplication table of