Applications of the arithmetic menu, Modular arithmetic, Applications of the arithmetic menu ,5-12 – HP 50g Graphing Calculator User Manual

Page 189: Modular arithmetic ,5-12

Advertising
background image

Page 5-12

Applications of the ARITHMETIC menu

This section is intended to present some of the background necessary for
application of the ARITHMETIC menu functions. Definitions are presented next
regarding the subjects of polynomials, polynomial fractions and modular
arithmetic. The examples presented below are presented independently of the
calculator setting (ALG or RPN)

Modular arithmetic

Consider a counting system of integer numbers that periodically cycles back on
itself and starts again, such as the hours in a clock. Such counting system is
called a ring. Because the number of integers used in a ring is finite, the
arithmetic in this ring is called finite arithmetic. Let our system of finite integer
numbers consists of the numbers 0, 1, 2, 3, …, n-1, n. We can also refer to the
arithmetic of this counting system as modular arithmetic of modulus n. In the
case of the hours of a clock, the modulus is 12. (If working with modular
arithmetic using the hours in a clock, however, we would have to use the integer
numbers 0, 1, 2, 3, …, 10, 11, rather than 1, 2, 3,…,11, 12).

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

Advertising