LESSON 6 MMW Modular Arithmetic

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 80

MODULAR

ARITHMETIC
MODULAR
ARITHMETIC 01
MODULO 02 REMAINDER
CONGRUENCE 03
04 MODULO TABLE
APPLICATIONS 05
MODULAR
ARITHMETIC
MODULAR ARITHMETIC

• a system of arithmetic for integers, which considers


the remainder.
• numbers "wrap around" upon reaching a given fixed
quantity (this given quantity is known as the modulus)
to leave a remainder.
• The most common example of modular arithmetic is
with a 12-hour clock.
MODULAR ARITHMETIC

WHERE:
A is the dividend B is the divisor
Q is the quotient R is the remainder
MODULAR ARITHMETIC

MODULO OPERATOR (mod) - returns the remainder of


a division

Where B is referred to as the modulus.


MODULAR ARITHMETIC

EXAMPLE

13
= 2 𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟 3
5

13 𝑚𝑜𝑑 5 = 3
REMAINDER
REMAINDER

REMAINDER - the integer "left over" after dividing one


integer by another to produce an integer quotient.
REMAINDER

To get all the possible remainders of a number use the


rule.
REMAINDER

EXAMPLE
What are the possible remainders if you divide a number by 3?
𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟3 =

What are the possible remainders if you divide a number by 6?


𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟6 =

What are the possible remainders if you divide a number by 12?


𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟10 =
REMAINDER

EXAMPLE
What are the possible remainders if you divide a number by 3?
𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟3 = {0,1,2}

What are the possible remainders if you divide a number by 6?


𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟6 = {0,1,2,3,4,5}

What are the possible remainders if you divide a number by 12?


𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟10 = {0,1,2,3,4,5,6,7,8,9,10,11}
MODULO
CONGRUENCE
6 = 10
✔6 = 10
6 ≡10 (mod 4)
6 mod 4 = 2
10 mod 4 = 2
MODULO CONGRUENCE

• An equivalence relation that is compatible with the


operations of addition, subtraction, and multiplication.
MODULO CONGRUENCE

• An equivalence relation that is compatible with the


operations of addition, subtraction, and multiplication.

The symbol for congruence


MODULO CONGRUENCE

EXAMPLE
Identify if the statement is correct.

11 ≡ 19(𝑚𝑜𝑑 8)
MODULO CONGRUENCE

EXAMPLE
8
Identify if the statement is correct.
9

11 ≡ 19 𝑚𝑜𝑑 8
10

11
MODULO CONGRUENCE

EXAMPLE
Identify if the statement is correct.

11 ≡ 19 𝑚𝑜𝑑 8

11 mod 8 = 3
MODULO CONGRUENCE

EXAMPLE
Identify if the statement is correct.

11 ≡ 19 𝑚𝑜𝑑 8

11 mod 8 = 3
MODULO CONGRUENCE

EXAMPLE
8
Identify if the statement is correct.
9
15

11 ≡ 19 𝑚𝑜𝑑 8
14 10
11 mod 8 = 3

13 11

12
MODULO CONGRUENCE

EXAMPLE
16
Identify if the statement is correct.
17
15

11 ≡ 19 𝑚𝑜𝑑 8
14 18
11 mod 8 = 3

13 19

12
MODULO CONGRUENCE

EXAMPLE
Identify if the statement is correct.

11 ≡ 19 𝑚𝑜𝑑 8

11 mod 8 = 3

11 mod 8 = 3
MODULO CONGRUENCE

EXAMPLE
Identify if the statement is correct.

9 ≡ 21(𝑚𝑜𝑑 12)
MODULO CONGRUENCE

EXAMPLE
Identify if the statement is correct.

9 ≡ 21(𝑚𝑜𝑑 12)

9 𝑚𝑜𝑑 12 = 9
MODULO CONGRUENCE

EXAMPLE
12
Identify if the statement is correct. 13

9 ≡ 21(𝑚𝑜𝑑 12) 14

9 𝑚𝑜𝑑 12 = 9 21 15

20 16

19 17
18
MODULO CONGRUENCE

EXAMPLE
Identify if the statement is correct.

9 ≡ 21(𝑚𝑜𝑑 12)

9 𝑚𝑜𝑑 12 = 9
21 𝑚𝑜𝑑 12 = 9
MODULO TABLE
MODULO TABLE: ADDITION

𝐴 + 𝐵 𝑚𝑜𝑑 𝐶 = 𝐴 𝑚𝑜𝑑 𝐶 + (𝐵 𝑚𝑜𝑑 𝐶)

𝐴 + 𝐵 𝑚𝑜𝑑 𝐶
MODULO TABLE: ADDITION

EXAMPLE

25 + 30 (𝑚𝑜𝑑 8)
MODULO TABLE: ADDITION

EXAMPLE

25 + 30 𝑚𝑜𝑑 8
25 + 30 𝑚𝑜𝑑 8 = 25 𝑚𝑜𝑑 8 + 30 𝑚𝑜𝑑 8

25 + 30 𝑚𝑜𝑑 8 = 1 + 6

25 + 30 𝑚𝑜𝑑 8 = 7
MODULO TABLE: ADDITION
MODULO TABLE: MULTIPLICATION

𝐴 ∗ 𝐵 𝑚𝑜𝑑 𝐶 = 𝐴 𝑚𝑜𝑑 𝐶 ∗ (𝐵 𝑚𝑜𝑑 𝐶)

𝐴 ∗ 𝐵 𝑚𝑜𝑑 𝐶
MODULO CONGRUENCE

