Nothing Special   »   [go: up one dir, main page]

Module 4 2 Operation On Modular Arithmetic

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 28

Module 4

MATHEMATICAL SYSTEM
Topic 4 - 2
OPERATIONS ON
MODULAR ARITHMETIC
Objectives:

At the end of this lesson, the student should be able to:

1. Name and explain the different operations on


modular arithmetic.
2. Perform and solve the operations on modulo n
such as addition, subtraction, multiplication, the additive
and multiplicative inverse.
3. Solve the congruence equation.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS MODULAR ARITHMETIC


During your senior high school, you have learned how
to perform the four fundamental operations in mathematics
at a higher level compared to your lesson during elementary
days. You encounter 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


operation but this time it will be dealing in different
operations in modulo n.
MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC
In the previous theorem for a ≡ b(mod n),
property (d) and (e) is a part of arithmetic
operations modulo n. The different
arithmetic operations modulo n are as
follows: 1) addition modulo n, 2)
subtraction modulo n, 3) multiplication
modulo n and 4) the additive and
multiplicative inverses.
MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC
In 29 ≡ 8 (mod 3), we could verify that its congruence
is true since both 29 and 8 have remainder 2 when
divided by 3 which is the modulus. There are many other
numbers congruent to 8 modulo 3, but of all these, only
one is a whole number less than the modulus. This
number is the result when evaluating a modulo
expression, and in this case we use an equal sign.
Because 2 ≡ 8 mod 3 and 2 is less than the modulus, we
can write 8 mod 3 = 2. In general, m mod n becomes the
remainder when m is divided by n.
MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC
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.
MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC
Illustration:
Let n = 3, then

14 (mod 3) ≡ 2 since 14 = 3∙4 + 2 ( 2 is the


remainder)

9(mod 3) ≡ 0 since 9 = 3∙3 + 0 (0 is the remainder)

2(mod 3) ≡ 2 since 2 = 3∙0 + 2 ( 2 is the remainder)


MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC
Addition Modulo n
To do the addition modulo n, let us have some example.

Evaluate (23 + 38) mod 12.

Solution:

Add 23 + 38 to produce 61. To evaluate 61 mod 12, divide 61 by modulus, 12. The
answer is the remainder.

So (23 + 38) mod 12  1 since 61 = 125 + 1 where 1 is the remainder.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


In modular arithmetic, adding the modulus to a
number does not change the equivalent value of the
number.

For instance; 13  6 (mod 7)


20  6 (mod 7) add 7 to 13
27  6 (mod 7) add 7 to 20 and so on.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Another example is;

12  7 (mod 5)
17  7 (mod 5) add 5 to 12
22  7 (mod 5) add 5 to 17 and so on.

This property of modular arithmetic is sometimes used in


subtraction. It is possible to use negative numbers modulo n.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


For instance;

-2  5 mod 7 is a true congruence. Why? Applying the


definition; a  b (mod n) where n | a – b, then

−𝟐 −𝟓 −𝟕
= =−𝟏  𝒁
𝟕 𝟕

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Subtraction Modulo n
The following examples give you on how be able to perform
subtraction.

Evaluate (33 – 16)mod 6.

Here, subtracting 16 from 33, we will be able to get a positive


result, i.e. 17. Divide the difference by the modulus, 6 we get:

17 = 62 + 5.

So, (33 – 16) mod 6 = 5

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


2. Evaluate (14 – 27) mod 5

If we subtract 27 from 14, we will get a negative answer, i.e., -13. On that case, we must
find x so that -13  x mod 5. Thus we must find x so that the value of is an integer. Trying the
whole number values of x less than 5, the modulus, i.e. x = 0, 1, 2, 3, and 4, then;

So, the only value for x is 2.


Hence, (14 – 27) mod 5 = 2.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Multiplication Modulo n

Like in addition and subtraction, let us evaluate given example under


multiplication modulo n to perform the operation multiplication.

Evaluate (1523)mod 11.

We need to find the product of 15 and 23. The product is 345. This
product must be divided by the modulus, 11 to be able to find its remainder.

345 = 1131 + 4

Hence, (1523)mod 11 = 4

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Additive Inverse in Modular Arithmetic

Recall that if the sum of two numbers is zero (0),i.e. a + (-a) = 0, then the
numbers are additive inverses of each other. For instance, 5 + (-5) = 0. So 5 is the
additive invers of -5 and -5 is the additive inverse of 5.

The same concept applies in modular arithmetic. For example;

(3 + 5)  0 mod 8.

Thus, in mod 8 arithmetic, 3 is the additive inverse of 5, and 5 is the


additive inverse of 3. Here, we consider only those whole number smaller that
the modulus. Note that 3 + 5 = 8; that is, the sum of a number and its additive
inverse equals the modulus. Using this fact, we can easily find the additive
inverse of a number for any modulus. For instance, in mod 11 arithmetic, the
additive inverse of 5 is 6 because 5 + 6 = 11.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Let us have additional example.

Find the additive inverse of 7 in mod 16 arithmetic.

Solution:

In mod 16 arithmetic, 7 + 9 = 16. So, the


