0% found this document useful (0 votes)
60 views60 pages

Module 6 Mathematical Analysis Days of The Week Isbn Upc Credit Card Codes

This document discusses modular arithmetic and its applications. The objectives are to discuss modular arithmetic and cryptography, apply concepts of modular arithmetic to real-world problems like clocks, calendars, and product codes, and use coding schemes for identification, privacy and security. It covers topics like arithmetic operations modulo n, solving congruence equations, and computing days of the week. Applications discussed include ISBNs, UPC codes, and validating credit card numbers.

Uploaded by

Joaquin Dump
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views60 pages

Module 6 Mathematical Analysis Days of The Week Isbn Upc Credit Card Codes

This document discusses modular arithmetic and its applications. The objectives are to discuss modular arithmetic and cryptography, apply concepts of modular arithmetic to real-world problems like clocks, calendars, and product codes, and use coding schemes for identification, privacy and security. It covers topics like arithmetic operations modulo n, solving congruence equations, and computing days of the week. Applications discussed include ISBNs, UPC codes, and validating credit card numbers.

Uploaded by

Joaquin Dump
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 60

COURSE OBJECTIVES

∙ Discuss modular arithmetic and


Cryptography.

∙ Apply concepts on modular arithmetic such


ISBN (International standard book number),
UPC (Universal Product Code), and credit
card numbers.

∙ Use modular arithmetic to solve real life


problems such as clock and calendar.

∙ Use coding schemes to encode and


decode different types of information for
identification, privacy, and security
purposes.
Modular Arithmetic
• Introduction to Modular Arithmetic

• Arithmetic Operations Modulo n

• Solving Congruence Equations

• Additive and Multiplicative Inverses in


Modular Arithmetic

• EXCURSION: Computing the Day of the Week


INTRODUCTION TO MODULAR ARITHMETIC
Many clocks have the familiar 12-
hour design. We designate
whether the time is before noon
or after noon by using the
abbreviations a.m. and p.m.
A reference to 7:00 a.m. means 7
hours after 12:00 midnight; a
reference to 7:00 p.m. means 7
hours after 12:00 noon. In both
cases, once 12 is reached on the
clock, we begin again with 1.
We will use the symbol ⊕ to denote
addition on a 12-hour clock. Using
this notation,

If we use the symbol Θ to denote


subtraction on a 12-hour clock, we
can write
ACTIVITY
Perform Clock Arithmetic
Evaluate each of the following, where ⊕ and Θ
indicate addition and subtraction, respectively,
on a 12-hour clock.
ACTIVITY Perform Clock Arithmetic
Evaluate each of the following, where ⊕ and Θ
indicate addition and subtraction, respectively,
on a 7-day a week.
Mon = 1, Tue = 2, Wed= 3, Thu = 4, Fri = 5, Sat = 6, Sun = 7

1. 5 ⊕ 7 ANSWER: 5
2. 6 ⊕ 3 ANSWER: 2
3. 7 Θ 2 ANSWER: 5
4. 3 Θ 7 ANSWER: 3
Situations such as these that repeat in cycles are
represented mathematically by using modular
arithmetic, or arithmetic modulo n.
TRUE

FALSE
A Day of the Week
July 4, 2010, was a Sunday. What day of the week is
July 4, 2015?
ACTIVITY
I. Determine whether the congruence is true or false.

II. Determine the day of the week.


1. November 1, 2016 is Tuesday, what day of the
week is November 1, 2020.

2. September 15, 2016 is Thursday, what day of


the week is September 15, 2030?
Arithmetic Operations Modulo n
Arithmetic modulo n, where n is a natural number,
uses a variation of the standard rules of arithmetic
we have used before. Perform the arithmetic
operation and then divide by the modulus. The
answer is the remainder. Thus the result of an
arithmetic operation mod n is always a whole
number less than n.
Addition Modulo n

Add 23 and 38 to produce 61. Then


divide by the modulus, 12. The answer is
the remainder 1.
In modular arithmetic, adding the modulus to a
number does not change the value of the number.
For instance,

Subtraction Modulo n
Evaluate each of the following
Answer: 5
Answer: 2
Disregarding a.m. or p.m., if it is 5 o’clock now, what
time was it 57 hours ago?
Therefore, if it is 5 o’clock now, 57 hours
ago it was 8 o’clock.
Check on this!
If today is Tuesday, what day of the week will it be 93
days from now?
Answer:

Multiplication Modulo n
Check on this!
Answer: 10

ACTIVITY I. Perform the modular arithmetic.


II. Clocks and Calendars, use modular arithmetic to
determine each of the following.

1. Disregarding a.m. or p.m., if it is now 7 o’clock,


a. what time will it be 59 hours from now?
b. what time was it 62 hours ago?

2. Disregarding a.m. or p.m., if it is now 2 o’clock,


a. what time will it be 40 hours from now?
b. what time was it 34 hours ago?
Solving Congruence Equations
Solving a congruence equation means finding all
whole number values of the variable for which the
congruence is true.

2 is a solution

6 is a solution
The solutions are 1, 6, 11, 16, 21,26, ...
Check on this!
Answer: NO SOLUTION

ACTIVITY.
Find all whole number solutions of the congruence
equation.
Additive and Multiplicative Inverses in
Modular Arithmetic
Example of additive inverses

Find the additive inverse


Find the additive inverse of 7 in mod 16 arithmetic.
Multiplicative inverses
If the product of two numbers is 1, then the numbers
are multiplicative inverses of each other.

Find a Multiplicative Inverse


In mod 7 arithmetic, find the multiplicative
inverse of 2.
In mod 7 arithmetic, the multiplicative inverse of 2 is 4.
Check on this! Find the multiplicative inverse of 5 in
mod 11 arithmetic.

ACTIVITY.
Find the additive inverse and the multiplicative
inverse, if it exists, of the given number.

1. 4 in modulo 9 arithmetic
2. 7 in modulo 5 arithmetic
3. 3 in modulo 8 arithmetic
Computing the Day of the Week
Using the floor function, we can write a formula that
gives the day of the week for any date on the Gregorian
calendar. The formula, known as Zeller’s congruence, is
given by

Where:
d is the day of the month
m is the month using 1 for March, 2 for April, ... , 10 for
December; January and February are assigned the
values 11 and 12, respectively
y is the last two digits of the year if the month is March
through December; if the month is January or
February, y is the last two digits of the year minus 1
c is the first two digits of the year
x is the day of the week (using 0 for Sunday, 1 for
Monday, ... , 6 for Saturday)
Determine the day of the week on
July 4, 1776,

Therefore, July 4, 1776, was a Thursday.


ACTIVITY: EXCURSION
1. Determine the day of the week on which you
were born.

2. Determine the day of the week on which


Abraham Lincoln’s birthday (February 12) will fall in
2155.

3. Determine the day of the week on which January


1, 2020, will fall.

4. Determine the day of the week on which


Valentine’s Day (February 14) 1950 fell
Applications of Modular Arithmetic
ISBN
Every book that is cataloged 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, the next digit
indicates the country in which the publisher is
incorporated (0, and sometimes 1, for books written in
English), the next two to seven digits indicate the
publisher, the next group of digits indicates the title of
the book, and the last digit (the 13th one) is called a
check digit.
It is this check digit that is used to ensure accuracy.
For instance, the ISBN for the fourth edition of the
American Heritage Dictionary is 978-0-395-82517-4.
Suppose, however, that a bookstore clerk sends an
order for the American Heritage Dictionary and
inadvertently enters the number 978-0-395-28517-4,
where the clerk transposed the 8 and 2 in the five
numbers that identify the book.
Correct ISBN: 978-0-395-82517-4
Incorrect ISBN: 978-0-395-28517-4
The receiving clerk calculates the check digit as
follows.
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.

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-?
The check digit is 3.

Check on this!
A purchase order for the book The Mathematical
Tourist by Ivars Peterson includes the ISBN 978-0-
760-73261-6. Determine whether this is a valid ISBN.

Because the check digit does not match,


the ISBN is invalid.
ACTIVITY.
I. Determine whether the given number is a valid
ISBN.

II. Determine the correct check digit for each ISBN.


UPC
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.
Determine the Check Digit of a UPC
Find the check digit for the DVD release of the film
Alice in Wonderland. The first 11 digits are
7-86936-79798-?

The check digit is 5.


Is 1-32342-65933-9 a valid UPC?

The ISBN and UPC coding systems will normally catch


transposition errors. There are instances, however,
when they do not.
The UPC for Crisco Puritan Canola Oil
with Omega-DHA is 0-51500-24275-9
Suppose, however, that the product code is written 0-
51500-24725-9, where the 2 and 7 have been
transposed. Calculating the check digit, we have
The same check digit is calculated, yet the UPC has
been entered incorrectly. This was an unfortunate
coincidence; if any other two digits were transposed,
the result would have given a different check digit
and the error would have been caught.

ACTIVITY.
Determine the correct check digit for the UPC.
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 four digits are used to identify
the card issuer. The table below shows the
identification prefixes used by four popular card
issuers.
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.
Determine a Valid Credit Card Number
Determine whether 5234 8213 3410 1298 is a valid
credit card number.

Highlight every other digit, beginning with the next-


to-last digit and reading from right to left.
5 2 3 4 8 2 1 3 3 4 1 0 1 2 9 8
Next double each of the highlighted digits.
10 2 6 4 16 2 2 3 6 4 2 0 2 2 18 8
Finally, add all digits, treating two-digit numbers as
two single digits.
1+ 0 + 2 + 6 + 4 + 1 + 6 + 2 + 2 + 3 + 6 + 4 + 2
+ 0 + 2 + 2 + 1 + 8 + 8 = 60

Check on this! Is 6011 0123 9145 2317 a valid


credit card number?

Answer:
ACTIVITY.
Determine whether the given credit card number is
a valid number.
Cryptology
Related to codes on books and grocery items are
secret codes. These codes are used to send
messages between people, companies, or nations.

It is hoped that by devising a code that is difficult to


break, the sender can prevent the communication
from being read if it is intercepted by an
unauthorized person.

Cryptology is the study of making and breaking


secret codes.
Who is the father of cryptology?

Leon Battista Alberti


The polyalphabetic cipher was most clearly
explained by Leon Battista Alberti around AD 1467,
for which he was called the "father of Western cryptology".
Plaintext is a message before it is coded. The line

SHE WALKS IN BEAUTY LIKE THE NIGHT

from Lord Byron’s poem “She Walks in Beauty Like


the Night ” is in plaintext. Ciphertext is the message
after it has been written in code. The line

ODA SWHGO EJ XAWQPU HEGA PDA JECDP

is the same line of the poem in ciphertext.

The method of changing from plaintext to ciphertext


is called encryption.
The line from the poem was encrypted by
substituting each letter in plaintext with the letter
that is 22 letters after that letter in the alphabet.

This is called a cyclical coding scheme because each


letter of the alphabet is shifted the same number of
positions. The original alphabet and the substitute
alphabet are shown below.
Using the cyclical coding scheme shifted 22 positions
to the right. What is the plaintext word that
corresponds to the ciphertext?

1. YKZA Answer: CODE


2. XAWQPU Answer: BEAUTY
3. IWPD Answer: MATH
4. AIHYKIA Answer: WELCOME
To decrypt a message means to take the ciphertext
message and write it in plaintext.

Decrypt the following ciphertext message


using the illustration below.

1. CNAAJ Answer: GREEN


2. YDIOY Answer: CHMSC
3. ATYAHO Answer: EXCELS
Numerical Equivalents for the Letters of the Alphabet

where p is the numerical equivalent of the plaintext


letter and c is the numerical equivalent of the
ciphertext letter.
Each letter in Lord Byron’s poem was shifted 22
positions (m = 22) to the right.

Solution:
ACTIVITY:

1. DONT 2. HATE 3. MATH


A Cipher of Caesar

Write Messages Using Cyclical Coding


Use the cyclical alphabetic encrypting code that shifts
each letter 11 positions to
a. code CATHERINE b. decode TGLY
Solution
Solution:
ACTIVITY:
I. ENCRYPTION: Encode the message by using a
cyclical alphabetic encrypting code that shifts the
message the stated number of positions.

II. DECODING: Use the cyclical alphabetic encrypting


code that shifts each letter 17 positions to

You might also like