Arithmetic-Modulo
Arithmetic-Modulo
Km
Illustration:
K m = Quotient
Illustration:
K m = Quotient + remainder
Illustration:
K m = Quotient + remainder
K mod m = remainder
Finding Arithmetic Modulo(Positive
#’s)
5 mod 3
Finding Arithmetic Modulo(Positive
#’s)
5 mod 3
Answer : 2
Finding Arithmetic Modulo(Positive
#’s)
32 mod 7
Finding Arithmetic Modulo(Positive
#’s)
32 mod 7
Answer : 4
Finding Arithmetic Modulo(Positive
#’s)
25 mod 5
Finding Arithmetic Modulo(Positive
#’s)
25 mod 5
Answer : 0
Finding Arithmetic Modulo(Positive
#’s)
175 mod 10
Finding Arithmetic Modulo(Positive
#’s)
175 mod 10
Answer : 5
Finding Arithmetic Modulo(Positive
#’s)
14 mod 20
Finding Arithmetic Modulo(Positive
#’s)
14 mod 20
Answer 14
Finding Arithmetic Modulo(Positive
#’s)
(35 – 7) mod 3
Finding Arithmetic Modulo(Positive
#’s)
(35 – 7) mod 3
Answer : 1
Finding Arithmetic Modulo(Positive
#’s)
20 – 45 mod 7
Finding Arithmetic Modulo(Positive
#’s)
20 – 45 mod 7
Answer : 17
Finding Arithmetic Modulo (negative #’s)
- k mod m
Steps:
Finding Arithmetic Modulo (negative #’s)
- k mod m
Steps:
a. /k/ mod m = r’
Finding Arithmetic Modulo (negative #’s)
- k mod m
Steps:
a. /k/ mod m = r’
b. r = m – r’
Finding Arithmetic Modulo
(negative #’s)
- 6 mod 4
Finding Arithmetic Modulo
(negative #’s)
- 6 mod 4
Answer : 2
Finding Arithmetic Modulo
(negative #’s)
- 32 mod 5
Finding Arithmetic Modulo
(negative #’s)
- 32 mod 5
Answer: 3
Congruence of Arithmetic
Modulo
K mod m r
iff (if and only if) the difference of K – r or r –
k is
divisible by m
Example : Verify the congruence of
the A. Modulo
18 mod 2 2
Answer :
True, it is congruence
Example : Verify the congruence of
the A. Modulo
400 mod 7 25
Answer :
35 mod 4 3
Answer :
True, it is congruence
APPLICATION OF MODULO
CHECKING OF CHECK DIGITS
CHECK DIGIT- is a single digit that is added
to a bar code and used for verifying
accuracy.
It a form of redundancy check used for
error detection on identification numbers,
such as bank account numbers, which are
used in an application where they will at
least sometimes be input manually.
Samples of Check digits
Universal Product Code (UPC) – it composed
of 12 digits
Samples of Check digits
Samples of Check digits
International Standard Book Code (ISBN)
Sample of Check Digits
Credit Card No/ Acct no. – it is composed of
16 digits code
Formulas for Checking Check
digits
Formulas for Checking Check
Digits
Examples:
Determine the check digit for a new
product given that the first 11 digits are 8-
21345-67132- _____?
Examples:
Determine the check digit for a new
product given that the first 11 digits are 8-
21345-67132- _____?
Examples:
Determine the check digit for a new
product given that the first 11 digits are 8-
21345-67132- _____?
Answer : 4
Examples:
.Determine the check digit of book with an
ISBN-10 first 9 digits of 0-17-316444- ?
Examples:
.Determine the check digit of book with an
ISBN-10 first 9 digits of 0-17-316444- ?
Examples:
.Determine the check digit of book with an
ISBN-10 first 9 digits of 0-17-316444- ?
Answer: 7
Examples:
Verify if the given Credit Card identification
number 4301-1234-8888-3751 is valid.
Examples:
Verify if the given Credit Card identification
number 4301-1234-8888-3751 is valid.
D16 = 10 –
(8+3+0+1+2+2+6+4+1+6+8+1+6+8+6+
7+1+0)mod 10
D16 = 10 – 70 mod10 = 10 – 0 = 10 = 1+0 = 1
Examples:
Verify if the given Credit Card identification
number 4301-1234-8888-3751 is valid.
d1= 10 – (8+3+0+1+2+2+6+4+1+6+8+1+6+8+6+7+1+0)
D16
mod 10
D16 = 10 – 70 mod 10 = 10 -0 = 10 = 1+0 = 1
2.) 50 (mod 4)
3.) 55 (mod 7)
4.) 34 (mod 4)
5.) 75 (mod 5)
Assignment
6. 45 – 45 mod 7
7. (36-79) mod 14
8. (16 mod 5) + 4
Assignment:
Determine the check digit of the following UPC.
1.) 3-12345-67890-
2.) 4-15902-74212-
Assignment:
B. Determine the check digit of the following
Credit Card.
1.) 3212-3921-8282-128
2.) 3219-1245-7542-927
C. Determine the check digit of the following
ISBN.
1.) 123-456-789-333-
2.) 432-748-909-001-