Lesson 4.2 - Operations On Modular Arithmetic
Lesson 4.2 - Operations On Modular Arithmetic
Lesson 4.2 - Operations On Modular Arithmetic
less than n.
Lesson 4.2 - OPERATIONS ON MODULAR ARITHMETIC
Illustration:
Let n = 3, then
SPECIFIC OBJECTIVES
14(mod3)2 since 14=3∙4+2(2 is the remainder)
1. Name and explain the different operations on 9(mod3)0 since 9=3∙3+ 0(0 is the remainder)
modular arithmetic. 2(mod3)2 since 2=3∙0+ 2(2 is the remainder)
2. Perform and solve the operations on modulon
such as addition, subtraction, multiplication, the A. Addition Modulo n
additive and multiplicative inverse. To do the addition modulo n, let us have some
3. Solve the congruence equation. example.
INTRODUCTION
Solution:
During your senior high school, you have learned how to Add 23+38 to produce 61. To evaluate 61 mod
perform the four fundamental operations in 12, divide 61 by modulus, 12. The answer is the
mathematics in a higher level compare your lesson remainder.
during elementary days. You encounter on how to deal
with the addition, subtraction, multiplication and division
of numbers as well as the different properties of real
numbers.
For this lesson, you will be encountering another So (23+38) mod12 1since 61=12∙5+1 where 1 is
operation but this time it will be dealing in different the remainder.
operations in modulo n.
In modular arithmetic, adding the modulus to
a number does not change the equivalent
value of the number.
DISCUSSION
For instance;
In the previous theorem for a≡b(mod n), property (d) 13≡6 (mod 7)
and (e) is a part of arithmetic operations modulo n. The
20≡6(mod 7) add 7 to13
different arithmetic operations modulo n are as follows:
27≡6(mod 7) add 7 to 20 and soon.
1) addition modulo n,
Another example is;
2) subtraction modulo n,
3) multiplication modulo n and 12≡7(mod 5)
4) the additive and multiplicative inverses 17≡7(mod 5) add 5 to 12
In 29≡8(mod3), we could verify that its congruence is 22≡7(mod 5) add 5 to 17 and soon.
true since both 29 and 8 have remainder 2 when divided
by 3 which is the modulus. There are many other This property of modular arithmetic is
numbers congruent to 8 modulo 3, but of all these, only sometimes used in subtraction. It is possible
one is a whole number less than the modulus. This to use negative numbers modulo n. For
number is the result when evaluating a modulo instance;
expression, and in this case we use an equal sign. -2≡5 mod 7 is a true congruence. Why?
Because 2≡8 mod 3 and 2 is less than the modulus, we Applying the definition; ab(modn) where n|a–
can write 8 mod 3=2. In general, m mod n becomes the b, then
remainder when m is divided by n.
Solution:
In mod16 arithmetic, 7+ 9=16.
So, the only value for x is 2. Hence, (14–
So, the additive inverse of 7 is 9.
27)mod5=2.
b. If the product of two number is 1, then
the numbers are multiplicative inverses
of each other. This is one of the
C. Multiplication Modulo n properties of real number, i.e., (a)(1/a)=1
Like in addition and subtraction, let us
evaluate given example under multiplication So, the multiplicative inverse of 2 is 1/2
modulo n to perform the operation and the multiplicative inverse of 1/2 is2.
multiplication.
The same concept applies to modular
Evaluate (15∙23) mod 11. arithmetic (although the multiplicative
inverses will always be natural number).
We need to find the product of 15 and 23. The
product is 345. This product must be divided For example in mod 7 arithmetic, 5 is the
by the modulus,11 to be able to find its multiplicative inverse of 3 (and 3 is the
remainder. multiplicative inverse of 5) because
345= 11∙31+ 4
5∙3≡1 mod 7.
Hence, (15∙23)mod11= 4
Here, x= 1, 2, 3, 4, 5, and 6.
2x≡1mod 7
2(1)≡1mod 7(this is not a true
congruence)
2(2)≡1mod 7(this is not a true
congruence)
2(3)≡1mod 7(this is not a true
congruence)
2(4)≡1mod 7(this is a true
congruence)
2(5)≡1mod 7(this is not a true
congruence)
2(6)≡1mod 7(this is not a true
congruence) LESSON 4.3 - APPLICATIONS OF MODULAR ARITHMETIC
Hence, in mod 7 arithmetic, the
multiplicative of 2 is 4.
SPECIFIC OBJECTIVES
Z5 = {0,1,2, 3, 4}. We have 2+1=3 and 2+2=4 as usual. The first digits of an ISBN are 978 (or 979),
followed by 9 digits that are divided into three
Then 2+3=5, which is not in our set, so it wraps around groups of various lengths. These indicate the
giving 2+3=0. country or region, the publisher, and the title of
the book. The last digit (13th digit) is called a
Then 2+4=6, which wraps around to be 1.
check digit.
Z5= {1, 2, 3, 4, 0}
Illustration: 978–971–23–9357–0
Is ISBN valid?
d12=10-
(d1+3d2+d3+3d4+d5+3d6+d7+3d8+d9+3d10+3d11) Example:
mod10. Determine whether 5234-8213-3410-1298 is a
If d12= 10, then the check digit is 0. valid card number.
Solution:
Example.
The staple wire has a barcode of 9-02870-
766290. Is the UPC number of this product a Then; (1+0)+2+6+4+(1+6)+2+2+3+6+4+2+0+2+2+(1+
valid number? 8)+8=60
Solution: Since 60≡0mod10, this is a valid card number.
d12=10-
(d1+3d2+d3+3d4+d5+3d6+d7+3d8+d9+3d10+3d11) C. Cryptology and Cryptography
mod10.
d12=10–[3(9)+0+3(2)+ 8+3(7)+0+3(7)+ Another usage of modular arithmetic is
6+3(6)+2+3(9)]mod10 cryptography. But what is the difference between
d12=10–(27+0+ 6+ 8+21+ 0+ 21+ 6+ 18+ 2+ cryptology and cryptography? Based on
27)mod10 dictionary.com, cryptology is the study of codes
d12=10–136mod10 but 136= (10)(13)+ 6 while cryptography is the art of writing and
d12=10–6=4 solving them.
Let us have simple activity to be able to n=26 is the modulus since there are 26 letters in
understand what we mean by cryptography. an English alphabet.
Here is the activity to be done by the students.
Try to decrypt the secret code. Table
Cyclical English Alphabet
a b c d e f g h i j
1 2 3 4 5 6 7 8 9 10
- - - - - - - - - -
25 24 23 22 21 20 19 18 17 16
k l m n o p q r s t
11 12 13 14 15 16 17 18 19 20
- - - - - -
-9 -8 -7 -6
15 14 13 12 11 10
u v w x y z
21 22 23 24 25 0
Riddle No. 1. They come out at night without
-5 -4 -3 -2 -1
being called, and are lost in the day without
being stolen. What are they?
Note that the letter Z is coded as zero because
Answer: JKRI=___________
26≡0mod26.
Riddle No. 2. What has a face and two hands but So, with the use of modular arithmetic, how are
no arms and legs? we going to convert the plain text “LOVE” into its
Answer: TCFTB=___________ cipher text if each letter was shifted in 22
positions(m =22)?
Riddle No. 3: Why was the math book sad?
Answer: ZK YRU KFFDREPGIFSCVDJ=___________ For L: c≡(12+ 22)mod26=34 mod26= 8. So the
coded letter for L would be H.
Now, cryptology is the study of making and
breaking secret codes. It is very important to For O: c≡(15+ 22)mod26=37 mod26=11. So the
learn because there are industries or coded letter for O would be K.
government agencies that need to transmit For V: c≡(22+ 22)mod26=44 mod26=18. So the
secret message or information that it cannot be coded letter for V would be R.
understood by an unauthorized person most
For E: c≡(5+22)mod26=27 mod26=1. So the coded
especially if this message is intercepted.
letter for E would be A.
Different answer from our previous activity are
encrypted words that need to decrypt to be able Hence, the encrypted code for the word LOVE is
to break the code. The encrypted word is called HKRA.
the cipher text while the decrypted word is
called the plaintext. So, plain text is a message But how are we going to break the encrypted
before it is coded while the cipher text is the word. There must be a method by which the
message after it has been written in code. The person who received encrypted message into its
method of changing from plain text to cipher text original message (plaintext). For the cyclical
is called encryption. code, the congruence is;
p≡(c + n) mod26
But how the modular arithmetic can be used in where p and c are defined as before and n=26–m.
encrypting and decrypting the code? If the
The letter H in cipher text is decoded below
encrypting code is to shift each letter of the plain
text message in “m” positions, then the using the congruence p≡(c +n)mod26 such as;
corresponding letter in the cipher text message
is given by; Code:
c≡(p+ m)mod 26 H: n= 26–22=4, then p≡(8+ 4) mod26= 12 mod26=
where c is the encrypted code, p is the number 12
corresponds to a letter in an English alphabet in Hence, if you are going to decode H, it would be
a normal position, m is the shifted position and letter L.
The practicality of a cyclical alphabetic coding equation by the multiplicative of 5 which is 21
scheme is limited because it is relatively easy since (21)(5)=1mod26, it will become;
for a cryptologist to determine the coding 21(c –2)=(21)(5p)
scheme. A coding scheme that is a little more [21(c–2)]mod26p.
difficult to break is based on the congruence; Using this congruence, we can decode the
c≡(ap+ m) mod26 ciphertext message JGSAN.
where a and 26 do not have a common factor. J: p ≡[21(10–
For example, “a” cannot be 14 because 14 and 26 2)]mod26=(21)(8)mod26=168mod26=12.
have a common factor of 2. The reason why “a” So J will be decoded as L.
and 26 cannot have a common factor is related G: p≡[21(7–2)]mod26=(21)(5)mod26=105mod26=1.
to the procedure for determining the decoding
So G will be decoded as A.
congruence.
S: p≡[21(19–2)]
Example: mod26=(21)(17)mod26=357mod26=19.
Use the congruence c≡(5p+ 2)mod26 to encode So S will be decoded as S.
Rotated:
We got;
Reflected:
INTRODUCTION
DISCUSSION
A. Introduction to Group
Before we define group, let us recall the clock
arithmetic!
Now, let’s do the clock arithmetic. In arithmetic, there are only two operations, the
3+5 = addition and the multiplication.
4+3=
1–5= The opposite of addition is subtraction and the
opposite of multiplication is its reciprocal.
Here, we could say that clock arithmetic is also a
modular arithmetic.
Definition: Group
A group is a set of elements, with one operation P2. Let a, b, and c are element of an integer. The
and it must satisfy the following four properties: associative property of addition holds true for
the integers, i.e. (a + b) + c = a + (b + c).
P1: The set is close with respect to the operation. P3. Let Z = {...-3,-2,-1,0,1,2,3,...}. The identity
For all a, b 𝜖 G, then a * b 𝜖 G. element of Z is 0 and 0 is an integer. Hence,
Note that the operation would be + or • or in there is an identity for addition.
general *. P4. Let Z = {...-3,-2,-1,0,1,2,3,...}. Each element of
P2: The operation satisfies the associative law. Z has an inverse, i.e. if a 𝜖 Z, then –a is the
For all a, b, c 𝜖 G, then (a * b) * c = a * (b * c) inverse of a.
P3: There must be an identity element.
For every e 𝜖 G, such that e * a = a * e = a for all Because each of the four conditions of a group is
a𝜖G satisfied, the integers with addition as the
P4: Each element has an inverse. operation form a group or (Z, +) is a group.
For each a 𝜖 G then for every a-1 𝜖 G, such that Because each of the four conditions of a group is
a*a-1 = a-1*a = e. satisfied, the integers with addition as the
operation form a group or (Z, +) is a group.
Example 1:
The binary operator addition mod 5, denoted by *
is defined on the set Z={0,1,2,3,4}. Complete the
table and show that (Z, *) is a group.
D. Symbolic Notation
The operation notation for symmetry triangle can
be presented into other notation called as
symbolic notation and/or permutation.
Let us check: