Logic and Set Theory
Logic and Set Theory
ARITHMETIC
by: Justine Blu Delfin
INSPIRED BY
MODULAR
ARITHMETIC
- In mathematies, modular
mathematics (sometimes known as
clock arithmetic) is a special type of
arithmetic that makes use of only
integers, where numbers "wrap
around" upon reaching a given fixed
quantity.
- Modular arithmetic was developed
by German mathematician and
physicist Carl Friedrich Gauss (1777-
1855) in his book Disquisitiones
Arithmeticae, published in 1801
Carl Friedrich Gauss (1777- 1855)
12-HOUR
CLOCK
- A familiar use of modular arithmetic
is in the 12-hour clock
- which has the time period divided
into two equal halves: a.m. (from
Latin ante meridiem, translates to,
before midday) and p.m. (from Latin
post meridiem translates to, past
midday).
12-HOUR
- To denote addition on a 12-hour
clock, we will use the symbol ⊕.
- To denote subtraction on a 12-hour
CLOCK
clock, we will use the symbol ⊖.
Examples:
Calculate using a 12-hour clock
8 ⊕ 10
6⊕7
10 ⊕ 6
5⊖8
3 ⊖ 11
12-HOUR
- To denote addition on a 12-hour
clock, we will use the symbol ⊕.
- To denote subtraction on a 12-hour
CLOCK
clock, we will use the symbol ⊖.
Examples:
Calculate using a 12-hour clock
8 ⊕ 10 solution: 6
6⊕7 solution: 1
10 ⊕ 6 solution: 4
5⊖8 solution: 9
3 ⊖ 11 solution: 4
DAY-OF-THE-WEEK
ARITHMETIC
- The same method can be applied to
day-of-the-week arithmetic.
Example:
- If we assign each day of the week
2⊞6=1
with a number, (Monday 1, Tuesday
2, Wednesday 3. Thursday 4, Friday
1 ⊞ 18 = 5
5, Saturday 6, and Sunday = 7 )
a. 18 ≡ 6 mod 3
b. 23 ≡ 9 mod 4
MODULO N
Example:
Determine whether the congruence is true
Addition Modulo n
a. (9+14) mod 8
Solution: Add 9+14=13. Divide the sum
by the modulus, 8. The remainder is the
answer, which are 5. In symbol, (9+4)
mod 8 = 5.
Perform the modular
arithmetic.
Subtraction Modulo n
b. (22-13) mod 5 Solution: Subtract 22-13=9. Divide the
difference by the modulus, 5. The
remainder is the answer, which are 4. In
symbol, (22-13) mod 5 = 4.
Multiplication Modulo n
а.
8 in modulo 13 arithmetic
d = 10 – (d + 3d + d + 3d + d + 3d + d +
3d
¹³ ¹ ² ³ ⁴ ⁵ ⁶ ⁷
+ d⁹ + 3d¹⁰ + d +3d
⁸ ¹¹ ¹² ) 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.
Credit
Card
Numbers
By: Pascual,Isabelle G.
A credit card number is typically
16 digits in length, often
appearing in sets of four. It is used
to identify both the credit card
issuer and the account holder.
Credit card numbers are not
random. It can be tested by a
modular formula for validity.
The Luhn algorithm (also called mod 10)
is a checksum formula used to
determine whether a credit card
number is valid. It is calculated as
follows: Starting from the rightmost
digit double the value of every second
digit. If the results become a two-digit
number, treat the number as two
individual digits. Now find the sum of all
the digits. If the modulo 10 is equal to
Example:
Determine whether 5234-8213-3410-1825
is a valid credit card number.
Solution
:5 2 3 4 8 2 1 3 3 4 1 0 1
Starting from the8 rightmost
35 digit double the value of every
second digit.
10 2 6 4 16 2 2 3 6 4 2 0 2 8
Then, find the sum6of
5 all the digits.
1+0+2+6+4+1+6+2+2+3+6+4+2+0+2+8
nce 60 = 0 mod 10, this is+a6valid
+ 5 =credit
60 card number.
Cryptography is the art of
writing and solving secret codes.
The word comes from the Greek
words, kryptos, meaning hidden
and graphien,meaning writing.
CRYPTOGRAPHY
The key terms in cryptography
are listed below.
a. Plaintext is a clear-text
message before it is coded.
Example:
MATHEMATICAL SYSTEM
(Start from the letter "A" when the
b. Ciphertext is the
end of the English alpha- bet is
message after it has reached.) This is called cyclical
been written in code. coding scheme because each letter
of the English alphabet is shifted
Example: the same number of positions. The
English alphabet and the substitute
ESLZWESLAUSD KQKLWE
alphabet are shown below.
c. Encryption is the
process of converting
plaintext to ciphertext.
The word "MATHEMATICAL SYSTEM" d. Decryption is the
was encrypted by substituting each process of reverting
letter in plaintext with the letter that ciphertext to plaintext.
is 18 letters after that letter in the
alphabet.
If a message has been encrypted The key to the code can be
using a cyclical substitution code, the determined when a recognizable
key to the code can be determined word appears. In this case, the word
by taking a word from the encrypted "MATHEMATICAL" appeared after the
message and continuing the letters have been shifted eight times.
alphabet for each letter of the word. Substitute the letter of the English
ESLZWESLAUSD alphabet that comes eight positions
FTMAXFTMBVTE after the letter in the encrypted
GUNBYGUNCWUF message to decode the message.
Encrypted Message: Decrypted
HVOCZHVODXVG ESLZWESLAUSD KQKLWE Message:
IWPDAI WPEYWH Shift 8 MATHEMATICAL
Shift Eight Positions
SYSTEM
JXQEBJXQFZXI
Cyclical coding scheme using the
KYRFCKYRGAYJ English alphabet is related to
LZSGDLZSHBZK modular arithmetic. They start with
MATHEMATICAL the English alphabet and assign each
letter with a number as shown below.
≡p (c + n) mod 26
where: p = the numerical equivalent of the plaintext
letter
c = the numerical equivalent of the ciphertext
letter
n = 26-m
Example:
m = the number of positions the letter is shifte
If the encrypting code is to shift each
letter of the plaintext message m Use the cyclical alphabetic
positions, then the corresponding letter encrypting code that shifts
in the ciphertext message is given by
c (p
≡ + m) mod 26 each letter 8 position to:
here: c = the numerical equivalent of the ciphertext letter
p = the numerical equivalent of the plaintext letter
m = the number of positions the letter is to a. code MATH IS FUN.
shifted
There is also a method by which the
person receiving the message can
return the encrypted message to
plaintext. For the cyclical code, the
Solution;
c = 3p + 10
c - 10 = 3p * Subtract 10 from both side of the
9(c - 10) = equation.
9(3p) ≡
* Multiply both side of the equation by
the mul- tiplicative inverse of 3. Since 9
•3 1 mod 26, multiply both side by 9.
[9(c - 10)] mod ≡26 p
We can now convert the ciphertext message
WCVYLZ to plaintext using the congruence
26≡ p
equation [9(c - 10)] mod
. The method for decoding the ciphertext is
shown in the table below.
THANK YOU FOR
YOUR
ATTENTION !