additive inverse of 7 is 9.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Multiplicative Inverse in Modular Arithmetic

If the product of two number is 1, then the numbers are


multiplicative inverses of each other. This is one of the properties of
real number, i.e., . So, the multiplicative inverse of 2 is 1/2 and the
multiplicative inverse of 1/2 is 2.

The same concept applies to modular arithmetic (although the


multiplicative inverses will always be natural number). For example in
mod 7 arithmetic, 5 is the multiplicative invers of 3 (and 3 is the
multiplicative inverse of 5) because 53  1 mod 7. Here, we will concern
ourselves only with natural numbers less than the modulus. To find the
multiplicative inverse of a mod m, solve the modular equation ax = 1 mod
m for x.
MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC
Example:
In mod 7 arithmetic, find the multiplicative inverse of 2.

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. Our x < n  N including 0.

Here, x = 0,1,2,3,4,5, and 6.


2x  1 mod 7
2(0)  1 mod 7 (this is not a true congruence)
2(1)  1 mod 7 (this is not a true congruence)
2(2)  1 mod 7 (this is not a true congruence)
2(3)  1 mod 7 (this is not a true congruence)
2(4)  1 mod 7 (this is a true congruence)
2(5)  1 mod 7 (this is not a true congruence)
2(6)  1 mod 7 (this is not a true congruence)

Hence, in mod 7 arithmetic, the multiplicative of 2 is 4.

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


SOLVING CONGRUENCE
EQUATION

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Solving a congruence equation means finding all whole numbers values of the variable for which the
congruence is true.

Let us have an example on how to solve the congruence equation.

Example: Solve 3x + 5  3 mod 4. Here, we need to search for whole number values of x for which
the congruence is true.

Solution:
3x + 5  3 mod 4 “if x is less than the modulus”

If x = 0 3(0) + 5  3 mod 4 (this is not a true congruence) x = 10


If x = 1 3(1) + 5  3 mod 4 (this is not a true congruence)
If x = 2 3(2) + 5  3 mod 4 (this is a true congruence, so 2 is a solution)
If x = 3 3(3) + 5  3 mod 4 (this is not a true congruence)
If x = 4 3(4) + 5  3 mod 4 (this is not a true congruence)
If x = 5 3(5) + 5  3 mod 4 (this is not a true congruence)
If x = 6 3(6) + 5  3 mod 4 (this is a true congruence, so 6 is a solution).
… If x = 10; if x = 14; if x = 18

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Now, if we continue trying to find the
other values to be a solution, we could find
that 10 and 14 are also a solution. Note
that 6, 10 and 14 are all congruent to 2
mod 4. Thus the solutions of 3x + 5  3
mod 4 are 2, 6, 10, 14, 18, …

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Example : Solve 3x + 4 = 2x + 8 (mod 9)
Solution:
3x + 4 = 2x + 8 (mod 9)
− 4 = − 4 (mod 9)

3x = 2x + 4 (mod 9)
− 2x = − 2x + (mod 9)

x= 4 (mod 9)

The solution is x = 4 (mod 9)


Or
3x + 4 = 2x + 8 (mod 9)

(3x – 2x) = (8 – 4)(mod 9)

x = 4(mod 9)

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Self-Learning Activity

Evaluate the following arithmetic operations modulo n.


Note: a ≤ n and a is positive.

a) (46 + 53)mod 8 = f) (46 – 87)mod 5 =


b) (43 + 29)mod 10 = g) (8)(13)mod 4 =
c) (56 – 24) mod 17 = h) (16)(25) mod 18 =
d) (29 – 18) mod 3 = i) (-23)(35)mod 29 =
e) (67 – 93) mod 9 = j) (-24)(-32)mod 13 =

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Self-Learning Activity

Find the additive and multiplicative inverse of the following if


any. If there is no additive or multiplicative inverse, explain why
there is no such as inverses.

a) (x + 15) = 0 mod 29 ; x= f) 5x = 1mod 9 ; x=


b) (23 + x) = 0 mod 27 ; x= g) 14x = 1mod 41 ; x=
c) (x – 45) = 0 mod 89 ; x= h) 6x = 1mod 41 ; x=
d) (46 – x) = 0 mod 16 ; x= i) 7x = 1 mod 13 ; x =
e) (2x – 16) = 0 mod 18; x= j) 11x = 1 mod 7 ; x=

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Self-Learning Activity

Find the value of x if any.

a) (13 + x) = 3mod 16 ; x =

b) (3x + 24) = (4 + x) mod 9 ; x =

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Self-Learning Activity

Complete the table. Suppose that n = 7. Filled out the table on Z7 = {0,1,2,3,4,5,6}

+ 0 1 2 3 4 5 6
0 0 1 2 3 4 5 6
1
2 0
3
4
5 3
6 5

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC


Self-Learning Activity

Complete the table. Suppose that n = 7. Filled out the table on Z7 = {0,1,2,3,4,5,6}

x 0 1 2 3 4 5 6
0
1
2
3
4 4 1 2
5 1
6

MODULE 4: MATHEMATICAL SYSTEM | TOPIC 2 : OPERATIONS ON MODULAR ARITHMETIC

You might also like