Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,

Similar presentations


Presentation on theme: "1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,"— Presentation transcript:

1 1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices

2 2 Section 2.4 The Integers and Division

3 3 If a and b are integers with, 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. Division

4 4 Division - Examples 17 | 68 since 68 = (4)(17) 17 | 357 since 357=(21)(17)

5 5 Divisibility Rules 1. Every integer is divisible by 1 2. If an integer is even then it is divisible by 2 3. If the sum of the digits is divisible by three, the number is also 4. If the last two digits are divisible by 4, the number is also 5. If the last digit is a 5 or a 0, the number is divisible by 5.

6 6 Divisibility Theorem Let a, b, and c be integers. Then 1. if a|b and a|c, then a|(b+c); 2. if a|b, then a |bc for all integers c; 3. if a|b and b|c, then a|c.

7 7 Definitions A positive integer p greater than 1 is called prime if the only positive factors of p are 1 and p. A positive integer that is greater than 1 and is not prime is called composite.

8 8 Fundamental Theorem of Arithmetic Every positive integer can be written uniquely as the product of primes, where the prime factors are written in order of increasing size. (Here, a product can have zero, one, or more than one prime factor.)

9 9 Examples

10 10 Theorem If n is a composite integer, then n has a prime divisor less than or equal to

11 11 Least Common Multiple The least common multiple of the positive integers a and b is the smallest positive integer that is divisible by both a and b. The least common multiple of a and b is denoted by lcm(a,b). Let a and b be positive integers. Then

12 12 Greatest Common Divisor Let a and b be integers, not both zero. The largest integer d such that d|a and d|b is called the greatest common divisor of a and b. The greatest common divisor of a and b is denoted by gcd(a,b).

13 13 Division Algorithm Let a be an integer and d a positive integer. Then there are unique integers q and r, with, such that In the equality given 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.

14 14 Example Let a = 47 and d = 6 then results in with a quotient of 7 and a remainder of 5.

15 15 Relatively Prime The integers a and b are relatively prime if their greatest common divisor is 1.

16 16 Pairwise Relatively Prime The integers a 1, a 2, …, a n are pairwise relatively prime if gcd(a i, a j ) = 1 whenever

17 17 Modular Arithmetic Let a be an integer and m be a positive integer. We denote a mod m the remainder when a is divided by m. In C, we use the % operator 13 % 5 is 3

18 18 Congruence 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 to indicate that a is congruent to b modulo m. If a and b are not congruent modulo m, we write

19 19 Theorem Let m be a 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.

20 20 Theorem

21 21 Applications of Congruences Hashing Functions Pseudorandom Numbers Cryptology

22 22 finished


Download ppt "1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,"

Similar presentations


Ads by Google