0% found this document useful (0 votes)
552 views

Modular Arithmetic

The document discusses modular arithmetic and its applications. Some key points: - Modular arithmetic involves performing arithmetic operations (addition, subtraction, multiplication) and taking remainders modulo a number (the modulus). - It has applications in areas like telling time using a 12-hour clock, determining days of the week, and coding systems like Universal Product Codes (UPCs) and credit card numbers. - Properties of congruences and solving congruence equations are explored. Operations like finding additive/multiplicative inverses in modular arithmetic are also covered.

Uploaded by

Javadd Kilam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
552 views

Modular Arithmetic

The document discusses modular arithmetic and its applications. Some key points: - Modular arithmetic involves performing arithmetic operations (addition, subtraction, multiplication) and taking remainders modulo a number (the modulus). - It has applications in areas like telling time using a 12-hour clock, determining days of the week, and coding systems like Universal Product Codes (UPCs) and credit card numbers. - Properties of congruences and solving congruence equations are explored. Operations like finding additive/multiplicative inverses in modular arithmetic are also covered.

Uploaded by

Javadd Kilam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Modular Arithmetic

Perform the + or - operator.


a) 8 + 3 = 11
b) 8 - 5 = 3
c) 8 + 16 = 0
d) 8 + 9 = 5
e) 8 - 10 = 10
f) 8 - 12 = 8

- If it is 11 o'clock and you have to finish your math homework in 18 hours, what hour will it be at that time?
Answer: 11 + 18 = 5.
Hence the time that the homework could it be finished is 5 o’clock.

- If it is 12:00 now, what time is it in 12 hours? What is the remainder when you divide 12 by 12?
Answer: Using the 12-hour clock based on the given figure above, if it is now 12:00, the time after another
12 hour is also 12 o’clock and it has an equivalent number as zero (0).
If we are going to divide 12 by 12, it is very obvious that the remainder is 0.

- If it is 12:00 now, what time is it in 18 hours? What is the remainder when you divide 18 by 12?
Answer: Similar on what we do to example 3, if it is now 12:00, adding 18 hours starting from 12 (0) would
give us 6 o’clock. Dividing 18 by 12, the remainder would be 6. Hence, the time after 18 hours starting to 12
o’clock is 6 o’clock.

Days of the week

4 + 6 = 3 (Thursday)
and
0 + 16 = 2 (Wednesday)
Monday = 0
Tuesday = 1
Wednesday = 2
Thursday = 3
Friday = 4
Saturday = 5
Sunday = 6

Let us say today is Wednesday. What would be the day 11 days after Wednesday? What
would be the remainder if we are going to divide 11 by 7?
Answer: Based on our given days in a week above, the equivalent number for Wednesday is 2. Adding
11 days after Wednesday, we got Sunday where this day has an equivalent number as 6. Adding 2
by 11, the result is 13 and if we are going to divide 13 by 7, the result is 6. Hence, 2 + 11 = 6.

Activity:
Modular Arithmetic
Two integers a and b are said to be congruent modulo n, where n is an element of N, if is an integer. In
this case, we write a ≡ b (mod n). The number n is called the modulus. The statement a ≡ b (mod n) is called
a congruence.
This could be stated in this form.
If a, b ∈ Z and n ∈ Z+ , then a ≡ b (mod n) if and only if n | a – b.

12 – hour clock addition table

Modulo 12 Addition Table

Based on the given table above, each expression follows the modular arithmetic under modulo 12.

a) 12 ≡ 0 (mod 12)
b) 21 ≡ 9 (mod 12)
c) 37 ≡ 1 (mod 12)
d ) 17≡ 5 (mod 12)

Write in the form a ≡ b(mod n) the statement 3 | 6.


Answer:
3 | 6 could be written as 3 | (18 – 12);
where n = 3, a = 18 and b = 12.

So, we could write this as


18 ≡ 12 (mod 3) 12 ≡ 18 (mod 3)
Is 53 ≡ 17 (mod 3)? How about 53 ≡ 14 (mod 3)? What about 53 ≡ 11(mod 3)?
Answer:
The 53 ≡ 17 (mod 3) can be written in a form of Now, let a = 53, b = 17 and n = 3.

