Professional Documents
Culture Documents
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007
2
• Introduction
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
3
• Division
– Definition 1:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
– Example : 4
4 | 12 4 18
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
5
– Theorem 1:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
7
• Primes
– Definition 2:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
8
– Theorem 2:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
9
– Theorem 3:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
1
1
– Theorem 4:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
1
3
– Theorem 5:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
1
4
• The Division Algorithm
– Theorem 6:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
1
5
– Definition 3:
Quotient Remainder
= 101 div 11 = 2 = 101 mod 11
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
1
• Greatest Common Divisors & Least Common 6
Multiples
– Definition 4
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
1
7
– Definition 5:
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
1
– Definition 7: 8
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
2
0
• Modular Arithmetic
– Definition 8:
– Theorem 8
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
2
2
• Applications of Congruences
1. Hashing Functions
2. Pseudorandom Numbers
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
2
3
1. Hashing Functions
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
2
4
2. Pseudorandom Numbers
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
2
5
3. Cryptology (Caesar Cepher)
a) Encryption:
• Mathematical expression:
f(p) = (p + 3) mod 26 0 p 25
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
– Example: What is the secret message produced from 2
the message “Meet you in the park” 6
Solution:
1. Replace letters with numbers:
meet = 12 4 4 19
you = 24 14 20
in = 8 1 3
the = 19 7 4
park = 15 0 17 10
2. Replace each of these numbers p by f(p) = (p + 3) mod 26
meet = 15 7 7 22
you = 1 17 23
in = 11 16
the = 22 10 7
park = 18 3 20 13
3. Translate back into letters: “PHHW BRX LQ WKH SDUN”
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &
2
7
b) Decryption (Deciphering)
CSE 504, Chapter 2 (Part 2): The Fundamentals: Algorithms, the Integers &