You are on page 1of 39

Did you know that you use modular arithmetic daily?

Jenn, Founder Calcworkshop ®, 15+ Years Experience (Licensed & Certified Teacher)

It’s true!

The Clock
Every time you think about “time,” you use modular arithmetic because it deals with cycles of
integers and remainders just like a clock.
For example, suppose your clock reads 9:00 (am/pm is not important).

What will the clock show in 10 hours?

Well, 9 + 10 = 19, but “19 o’clock” is not something that can be displayed on a clock with the
numbers 1 to 12.

So, what do we do?

We subtract 12 from 19 and proudly say that the clock will show 7:00.

This is the idea behind modular arithmetic, which is sometimes referred to as “clock arithmetic”
because 19 mod 12 = 7 mod 12, where 7 represents the remainder when 19 is divided by 12. You
can review more history behind the idea at the Institute for Advanced Studies .

How To Do Modular Arithmetic


This means that modular arithmetic finds the remainder of a number upon division!

Example #1
What is 16 mod 12?

Well 16 divided by 12 equals 1 remainder 4. So the answer is 4!


Example #2
What about 15 mod 2?

Here, 15 divided by 2 equals 7 remainder 1, so the solution is 1!

Example #3
And if you have 18 mod 9?

Alright, so we know that 18 divided by 9 equals 2 remainder 0, so that means 18 mod 9 is equivalent
to 0!

So, what have we learned?

The trick for modular arithmetic is to focus on the remainder!


But just like we say with divisibility, the remainder must be positive.

Example #4
For this problem, suppose we wanted to evaluate -97 mod 11.

Well, -97 divided by 11 equals -8 remainder -9.


But since this remainder is negative, we have to increase our quotient by 1 to say -97 divided by 11
equals -9 remainder 2, as 11(-9) + 2 = -97!

Therefore, -97 mod 11 equals 2!

Modular Congruence
Now, in number theory, we often want to focus on whether two integers say a and b, have the same
remainder when divided by m. This is the idea behind modular congruence.

Congruence is nothing more than a statement about divisibility and was first introduced by Carl
Friederich Gauss.

He surmised that if a and b are integers, and m is a positive integer, then a is congruent
to b modulo m if and only if m divides a minus b.
In other words, a congruence modulo asks whether or not a and b are in the same equivalence
class.
Congruence Modulo Property

Equivalence Class
What’s an equivalence class?
It’s best explained with an example.

Suppose we want to find the equivalence classes of mod 3. Well, we know that “mod” means we are
interested in remainders, so what are the possible remainders when a number is divided by 3?

It’s 0, 1, or 2!

Here’s how.

Okay, so the remainders of 0, 1, or 2 comprise the equivalence classes for mod 3, which we write as
[0], [1], and [2].

But let’s look a bit deeper and find all the values within each class (partition).

Here’s a trick, start by listing the equivalence classes as separate columns and then start at zero and
keep writing numbers consecutively, wrapping to the next row, as shown below.
Equivalence Class Mod 3

This means that [0] = {…-6,-3,0,3,6,9,…} and [1] = {…-5,-2,1,4,7,10,…} and [2] = {…-5,-1,2,5,8,11,…}

Why?
Because every integer within the equivalence class has the same remainder when divided by 3!

Notice the following:

 6/3 = 2 with remainder 0.


 7/3 = 2 remainder 1.
 8/3 = 2 remainder 2.

Congruence Modulo — Examples


So, now let’s see how equivalence classes help us determine congruence.

If n is a positive integer then integers a and b are congruent modulo n if they have the same
remainder when divided by n. Another way to think of congruence modulo, is to say that integers a
and b congruent modulo n if their difference is a multiple of n.

For example, 7 and 4 are congruent modulo 3 because not only are they in the same equivalence
class, but their difference 7-4 = 3, is a multiple of 3 (i.e., 3 divides 3), as shown below.

Problem #1
Determine Congruence — Example

But 11 and 6 are not congruent modulo 3 because they are not in the same equivalence class and
their difference, 11-6 = 5, is not a multiple of 3, as illustrated below.
Problem #2

Verify Incongruence — Example

So, what have we learned? If the remainders are equal to each other, then they are congruent! And
the following theorem highlights this very idea:
Congruence Property

And this leads us to several vital theorems for congruence modulo.


Modular Arithmetic Properties