Another way to be able to write in a congruence modulo n is by dividing by n and take the remainder. Let
us say n = 3. Then;
14(mod 3) ≡ 2; that is 14 = (3)(4) + 2. The remainder is 2.
9 (mod 3) ≡ 0; that is 9 = (3)(3) + 0. The remainder is 0.
2 (mod 3) ≡ 2; since 2 = (3)(0) + 2.
-1 (mod 3) ≡ 2; since -1 = (3)(-1) + 2
-5 (mod 3) ≡ 1; since -5 = (3)(-2) + 1. The remainder is 1.

Tell whether the congruence is true or not.


29 ≡ 8 mod 3
7 ≡ 12 mod 5
15 ≡ 4 mod 6.

An alternative method to determine a true congruence in a ≡ b(mod n), where a and b are whole numbers,
then when a and b is divided by n, they must have the same remainder.
Let us say the given modulo is 53 ≡ 17 (mod 3). Now, if we divide 53 to 3, then;
53 = (3)(17) + 2. The remainder is 2
and if we divide 17 to 3, we get;
17 = (3)(5) + 2. The remainder is also 2.

Theorem
For arbitrary integers a and b, a ≡ b(mod n) if and only if a and b have the same remainder when divided by n.

Properties On Congruence
Let n > 0 be fixed and a, b, c and d are arbitrary integers. Then,
a) a ≡ a(mod n)
b) if a ≡ b(mod n) then b ≡ a(mod n)
c) if a ≡ b(mod n) and b ≡ c(mod n), then a ≡ c(mod n)
d) if a ≡ b(mod n) and c ≡ d(mod n), then a + c = b + d (mod n) and ac ≡ bd (mod n)
e) if a ≡ b(mod n), then a + c ≡ b + c (mod n) and ac ≡ bc (mod n)
f) If a ≡ b (mod n), then ak ≡ bk (mod n)

Activity:
Determine whether the following is congruence or not congruence. Write your answer on the right side of
each item.
a) 5 ≡ 8 (mod 3) f) 11 ≡ 15 (mod 4)
b) 5 ≡ 20 (mod 4) g) 7 ≡ 21 (mod 3)
c) 21 ≡ 45 (mod 6) h) 18 ≡ 60 (mod 7)
d) 88 ≡ 5 (mod 9) i) 72 ≡ 30 (mod 5)
e) 100 ≡ 20 (mod 8) j) 25 ≡ 85 (mod 12)
Direction: Answer the following questions. Write your answer after each item.
a) What is 13mod1?
b) What is -4mod9?
c) What is -13mod1?
d) What is -14mod2?
e) What is 14mod2?
Which of the following integers are valid for solutions for x?

1. Given x ≡ 17 mod 4
a) -43 b) -17 c) 15 d) 25
2. Given x ≡ 11 mod 8
a) -77 b) 77 c) 27 d) 25

Fill out the table of a modulo 4 addition table and transform each item in a form of a ≡ b mod n.
+ 0 1 2 3 a) 3 + 3 =
0 b) 2 + 3 =
1 c) 1 + 2 =
2 d) 0 + 0 =
3 e) 2 + 2 =
Operations of Modular Arithmetic

Operations of modulo n
1) addition modulo n
2) subtraction modulo n
3) multiplication modulo n
4) additive and multiplicative inverses.

29 ≡ 8 (mod 3)
2 ≡ 8 mod 3
8 mod 3 = 2

Addition Modulo n
Evaluate (23 + 38) mod 12.
61 mod 12.
(23 + 38) mod 12 ≡ 1

Subtraction Modulo n
Evaluate (14 – 27) mod 5.
(-13) mod 5
-13 ≡ x mod 5.

So, the only value for x is 2. Hence, (14 – 21) mod 5 = 2.

Multiplication Modulo n
Evaluate (15•23)mod 11.
345 = 11•31 + 4
Hence, (15•23)mod 11 = 4

Additive Inverse in Modular Arithmetic