EXAMPLE

25 ∗ 30 (𝑚𝑜𝑑 8)

25 ∗ 30 𝑚𝑜𝑑 8 = 25 𝑚𝑜𝑑 8 + 30 𝑚𝑜𝑑 8

25 ∗ 30 𝑚𝑜𝑑 8 = 1 ∗ 6

25 ∗ 30 𝑚𝑜𝑑 8 = 6
MODULO TABLE: MULTIPLICATION
MODULO TABLE: ADDITION

mod 3 + 0 1 2

2
MODULO TABLE: ADDITION

mod 3 + 0 1 2

0 0 1 2

2
MODULO TABLE: ADDITION

mod 3 + 0 1 2

0 0 1 2

1 1 2 0

2
MODULO TABLE: ADDITION

mod 3 + 0 1 2

0 0 1 2

1 1 2 0

2 2 0 1
MODULO TABLE: MULTIPLICATION

mod 3 x 0 1 2

0 0 0 0

2
MODULO TABLE: MULTIPLICATION

mod 3 x 0 1 2

0 0 0 0

1 0 1 2

2
MODULO TABLE: MULTIPLICATION

mod 3 x 0 1 2

0 0 0 0

1 0 1 2

2 0 2 1
MODULO TABLE: ADDITION

mod 4 + 0 1 2 3
0
1
2
3
MODULO TABLE: MULTIPLICATION

mod 4 x 0 1 2 3
0
1
2
3
APPLICATION OF
MODULAR
ARITHMETIC
APPLICATION OF MODULAR ARITHMETIC
APPLICATION OF MODULAR ARITHMETIC

ISBN (International Standard Book Number)


• A product identifier used by publishers, booksellers,
libraries and other supply chain participants for
ordering, listing, sales records, and stock control
purposes.
• Identifies the registrant, as well as the specific title,
edition and format.
• Originally it was 10 digits in length (up to Dec 2006)
but since Jan 2007 it now consists of 13 digits.
APPLICATION OF MODULAR ARITHMETIC
APPLICATION OF MODULAR ARITHMETIC

EXAMPLE
ISBN: 978-136-80-2409-9
𝒅𝒄 = 𝟏𝟎 − 𝒅𝟏 + 𝟑𝒅𝟐 + 𝒅𝟑 + 𝟑𝒅𝟒 + 𝒅𝟓 + 𝟑𝒅𝟔 + 𝒅𝟕 + 𝟑𝒅𝟖 + 𝒅𝟗 + 𝟑𝒅𝟏𝟎 + 𝒅𝟏𝟏 + 𝟑𝒅𝟏𝟐 𝒎𝒐𝒅 𝟏𝟎

𝒅𝒄 = 𝟏𝟎 − 𝟗 + 𝟑(𝟕) + 𝟖 + 𝟑(𝟏) + 𝟑 + 𝟑(𝟔) + 𝟖 + 𝟑(𝟎) + 𝟐 + 𝟑(𝟒) + 𝟎 + 𝟑(𝟗) 𝒎𝒐𝒅 𝟏𝟎

𝒅𝒄 = 𝟏𝟎 − 𝟗 + 𝟐𝟏 + 𝟖 + 𝟑 + 𝟑 + 𝟏𝟖 + 𝟖 + 𝟎 + 𝟐 + 𝟏𝟐 + 𝟎 + 𝟐𝟕 𝒎𝒐𝒅 𝟏𝟎

𝒅𝒄 = 𝟏𝟎 − 𝟗 + 𝟐𝟏 + 𝟖 + 𝟑 + 𝟑 + 𝟏𝟖 + 𝟖 + 𝟎 + 𝟐 + 𝟏𝟐 + 𝟎 + 𝟐𝟕 𝒎𝒐𝒅 𝟏𝟎

𝒅𝒄 = 𝟏𝟎 − 𝟏𝟏𝟏 𝒎𝒐𝒅 𝟏𝟎

𝒅𝒄 = 𝟏𝟎 − 𝟏

𝒅𝒄 = 𝟗
APPLICATION OF MODULAR ARITHMETIC
APPLICATION OF MODULAR ARITHMETIC

UPC (Universal Product Code)


• A 12-digit number that identifies a product
• Most commonly is a barcode found in grocery items.
APPLICATION OF MODULAR ARITHMETIC
APPLICATION OF MODULAR ARITHMETIC

CREDIT CARD VALIDATION


• Usually 13 to 16-digits
• Uses the Luhn Algorithm
MODULO ART
MODULO ART

mod 3 + 0 1 2

0 0 1 2

1 1 2 0

2 2 0 1
MODULO ART

mod 3 + 0 1 2

0 0 1 2

1 1 2 0

2 2 0 1
MODULO ART

mod 3 x 0 1 2

0 0 0 0

1 0 1 2

2 0 2 1
MODULO ART

0 1 2
MODULO ART
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 1 2

1 2 0 1

2 0 1 2
MODULO ART

0
0 0 0

0 1 2 1

0 2 1 2
MODULO ART

0
0 0 0

0 1 2 1

0 2 1 2
MODULO ART

0
0 0 0

0 1 2 1

0 2 1 2
MODULO ART

0
0 0 0

0 1 2 1

0 2 1 2
THANK YOU
Does anyone have any questions?
patrickjustin_ariado@tup.edu.ph
Fonts & colors used
This presentation has been made using the following fonts:

Passion One
(https://fonts.google.com/specimen/Passion+One)

Abel
(https://fonts.google.com/specimen/Abel)

#f9e9d9 #5b72b7

You might also like