2. MATHEMATICAL SYSTEM
Modular Arithmetic
Definition. Let 𝑎, 𝑏 ∈ ℤ. Then 𝑎 and 𝑏 are said to be
congruent modulo 𝑚, denoted by 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑚, if and
only if 𝑚|𝑎 − 𝑏 . The number 𝑚 > 0 is called the
modulus. 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑚 is called a linear congruence.
A congruence in the form 𝑎𝑥 ≡ 𝑏 𝑚𝑜𝑑 𝑚 is called a
linear congruence in the variable 𝑥.
5. MATHEMATICAL SYSTEM
Definition. Let 𝑎, 𝑏 ∈ ℕ. Then 𝑏 is the additive inverse
of 𝑎 mod m if and only if 𝑎 + 𝑏 ≡ 0 𝑚𝑜𝑑 𝑚. On the
other hand, 𝑏 is the multiplicative inverse of 𝑎 mod m
if and only if 𝑎𝑏 ≡ 1 𝑚𝑜𝑑 𝑚.
Exercise.
1) Find the additive inverse of 7 in mod 16 arithmetic.
2) Find the multiplicative inverse of 8 in mod 11
arithmetic.
6. MATHEMATICAL SYSTEM
Applications of Modular Arithmetic
1) Clock Arithmetic
2) Determining the Day of the Week
3) ISBN and UPC
4) Validity of Credit Card numbers
5) Cryptology
8. MATHEMATICAL SYSTEM
Day of the Week
Zeller’s Congruence
𝑥 ≡
13𝑚 − 1
5
+
𝑦
4
+
𝑐
4
+ 𝑑 + 𝑦 − 2𝑐 𝑚𝑜𝑑 7
Where 𝑑 is the day of the month, 𝑚 is the month using
1 for March, 2 for April, …, 10 for December, 11 for
January, and 12 for February, 𝑦 is the last two digits of
the year if the month is March through December
9. MATHEMATICAL SYSTEM
while 𝑦 is the last two digits of the year minus 1 if the
month is January or February, 𝑐 is the first two digits
of the year, 𝑥 is the day of the week (using 0 for
Sunday, 1 for Monday, …, 6 for Saturday).
Example: Use the Zeller’s congruence to prove that Sir
Tiongson was born on Wednesday.
Note: His Birth Date: April 30, 1997
11. MATHEMATICAL SYSTEM
Exercise. Determine the day of the week on which you
were born by applying the Zeller’s congruence.
ISBN
ISBN- International Standard Book Number
Every book that is catalogued in the Library of Congress
must have an ISBN.
This 13-digit number was created to help ensure that orders
for books are filled accurately and that books are
catalogued correctly.
12. MATHEMATICAL SYSTEM
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 (13th one) is called a
check digit.
If we label the first digit of an ISBN 𝑑1, the second
digit 𝑑2, and so on until 𝑑13, then we have the formula
13. MATHEMATICAL SYSTEM
Formula for the ISBN Check Digit
𝑑13
= 10
− (
)
𝑑1 + 3𝑑2 + 𝑑3 + 3𝑑4 + 𝑑5 + 3𝑑6 + 𝑑7 + 3𝑑8
+ 𝑑9 + 3𝑑10 + 𝑑11 + 3𝑑12 𝑚𝑜𝑑 10
Exercise
Determine the ISBN check digit for the book “The
Equation that Couldn’t Be Solved” by Mario Livio.
The first 12 digits are 978-0-7432-5820-?
14. MATHEMATICAL SYSTEM
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.
In addition to pricing items, the UPC gives the store
manager accurate information about inventory.
15. MATHEMATICAL SYSTEM
Formula for the UPC Check Digit
𝑑12
= 10
− (
)
3𝑑1 + 𝑑2 + 3𝑑3 + 𝑑4 + 3𝑑5 + 𝑑6 + 3𝑑7 + 𝑑8
+ 3𝑑9 + 𝑑10 + 3𝑑11 𝑚𝑜𝑑 10
Exercise. Find the check digit for the UPC of the Blu-
ray Disc release of the film Jurassic World. The first 11
digits are 0-25192-21221-?
16. MATHEMATICAL SYSTEM
Credit Card Numbers
Luhn Algorithm- 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 be congruent to 0 mod
10.
17. MATHEMATICAL SYSTEM
Exercise. Determine whether 5234 8213 3410 1298 is
a valid credit card number.
Is 6011 0123 9145 2317 a valid credit card number?
Justify your answer.
Cryptology
It is the study of making and breaking secret codes.
Plaintext- is a message before it is coded.
18. MATHEMATICAL SYSTEM
Ciphertext- is the message after it has been written in
code.
Encryption- is the method of changing from plaintext
to ciphertext.
Cyclical coding scheme- each letter of the alphabet is
shifted the same number of positions.
Decryption- is the method of changing from ciphertext
to plaintext.
19. MATHEMATICAL SYSTEM
Formula (Encryption)
𝑐 ≡ 𝑝 + 𝑚 𝑚𝑜𝑑 26
Where 𝑝 is the numerical equivalent of the plaintext
letter, 𝑐 is the numerical equivalent of the ciphertext
letter, and 𝑚 is the number of positions the letter is
shifted.
Formula (Decryption)
𝑝 ≡ 𝑐 + 26 − 𝑚 𝑚𝑜𝑑 26
20. MATHEMATICAL SYSTEM
Exercise. Using the formula 𝑐 ≡ 𝑝 + 22 𝑚𝑜𝑑 26,
encode the line from Lord Byron’s poem “She Walks
in Beauty”
SHE WALKS IN BEAUTY LIKE THE NIGHT
Answer:
ODA SWHGO EJ XAWQPU HEGA PDA JECDP
21. MATHEMATICAL SYSTEM
Introduction to Group Theory
Algebraic System- is a nonempty set together with one
or more well-defined operations.
Examples:
The set of real numbers under addition and
multiplication is an algebraic system.
The set of 𝑚𝑥𝑛 matrices under matrix addition is an
algebraic system
22. MATHEMATICAL SYSTEM
Group- is a set of elements with a well-defined
operation satisfying the following four properties:
1) The set is closed with respect to the operation.
2) The operation satisfies the associative property.
3) There is an identity element.
4) Each element has an inverse.
23. MATHEMATICAL SYSTEM
Examples:
1) The set of integers under addition is a group.
2) The set of nonzero real numbers under
multiplication forms a group.
Remark: Groups in which the operation satisfies the
commutative property are called commutative groups
or abelian groups. The above groups are examples of
Abelian Groups.
24. MATHEMATICAL SYSTEM
Determine whether the following statement is true or
false. Justify your answer.
1) The set {−1, 1} is a group under multiplication.
2) The set of all odd integers is closed under addition.
3) ℚ under multiplication is a group.
4) The set {0, 1, 2, 3} is a group under addition mod 4.
5) The set {−1, 0, 1} is a group under addition.