Professional Documents
Culture Documents
Elective 5 Mathematical Systems PDF
Elective 5 Mathematical Systems PDF
MATHEMATICAL
SYSTEMS
Prepared by:
Joseph G. Taban
University of Northern Philippines
2
Contents
1. Modulo Arithmetic
2. Application
3. Cryptography
3
A. Modulo Arithmetic
• In mathematics, modular arithmetic (sometimes called
clock arithmetic) is a system of arithmetic for integers,
where numbers wrap around after they reach a certain
value – the modulus.
1. Modulo Arithmetic
The Swiss mathematician
Leonhard Euler pioneered the modern
approach to congruence in 1750, when he
explicitly introduced the idea of
congruence modulo a number N.
Activity
• Get a partner and solve the problem using the concept of
Modulo
Activity - 1. Working with Remainders.docx
6
2. Modulo Operations
• The notion of modular arithmetic is related to that of the
remainder in division. The operation of finding the
remainder is sometimes referred to as the modulo
operation.
• We define Zn as the set of integers from 0,1,2,…,n-1
modulo n, i.e.
Zn = {0, 1, 2, …, n-1}
7
Possible activities
1. Let the students construct the other modulo tables
2. Using the tables, allow students do the oral recitation
on performing operations for the following:
a. In Z4, find 2 + 2
b. In Z6, find 4 . 5
c. In Z8, find - 5
d. In Z5, find 4−1
e. In Z10, find 7 - 3
1
f. In Z9, find 2 +
4
3
g. In Z7, find -6
5
11
4. Modulo Congruence
Congruence Modulo m
Definition.
If m is a positive integer and m 𝒂 − 𝒃, then we
say that a is congruent to b modulo m and in symbol,
a ≡ b (mod m). If a is not congruent to b modulo m, we
write a ≠ b(mod m).
12
Least Residue
We call the remainder r as the least residue of a. The word
“residue” is merely a technical term which has the same sense as
remainder.
(“residue” = what left over = “remainder”)
The set of integers S = {0, 1, 2, …, m-1} is called the least
residue system modulo m. If a ∈ ℤ and a ≡ r (mod m), then r is one
of the integers in the set S.
For instance, the least residue of 38 in modulo 3, 4, and 5
are 2, 2, and 3, respectively. We write this as follows:
38 ≡ 2 (mod 3)
38 ≡ 2 (mod 4)
38 ≡ 3 (mod 5)
14
3(0) + 5 ≠ 3 mod 4
3(1) + 5 ≠ 3 mod 4
3(2) + 5 = 3 mod 4 2 is a solution.
3(3) + 5 ≠ 3 mod 4
3(4) + 5 ≠ 3 mod 4
3(5) + 5 ≠ 3 mod 4
3(6) + 5 = 3 mod 4 6 is a solution.
If we continued trying values, we would find that 10 and 14 are
also solutions. Note that the solutions 6, 10, and 14 are all congruent to
2 modulo 4. In general, once a solution is determined, additional
solutions can be found by repeatedly adding the modulus to the original
solution.
Thus the solutions of 3x + 5 = 3 mod 4 are 2, 6, 10, 14, 18, ... .
19
Exercise
Find all whole number solutions of the
congruence equation.
1. x = 10 mod 3 6. 3x + 1 = 4 mod 9
2. x = 12 mod 5 7. 2x + 3 = 8 mod 12
3. 2x = 12 mod 5 8. 3x + 12 = 7 mod 10
4. 3x = 8 mod 11 9. 2x + 2 = 6 mod 4
Challenge! 50
Application
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. If we label the first digit of
an ISBN d1, the second digit d2, and so on to the 13th digit d13, then the
check digit is chosen to satisfy the following congruence.
23
TAKE NOTE: The 5th through 12th digits (eight digits total) of an
ISBN are for the name of the publisher and the name of the
book. If the publisher has a three digit number, then there are 8 -
3 = 5 digits for the name of the book. If the publisher has a six-
digit code, there are two digits for the name of the book.
24
Example:
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.
d13 = 10 - [9 + 3(7) + 8 + 3(0) + 3 + 3(9) + 5 + 3(2) + 8 + 3(5) + 1 + 3(7)]
mod10
= 10 - 124 mod 10
= 10 - 4 mod 10
= 6mod 10
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.
25
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.
27
Example
Find the check digit for the DVD release of the film Alice
in Wonderland. The first 11 digits are 7-86936-79798-__
Solution
d12 = 10 – [3(7) + 8 + 3(6) + 9 + 3(3) + 6 + 3(7) + 9 + 3(7) + 9 + 3(8)] mod 10
= 10 – 155 mod 10
= 10 – 5 mod 10
= 5 mod 10
UPC: 7-86936-79798-5
29
Exercise:
1. Is 1 – 32342 – 65933 – 9 a valid UPC?
2. Is 8 – 85909 – 19432 – 4 a valid UPC?
3. Is 0 – 36000 – 29145 – 2 a valid UPC?
4. The following are UPCs of Philippine products. Identify
the missing check digits.
a. Argentina beef loaf 170g: 7 – 48485 – 80009 - 𝒙𝟏𝟐
b. Nissin bowl Noodles Hot and Spicy Chicken Flavor
3.32oz: 0 – 70662 – 09631 - 𝒙𝟏𝟐
30
The table below shows 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 34 or 37 15
Express
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. Now find the sum of the new list of digits; the final sum must
equal 0 mod 10.
32
Solution
Highlight every other digit, beginning with the next-to-last digit and reading from
right to left.
5234821334101298
10 2 6 4 18 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+8) +2 + 2 + 3 + 6 + 4 + 2 + 0 + 2 + 2 + (1+ 8) + 8 = 60
USPS
Modular arithmetic is often used in coding
information. The United States Postal Service (USPS) uses
modular arithmetic to detect errors or forgeries of money
orders.
The serial number of a USPS money order is 11
digits long. The first 10 digits of the serial number
(8810024532) are followed by a security check digit (7). If
the money order is genuine, then the 10-digit number
modulo 9 will be equal to the check digit.
35
PROBLEM:
Money order A has a serial number of 51177875501. Money
order B has a serial number of 88100245327. Using modular
arithmetic, determine if the money orders are genuine.
Solution:
For Money order A, the serial number is genuine if the first 10 digits of the
number is 10-digit code(mod 9) = 1. Notice that 5117787550 =
568643061(9) + 1. Therefore, 5117787550(mod 9) = 1. Thus, the serial
number corresponds with a genuine money order.
For Money order B, notice that 8810024532 = 978891614(9) + 6.
Therefore, 8810024532(mod 9) ≠ 7. Thus, the serial number does not
correspond with a genuine money order.
36
Cryptography
Cryptology
• Cryptology is the discipline devoted to
secrecy systems.
• Cryptography is a branch of cryptology that
deals with the design and implementation of
secrecy systems
• Cryptanalysis involves breaking these
secrecy systems.
• Plaintext is a message that is to be altered
into a secret form.
• Cipher refers to the method for altering a
plaintext message into a cipher text.
Changing the letter of the plaintext uses a
transformation.
• Key determines a particular transformation
from a set of possible transformations.
• Encryption or enciphering is the process of
changing plaintext into cipher text.
• Decryption or deciphering is the reverse
process of changing the cipher text back to the
plaintext.
SECRECY SYSTEMS
encryption
A. SHIFT
TRANSFORMATIONS
aP ≅ C – b (mod 26)
P ≅ 𝑎 (C – b)(mod 26)
<deciphering>
where 𝑎 is the modulo inverse of a.
In number theory,
a . b ≡ 1 (mod n).
Example: In modulo 7, 2 is the inverse of 4
and vice versa since 2 . 4 ≅ 1 (mod 7)
Below is a list of the multiplicative inverse of
the 12 elements a of Z26 for which gcd(a,
26)=1.
a 1 3 5 7 9 11 15 17 19 21 23 25
𝑎 1 9 21 15 3 19 7 23 11 5 17 25
From the example: C ≡ 3P + 1 (mod 26),
find the formula for P.
Example:
More…
52
Exercise:
• Using the Pigpen cipher, encrypt the
following:
a. Your “Name”
b. Your “ favorite food”
c. The statement “ I love mathematics”.
Essential Mathematics (For the
Modern World) by Nokon &
Nokon 2016