5.1 Modular Arithmetic Part 2
5.1 Modular Arithmetic Part 2
Operations
Modulo n
Arithmetic modulo n (where n is a natural number)
requires us to evaluate a modular expression after
using the standard rules of arithmetic.
Thus, we perform the arithmetic operation and then
divide by the modulus. The answer is the remainder.
The result of an arithmetic operation mod n is
always a whole number less than n.
Example 5.1.5 Evaluate: (23 + 38) mod 12
Solution.
Add 23 + 38 to produce 61. To evaluate 61
mod 12, divide 61 by the modulus, 12. The
answer is the remainder.
Solution. (cont.)
The answer is 1.
Example 5.1.6 Evaluate each of the following.
a. (33 – 16) mod 6
b. b. (14 – 27) mod 5
Solution.
a. Subtract 33 – 16 = 17. The result is positive.
Divide the difference by the modulus, 6. The
answer is the remainder.
Solution.
The time can be determined by calculating (5 – 57) mod
12. Because 5 – 57 = –52 is a negative number, find a whole
number x less than the modulus 12, so that –52 ≡ x mod
12.
This means to find x so that is an integer.
Solution. (cont.)
Evaluating the expression for whole number values of
x less than 12, we have, when is an integer. Thus, (5
– 57) mod 12 = 8.
Therefore, if it is 5 o’clock now, 57 hours ago it was 8
o’clock.
Problems involving
multiplication can also be
performed modulo n.
Example 5.1.8 Evaluate: (15 · 23) mod 11
Solution.
Find the product 15 · 23 and then divide by the
modulus, 11. The answer is the remainder.
Solution.
Because (7 + 9) ≡ 0 mod 16, the additive inverse
of 7 is 9.
Example 5.1.12 Find the additive inverse of 5 in
mod 27 arithmetic.
Solution.
Because (5 + 22) ≡ 0 mod 27, the additive inverse
of 5 is 22.
TRY THIS!
Solution.
To find the multiplicative inverse of 2, solve the
equation 2x 1 mod 7 by trying different natural
number values of x less than the modulus.
Solution. (cont.)
𝑥 = 0: 2(0) 1 𝑚𝑜𝑑 7
𝑥 = 1: 2(1) 1 𝑚𝑜𝑑 7
𝑥 = 2: 2(2) 1 𝑚𝑜𝑑 7
𝑥 = 3: 2(3) 1 𝑚𝑜𝑑 7
𝑥 = 4: 2(4) ≡ 1 𝑚𝑜𝑑 7