In our lesson, we will work through several proofs for these essential theorems, as they are pivotal
in our understanding of equivalence relations (future lesson) and allow us to define arithmetic
operations.
For example, let’s find:

1. (7+9)(mod 11)
2. (7)(9)(mod 5)

Modular Arithmetic Multiplication Addition


Arithmetic Modulo
And this leads us to Arithmetic Modulo m, where we can define arithmetic operations on the set of
non-negative integers less than m, that is, the set {0,1,2,…,m-1}.
Arithmetic Modulo M Properties

The definition of addition and multiplication modulo follows the same properties of ordinary
addition and multiplication of algebra.

The following properties are all satisfied.

 Closure
 Commutativity
 Associativity
 Identity
 Inverse
 Distributivity

Together we will work through countless examples of modular arithmetic and the importance of the
remainder and congruence modulus and arithmetic operations to ensure mastery and
understanding of this fascinating topic.

Let’s get to it.

Video Tutorial w/ Full Lesson & Detailed Examples


1 hr 19 min

 Introduction to Video
 Practical overview of clock arithmetic
00:00:28
 Exclusive Content for Members Only

 00:10:16 Definition of congruence modulo and equivalence classes


 00:23:14 Congruence Modulo Properties
 00:27:15 Determine congruence (Examples #1-4)
 00:39:10 Prove modular congruence theorem (Example #5)
 00:47:09 Verify the addition and multiplication congruence identities (Examples #6-7)
 00:56:49 Evaluate using modular congruence properties (Examples #8-11)
 01:06:42 Arithmetic Modulo m notation (Examples #12-13)
 01:10:51 Evaluate using modular arithmetic (Examples #14-17)
 Practice Problems with Step-by-Step Solutions
 Chapter Tests with Video Solutions
xercise 2.3

1. Find the least positive value of x such that


(i) 71 ≡ x (mod 8)
(ii) 78 + x ≡ 3 (mod 5)
(iii) 89 ≡ (x + 3) (mod 4)
(iv) 96 ≡ x/7(mod 5)
(v) 5x ≡ 4(mod 6)
2. If x is congruent to 13 modulo 17 then 7x - 3 is congruent to which number modulo 17?

3. Solve 5x ≡ 4 (mod 6)
4. Solve 3x − 2 ≡ 0 (mod 11)
5. What is the time 100 hours after 7 a.m.?
6. What is the time 15 hours before 11 p.m.?

7. Today is Tuesday. My uncle will come after 45 days. In which day my uncle will be coming?
8. Prove that 2n + 6 × 9n is always divisible by 7 for any positive integer n.
9. Find the remainder when 281 is divided by 17.
10. The duration of flight travel from Chennai to London through British Airlines is approximately 11 hours. The
airplane begins its journey on Sunday at 23:30 hours. If the time at Chennai is four and half hours ahead to that of
London’s time, then find the time at London, when will the flight lands at London Airport.
Answers:
1.(i) 7 (ii) 5 (iii) 2 (iv) 7 (v) 2
2. 3
3. 2,8,14,…
4. 8, 19, 30, …
5. 11 a.m
6. 8 p.m
7. Friday
9. 2
10. 6 am, Monday

LESSON 1 - ISBN UPC


Every book that is catalogued in the Library of Congress must have an ISBN (International
Standard Book Number). This 13-digit number was created to help ensure that orders for books
are filled accurately and that books are catalogued correctly.
The first three digits of an ISBN are 978 (or 979), followed by 9 digits that are divided into
three groups of various lengths. These indicate the country or region, the publisher, and the title of
the book. The last digit (the 13
th
one) is called a check digit.
If we label the first digit of an ISBN d
1
, the second digit d
2
, and so on to the 13
th
digit d
13
,
then the check digit is given by the following modular formula.
It is this check digit that is used to ensure accuracy. For instance, ISBN for the fourth
edition of the America Heritage Directory is 978-0-395-82517-4. However, suppose that the
bookstore clerk sends and order for the American Heritage Dictionary and inadvertently enters
the number

Correct ISBN: 978-0395-82517-4


Incorrect ISBN: 978-0395-28517-4

The receiving clerk calculates the check digit as follows: (from the Incorrect ISBN)

d
13
= 10 – (d
1
+ 3d
2
+d
3
+ 3d
4
+d
5
+ 3d
6
+d
7
+ 3d
8
+d
9
+ 3d
10
+d
11
+3d
12
) mod 10
= 10 – [9 + 3(7) + 8 + 3(0) + 3 + 3(9) + 5 + 3(2) + 8 + 3(5) + 1 +3(7)] mod 10
= 10 – 124 mod 10
= 10 – 4
=6

Because the check digit is 6 and not 4 as it should be, the receiving clerk knows that an
incorrect ISBN has been sent. Transposition errors are among the most frequent errors that occur.
The ISBN coding system will catch most of them.

Example 1. Determine a Check Digit for an ISBN


Determine the ISBN check digit for the book The Equation that Couldn’t Be Solved by Mario
Livio. The first 12 digits of the ISBN are 978-0-7432-5820-?

Solution
d
13
= 10 – (d
1
+ 3d
2
+d
3
+ 3d
4
+d
5
+ 3d
6
+d
7
+ 3d
8
+d
9
+ 3d
10
+d
11
+3d
12
) mod 10
= 10 – [9 + 3(7) + 8 + 3(0) + 7 + 3(4) + 3 + 3(2) + 5 + 3(8) + 2 +3(0)] mod 10
= 10 – 97 mod 10
= 10 – 7
=3
Thus, the check digit is 3.

Check your progress. A purchase order for the book The Mathematical Tourist by Ivars
Peterson includes the ISBN 978-0-716-73250-5. Determine whether this is a valid ISBN or not.
(valid ISBN means that the value of d
13
and the check digit are the same).
Your answer should be: not valid because the given check digit is 5 which is not equal to d
13

which is 1.

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
Formula for the ISBN Check Digit
d
13
= 10 – (d
1
+ 3d
2
+d
3
+ 3d
4
+d
5
+ 3d
6
+d
7
+ 3d
8
+d
9
+ 3d
10
+d
11
+3d
12
) mod 10
Note: If d
13
= 10, then the check digit is 0.
CHECK DIGIT

Sign up to view the full document!


lock_open S I G N U P
Showing Page:
2/5
APPLICATIONS OF MODULAR ARITHMETIC

2
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 that is similar to the one
for ISBNs. The last digit is the check digit. If we label the 12 digits of the UPC as d
1
,d
2
,d
3
,…,
d
12
, we can write a formula for the UPC check digit d
12
.

Example 2. Determine the Check Digit of a UPC


Find the check digit for the UPC of the Blu-ray Disc release of the film Jurassic World given the
first 11 digits are 0-25192-21221-?.

Solution
d
12
= 10 – (3d
1
+d
2
+ 3d
3
+d
4
+ 3d
5
+d
6
+ 3d
7
+d
8
+ 3d
9
+d
10
+ 3d
11
) mod 10
= 10 – [3(0) + 2 + 3(5) + 1 + 3(9) + 2 + 3(2) + 1 + 3(2) + 2 + 3(1)] mod 10
= 10 – 65 mod 10
= 10 – 5
=5
Thus, the check digit is 5.

Check your progress. Is 1-32342-65933-9 a valid UPC or not?


(valid UPC means that the value of d
12
and the check digit are the same).
Your answer should be: valid because the given check digit is 9 which is equal to d
12
which
is 9.

Lesson 2 – CREDIT CARD NUMBERS

Companies that issue credit cards also use modular arithmetic to determine whether a
credit card number is valid. This is especially important in e-commerce, where credit card
information is frequently sent over the Internet. The primary coding method is based on the Luhn
algorithm, which uses mod 10 arithmetic.

Credit card numbers are normally 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
MasterCard
51 or 55
16
Visa
4
13 or 16
American Express
34 or 37
15
Discover
6011
16

The Luhn algorithm, used to determine whether a credit card number is valid, is
calculated as follows: Beginning with the next-to-last digit (the last digit is the check digit) and
reading from right to left, double every other digit. If a digit becomes a two digit number, after
being doubled, treat the number as two individual digits, find the sum. Now, the sum of the new
list of digits must be congruent to 0 mod 10. The Luhn algorithm is demonstrated in the next
example.
Formula for the UPC Check Digit
d
12
= 10 – (3d
1
+d
2
+ 3d
3
+d
4
+ 3d
5
+d
6
+ 3d
7
+d
8
+ 3d
9
+d
10
+ 3d
11
) mod 10
Note: If d
12
= 10, then the check digit is 0.
Sign up to view the full document!
lock_open S I G N U P
Showing Page:
3/5

You might also like