(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.
Find the additive inverse of :
1. 7 in mod 16 arithmetic.
2. 5 in mod 11 arithmetic

Multiplicative Inverse in Modular Arithmetic


5 is the multiplicative inverse of 3
and 3 is the multiplicative inverse of 5
5•3 ≡ 1 mod 7
To find the multiplicative inverse of a mod m, solve the modular equation
ax = 1 mod m for x.

Example
In mod 7 arithmetic, find the multiplicative inverse of 2.
2x ≡ 1 mod 7
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.

SOLVING CONGRUENCE EQUATION


Finding all whole numbers values of the variable for which the congruence is true.
Solve 3x + 5 ≡ 3 mod 4.
If x = 0 3(0) + 5 ≡ 3 mod 4 (this is not a true congruence)
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)

Self-Learning Activity

A. Evaluate the following arithmetic operations modulo n. Note: a ≤ n and a is positive.


1) (46 + 53)mod 8 = 6) (46 – 87)mod 5 =
2) (43 + 29)mod 10 = 7) (8)(13)mod 4 =
3) (56 – 24) mod 17 = 8) (16)(25) mod 18 =
4) (29 – 18) mod 3 = 9) (-23)(35)mod 29 =
5) (67 – 93) mod 9 = 10) (-24)(-32)mod 13 =

B. Find the additive and multiplicative inverse of the following if any. If there is no additive
nor multiplicative inverse, explain why there is no such as inverses.
1) (x + 15) = 0 mod 29 x= 6) 5x = 1mod 9 x=
2) (23 + x) = 0 mod 27 x= 7) 14x = 1mod 41 x=
3) (x – 45) = 0 mod 89 x= 8) 6x = 1mod 41 x=
4) (46 – x) = 0 mod 16 x= 9) 7x = 1 mod 13 x=
5) (2x – 16) = 0 mod 18 x= 10) 11x = 1 mod 7 x=
Applications of Modular Arithmetic

Universal Product Code (UPC) and Credit Card


Another coding scheme that is closely related to the ISBN is the UPC (Universal Product Code). This
number is placed on many items and is particularly useful in grocery stores. A check-out clerk passes the
product by a scanner, which reads the number from a bar code and records the price on the cash register. If
the price of an item changes for a promotional sale, the price is updated in the computer, thereby relieving a
clerk of having to reprice each item. In addition to pricing items, the UPC gives the store manager accurate
information about inventory and the buying habits of the store’s customers.
The UPC is a 12-digit number that satisfies a modular equation. The last digit is the check digit. The
formula for the UPC check digit is:

d12 = 10 – (3d1 + d2 + 3d3 + d4 + 3d5 + d6 + 3d7 + d8 + 3d9 + d10 + 3d11)mod 10.

The staple wire has a bar code of 9-02870-766290. Is the UPC number of this product a valid number?
d12 = 10 – [3(9) + 0 + 3(2) + 8 + 3(7) + 0 + 3(7) + 6 + 3(6) + 2 + 3(9)]mod 10
d12 = 10 – (27 + 0 + 6 + 8 + 21 + 0 + 21 + 6 + 18 + 2 + 27)mod 10
d12 = 10 – 136mod 10
136 = (10)(13) + 6
d12 = 10 – 6 = 4
Since the computed check digit is not the last digit in a given code, then the bar code is not valid.

Luhn Algorithm
 uses mod 10 arithmetic
 Credit card is usually or normally have 13 to 16 digits long. The first one to six digits are used to identify
the card issuer.
 The table below shows some of the identification prefixes used by four popular card issuers.
Card Issuer Prefix Number of digits
Master Card 51 to 55 16
Visa 4 13 or 16
American Express 34 or 37 15
Discover 6011 16

1. Beginning with the next-to-last digit (the last digit is the check digit) and reading from right to left.
2. Double every other digit. If a digit becomes a two digit number after being doubled, treat the number
as two individual digits.
3. Find the sum of the new list of digits. The final sum must be congruent to 0 mod 10.

