Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter The Integers and Division Division

Similar presentations


Presentation on theme: "Chapter The Integers and Division Division"— Presentation transcript:

1 Chapter 3 3.4 The Integers and Division Division
The Division Algorithm Modular Arithmetic Applications of Congruences Cryptology

2 Division Definition 1: if a and b are integers with a≠0, we say that a divides b if there is an integer c such that b=ac. When a divides b we say that a is a factor of b and that b is a multiple of a. the notation a|b denotes that a divides b. we write a | b when a does not divide b. Example 1: Determine whether 3|7 and whether 3|12. Example: Determine whether 3|0. /

3 Theorem 1: let a, b, and c be integers. Then
If a|b and a|c, then a|(b+c) If a|b and a|bc for all integer c If a|b and b|c, then a|c Corollary 1: If a, b, c are integers such that a|b and a|c , then a| mb + nc whenever m and n are integers.

4 The Division Algorithm
Theorem 2 the division algorithm :let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a= dq+r Definition 2: In the equality give in the division algorithm, d is called the divisor, a is called the dividend, q is called the quotient, and r is called the remainder. This notation is used to express the quotient and remainder. q = a div d, r = a mod d. Example 4: What are the quotient and remainder when -11 is divided by 3?

5 Modular Arithmetic Definition 3: if a and b are integers and m is a positive integer, then a is congruent to b modulo m if m divides a - b. we use the notation a≡b (mod m) to indicate that a is congruent to b modulo m. if a and b are not congruent modulo m, we write a ≡b (mod m) . /

6 Modular Arithmetic Theorem 3: let a and b be integers, and let m be a positive integer. Then a≡b (mod m) if and only if a mod m = b mod m . Example 5: determine whether 17 is congruent to 5 modulo 6 and whether 24 and 14 are congruent modulo 6.

7 a+c≡b+d (mod m) , ac ≡ bd (mod m)
Modular Arithmetic Theorem 4 : let m be positive integer. The integers a and b are congruent modulo m if and only if there is an integer k such that a = b + km . Theorem 5: let m be a positive integer. If a≡b(mod m ) and c ≡d (mod m), then a+c≡b+d (mod m) , ac ≡ bd (mod m) Example 6: because 7≡2 (mod 5) and 11≡1 (mod 5) , it follows from theorem 5 that 18=7+11 ≡2+1=3(mod 5) , and that 77=7*11 ≡2*1=2 (mod 5)

8 Corollary 2: let m be a positive integer and let a and b be integers
Corollary 2: let m be a positive integer and let a and b be integers. Then (a+b) mod m = ((a mod m)+(b mod m)) mod m And ab mod m =((a mod m)(b mod m)) mod m.

9 Applications of Congruences
Hashing Functions Pseudorandom Numbers Cryptology

10 Hashing Functions How can memory locations be assigned so that customer records can be retrieved quickly? Hashing function and key h(k) = k mod m; m is the number of available memory locations. Collision: one way to re solve a collision is to assign the first free location.

11 Pseudorandom Numbers The numbers generated by systematic method are not truly random, they are called pseudorandom numbers. Linear Congruential Method(m, a, c, x0 :integers): Modulus m Multiplier a, 2  a < m Increment c, 0  c < m Seed x0 , 0  x0 < m xn+1= (axn+c) mod m For example: m=9, a=7, c=4, x0 =3, then (x1, x2, x3, x4, x5, x6, x7, x8, x9)=(7, 8, 6, 1, 2, 0, 4, 5, 3) x10=x1

12 Cryptology Important Application of Congruences
Earliest known uses by Julius Caesar. Shifting each letter three letters forward in the alphabet. To express the process mathematically: Let U={0,.., 25}, V={A, .., Z} and g: V -> U is a bijection function defined as the table below. Define function f : U -> U, where f(p)=(p+3) mod 26. The Encryption function h:V->V, where h(x)=g-1( f(g(x) ) ) The decryption function f-1(p)=(p-3) mod 26. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

13 Applications of Congruences
Example 9: What is the secret message produced from the message “MEET YOU IN THE PARK” using the Caesar cipher. HW: Example 10, p208


Download ppt "Chapter The Integers and Division Division"

Similar presentations


Ads by Google