Example
Determine whether 5234-8213-3410-1298 is a valid card number.
Solution:
5 2 3 4 8 2 1 3 3 4 1 0 1 2 9 8
x2 x2 x2 x2 x2 x2 x2 x2
10 2 6 4 16 2 2 3 6 4 2 0 2 2 18 8
Then;
(1+0) + 2 + 6 + 4 + (1 + 6) + 2 + 2 + 3 + 6 + 4 + 2 + 0 + 2 + 2 + (1 + 8) + 8 = 60
Since 60 ≡ 0 mod 10, this is a valid card number.

Self- Learning Activity


Answer the following questions.
1. A certain product has a bar code 4-804888-9027-5. Is the product code valid? Explain.
2. Tell whether the given Universal Product Code 300450180186 is a valid number. Explain.
3. Find the check number of a certain product whose code number is 0-332334- 8272-x.
4. Is 6011-0123-9145-2317 a valid card number? Why?
5. How about a credit card whose number is 5155-0123-4356-0080? Is this a valid card number? Why?
6. Is the credit card number 4000001234567899 is a valid number? Explain.
Group Theory
Group
Consider the set of elements {0,1,2,3,4,5} and the operation is addition modulo 6.
+ 0 1 2 3 4 5
0 0 1 2 3 4 5
1 1 2 3 4 5 0
2 2 3 4 5 0 1
3 3 4 5 0 1 2
4 4 5 0 1 2 3
5 5 0 1 2 3 4

A group is a set of elements, with one operation and it must satisfy the following four properties:
P1: The set is close with respect to the operation. For all a, b ∈ G, then a * b ∈ G. Note that the operation
would be + or •or in general *.
P2: The operation satisfies the associative law. For all a, b, c ∈ G, then (a * b) *c = a * (b * c)
P3: There must be an identity element. For every e ∈ G, such that e * a = a *e = a for all a ∈G
P4: Each element has an inverse. For each a ∈ G then for every a-1 ∈ G, such that a * a-1 = a-1 * a = e.

The binary operator addition mod 5, denoted by * is defined on the set Z = {0,1,2,3,4}. Show that (Z, *) is a
group.
* 0 1 2 3 4
0 0 1 2 3 4
1 1 2 3 4 0
2 2 3 4 0 1
3 3 4 0 1 2
4 4 0 1 2 3

P1: (Z, +) is closed since all members of the Cayley Table are in Z.
P2: In number theory, (a + b) + c mod n = a + (b + c) mod n. Hence, it is associative
P3: The identity element is 0, e = 0.
P4: Each element has an inverse. 0-1 = 0; 1-1 = 4; 2-1 = 3;
3-1 = 2; 4-1 = 1
Since all the properties satisfied, hence it is a group.

Show that the integers with addition as the operation form a group.
Solution:
P1. Let a, b ∈ Z. Now, a + b ∈ Z and (–a) + (– b) ∈ Z. Hence it is closed under addition.
P2. Let a, b, and c are element of an integer. The associative property of addition holds true for the integers,
i.e. (a + b) + c = a + (b + c).
P3. Let Z = {…-3,-2,-1,0,1,2,3,…}. The identity element of Z is 0 and 0 is an integer. Hence, there is an identity
for addition.
P4. Let Z = {…-3,-2,-1,0,1,2,3,…}. Each element of Z has an inverse, i.e. if a ∈ Z, then –a is the inverse of a.
Because each of the four conditions of a group is satisfied, the integers with addition as the operation
form a group or (Z, +) is a group.

Abelian Group
 groups in which the operation satisfies the commutative property are called commutative group or
abelian group. If the group is a non-commutative property, it is called a non-abelian group.

Cayley Tables of Groups


Order of the group is just the number of element in a group and it is denoted by |G|.
* e
e e
Illustration above is what we called a group of order 1. This group is called as a trivial group.
* e a
e e a
a a e
This group is called a group of order 2.
Self- Learning Activity
1. Show that Z = {0,1,2,3,4,5,6} under addition forms a group.
2. Show that Z = {0,1,2,3,4,5,6} under multiplication forms a group.
3. Below is a partially completed Cayley table of a group. Complete the table in the unique possible way
(G,*) = {a,b,c,d,e} and find the inverse of the ff: a,b,c,d and e.
* a b c d e
a b c ? ? ?
b ? ? e a ?
c ? ? ? b ?
d e ? ? ? ?
e a b c d e

You might also like