CHAPTER 3: ELEMENTARY NUMBER THEORY - PowerPoint PPT Presentation

1 / 83
About This Presentation
Title:

CHAPTER 3: ELEMENTARY NUMBER THEORY

Description:

3.2 : Determine the prime factorization of an integer ... Prime Factorization. Theorem 1:The Fundamental Theorem of Arithmetic ... Find the GCD by Prime Factorization ... – PowerPoint PPT presentation

Number of Views:4107
Avg rating:5.0/5.0
Slides: 84
Provided by: sitizanar
Category:

less

Transcript and Presenter's Notes

Title: CHAPTER 3: ELEMENTARY NUMBER THEORY


1
CHAPTER 3 ELEMENTARY NUMBER THEORY
  • Fundamental Discrete Structure
  • DCT 1073

2
CONTENT
  • 3.1 Divisibility
  • 3.2 Primes
  • 3.3 The Division Algorithm
  • 3.4 Greatest Common Divisors (GCD)
  • 3.5 Least Common Multiples (LCM)
  • 3.6 Euclidean Algorithm
  • 3.7 Modular Arithmetic
  • 3.8 The Chinese Remainder Theorem

3
OBJECTIVES
  • At the end of this chapter you should be able to
  • 3.1 Determine the divisibility of integers
  • 3.2 Determine the prime factorization of an
    integer
  • 3.3 Find the quotient and remainder from a
    division of integers
  • 3.4 Find the greatest common divisor of two
    integers
  • 3.5 Find the least common multiple of two
    integers
  • 3.6 Use the Euclidean Algorithm to find the
    Greatest Common Divisor of two integers
  • 3.7 Apply the use of congruences and modular
    arithmetic in hashing function, pseudorandom
    numbers and cryptology.
  • 3.8 Find the smallest nonnegative integer that
    satisfies the given system of congruences.

4
INTRODUCTION
  • Number Theory is the branch of pure mathematics
    involving integers and their properties.
  • The basic concepts of number theory discussed in
    this chapter are used widely throughout computer
    science.

5
3.1 DIVISIBILITY
Lesson outcome Determine the divisibility of
integers
6
Division in the integers
  • When one integer is divided by a second, nonzero
    integer, the quotient may or may not be an
    integer.
  • For example

Not an integer
Integer
7
Division in the integers
  • Definition

If a and b are integers with a ? 0 , we say that
a divides b if there is an integer c such that b
a c. 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. The notation denotes that a
does not divide b.
Remark We can express a b using quantifiers
as
8
Example
  • Determine whether 3 7 and 3 12
  • 3 7 FALSE since 7/3 is not an integer
  • 3 12 TRUE since 12/3 is an integer

9
Theorem
  • Let a, b and c be integers. Then,
  • if a b and a c , then a (b c)
  • if a b , then a bc for all integers c
  • if a b and b c , then a c .
  • For example

10
Exercise 3.1
  • Determine whether
  • 7 21
  • 4 15
  • Does 13 divide each of these number?
  • 79
  • 113
  • 5954
  • Show that if a is an integer other than 0, then
  • 1 divides a
  • a divides 0

11
3.2 PRIMES
Lesson outcome Determine the prime factorization
of an integer
12
Prime
  • Every positive integer greater than 1 is
    divisible by at least two integers, since a
    positive integer is divisible by 1 and by itself.
  • Integers that have exactly two different positive
    integer factors are called primes.
  • DEFINITION
  • A positive integer p greater than 1 is
    called prime if the only positive factors of p
    are 1 and p. (EXAMPLE 5 IS PRIME)
  • A positive integer that is greater than 1
    and is not prime is called composite. Integer n
    is composite iff there exists an integer a such
    that a n and 1 lt a lt n. (EXAMPLE 12 IS
    COMPOSITE)

13
Primes
Example The integer 7 is prime since its only
positive factors are 1 and 7, whereas the
integer 9 is composite since it is divisible by 3.
The primes less than 100 are 2, 3, 5, 7, 11,
13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
61, 67, 71, 73, 79, 83, 89, and 97.
14
Prime Factorization
  • Theorem 1The Fundamental Theorem of Arithmetic
  • Every positive integer greater than 1 can be
    written uniquely as the product of primes.
  • Theorem 2
  • If n is a composite integer then n has a prime
    divisor less than or equal to .
  • Theorem 3
  • There are infinitely many primes

15
Prime Factorization
  • The prime factorization of 100, 641, 999, 1024
    and 7007 is given by

16
Exercise 3.2
  • Determine whether each of these integers is
    prime.
  • 119 c) 101
  • 277 d) 1113
  • Find the prime factorization of these integers?
  • 39 d) 238
  • 113 e) 96
  • 5954 f) 101

17
3.3 THE DIVISION ALGORITHM
Lesson outcome Find the quotient and remainder
from a division of integers
18
The Division Algorithm
a dividend, d divisor, q quotient, r
remainder
  • q a div d r a mod d

19
Examples
  • What are the quotient and remainder when 101 is
    divided by 11?
  • solution 101 11 9 2,
  • the quotient is 9 101 div 1 and
  • the remainder is 2 101 mod 11
  • What are the quotient and remainder when -11 is
    divided by 3?
  • solution -11 3(-4) 1,
  • the quotient is -4 -11 div 3 and
  • the remainder is 1 -11 mod 3
  • Find the quotient and remainder when a 17 and d
    3
  • solution so

20
Exercise 3.3
  • Find the quotient and remainder when
  • a 4 and d 10
  • a -13 and d 5
  • What are the quotient and remainder when
  • 44 is divided by 8?
  • 777 is divided by 21?
  • -2002 is divided by 87?

21
3.4 GREATEST COMMON DIVISORS (GCD)
Lesson outcome Find the greatest common divisor
of two integers
22
Greatest Common Divisor (GCD)
  • DEFINITION
  • If a, b, and k are in , and k a and k b
    , we say that k is a common divisor of a and b.
  • If d is the largest such k, d is called the
    greatest common divisor, or GCD, of a and b, and
    we write d gcd (a, b).

TIPS
The largest integer that divides both of two
integers is called GREATEST COMMON DIVISOR of
these integers
23
Example
  • Find GCD(105,30).
  • Solution
  • The divisors of 30 are 1, 2, 3, 5, 6, 10, 15, and
    30.
  • The divisors of 105 are 1, 3, 5, 7, 15, 21, 35,
    and 105.
  • Therefore the common divisors of 30 and 105 are
    1, 3, 5, and 15.
  • Hence, GCD(105,30) 15.

24
Example
  • What is the greatest common divisor of 24 and 36?
  • Solution
  • The divisor of 24 are 1, 2, 3, 4, 6, 8, 12, 24
  • The divisor of 36 are 1, 2, 3, 4, 6, 9, 12, 18,
    36
  • Therefore the common divisor of 24 and 36 are 1,
    2, 3, 4, 6, and 12.
  • Hence, GCD (24, 36) 12.

25
Exercise 3.4
  • Find GCD(60,100).
  • What is the greatest common divisor of 34 and 58?
  • Find GCD(45,33).
  • What is the greatest common divisor of 77 and
    128?

26
Relatively Prime
  • If GCD (a, b) 1, we say that a and b are
    relatively prime.
  • EXAMPLE
  • What is the greatest common divisor of 17 and
    22?
  • Solution
  • The divisor of 17 are 1, 17
  • The divisor of 22 are 1, 2, 11, 22
  • Therefore the common divisor of 17 and 22 is 1.
  • Hence, GCD (17, 22) 1.

27
Pairwise Relatively Prime
  • The integers a1,a2,,an are pairwise relatively
    prime
  • if GCD (ai, bj) 1, whenever 1 i lt j n.
  • EXAMPLE
  • Determine whether the integers 10, 17, and 21
    are pairwise relatively prime and whether the
    integers 10, 19, and 24 are pairwise relatively
    prime.
  • Solution
  • Since GCD(10, 17) 1, GCD(10, 21) 1, and GCD
    (17, 21) 1, we conclude that 10, 17, and 21 are
    pairwise relatively prime.
  • Since GCD (10, 24) 2 gt 1, we see that 10, 19,
    and 24 are not pairwise relatively prime.

28
Exercise 3.4
  • Determine whether the integers in each of these
    sets are pairwise relatively prime.
  • 11, 15, 19
  • 14, 15, 21
  • 12, 17, 31, 37
  • 7, 8, 9, 11

29
Find the GCD by Prime Factorization
  • Another way to find the GCD of two integers is to
    use the prime factorizations of these integers.

If the prime factorizations of the integers a
and b are Then GCD (a, b) is given by
TIPS
min (a, b) represents the minimum of the two
integers a and b
30
Example
  • What is the greatest common divisor of 120 and
    500?
  • Solution
  • The prime factorization of 120 is
  • The prime factorization of 500 is
  • Hence,

31
Exercise 3.4
  • What are the greatest common divisors of these
    pairs of integers?
  • ,
  • ,
  • ,
  • ,
  • ,

32
3.5 LEAST COMMON MULTIPLE (LCM)
Lesson outcome Find the least common multiple
of two integers
33
Least Common Multiple (LCM)
  • DEFINITION
  • If a, b, and k are in , and a k and b k
    , we say that k is a common multiple of a and b.
  • The smallest k, call it c is called the least
    common multiple, or LCM, of a and b, and we write
    c LCM (a, b).

TIPS
The least common multiple of two numbers is the
smallest number (not zero) that is a multiple of
both.
34
Example
  • Find LCM(3,4).
  • Solution
  • Multiple of 3 3, 6, 9, 12, 15,
  • Multiple of 4 4, 8, 12, 20, 24,
  • LCM(3, 4) 12

35
Exercise 3.5
  • Find LCM(6,4).
  • What is the least common multiple of 34 and 58?
  • Find LCM(12,8).
  • What is the least common multiple of 10 and 15?

36
Find the LCM by Prime Factorization
  • Another way to find the LCM of two integers is to
    use the prime factorizations of these integers.

If the prime factorizations of the integers a
and b are Then LCM (a, b) is given by
TIPS
max(a, b) represents the maximum of the two
integers a and b
37
Example
  • What is the least common multiple of 120 and 500?
  • Solution
  • The prime factorization of 120 is
  • The prime factorization of 500 is
  • Hence,

38
Exercise 3.5
  • What are the least common multiple of these pairs
    of integers?
  • ,
  • ,
  • ,
  • ,
  • ,

39
Obtain the LCM from the GCD
  • Theorem
  • If a and b are two positive integers, then
  • ab GCD(a, b) LCM(a, b)

EXAMPLE Given GCD(190,34) 2. Determine
LCM(190,34). Solution
40
Exercise 3.5
  • Given GCD(105,30) 15. Determine LCM(105,30).
  • Given GCD(540,504) 36.
  • Determine LCM(540,504).
  • Given GCD(12,30) 6. Determine LCM(12,30).

41
3.6 EUCLEDIAN ALGORITHM
Lesson outcome Use the Euclidean Algorithm to
find the Greatest Common Divisor of two integers
42
Euclidean Algorithm
  • - A systematic procedure for finding GCD(a, b)
    is Euclidean Algorithm. This procedure is based
    on the following result (Lemma) about GCD and the
    division algoithm below.

43
Example
  • Determine GCD(190,34) by using Euclidean
    algorithm.
  • Solution
  • a 190 and b 34. By using the Euclidean
    algorithm, we
  • divide 190 by 34 190 5(34) 20
  • divide 34 by 20 34 1(20) 14
  • divide 20 by 14 20 1(14) 6
  • divide 4 by 6 14 2(6) 2
  • divide 6 by 2 6 3(2)
    0,
  • so GCD(190,34) 2, the last of nonzero divisors.

44
Exercise 3.6
  • Use the Euclidean algorithm to find
  • GCD(414,662)
  • GCD(120,23)
  • GCD(12, 18)
  • GCD(111, 201)
  • GCD(1001, 1331)
  • GCD(12345, 54321)
  • GCD(1000, 5040)
  • GCD(9888, 6060)

45
Extended Euclidean Algorithm
  • The GCD of two integers can be expressed as the
    following theorem

Linear combination
46
Example
  • Express gcd(252, 198) 18 as a linear
    combination of 252 and 198.
  • Solution
  • To show that gcd(252, 198) 18, the Euclidean
    algorithm uses these divisions
  • 252 1(198) 54
  • 198 3(54) 36
  • 54 1(36) 18
  • 36 2(18)

47
Example
  • Express gcd(252, 198) 18 as a linear
    combination of 252 and 198.
  • Solution (continue)
  • 54 252 1(198)
  • 36 198 3(54)
  • 198 3252-1(198)
  • 198 3(252) 3(198)
  • 4(198) 3(252)
  • 18 54 1(36)
  • 252 1(198) -14(198)-3(252)
  • 252 198 4(198) 3(252)
  • 4(252) 5(198) s 4, t -5

48
Exercise 3.6
  • Express gcd(190, 34) 2 as a linear combination
    of 190 and 34.
  • Express gcd(120, 23) 1 as a linear combination
    of 120 and 23.

49
Exercise 3.6
  • Express the greatest common divisor of each of
    these pairs of integers as a linear combination
    of these integers.
  • 10, 11 f) 0, 223
  • 21, 44 g) 123, 2347
  • 36, 48 h) 3454, 4666
  • 34, 55 i) 9999, 11111
  • 117, 213

50
3.7 MODULAR ARITHMETIC
Lesson outcome Apply the use of congruences and
modular arithmetic in hashing function,
pseudorandom numbers and cryptology.
51
Motivation
In some situations we care only about the
remainder of an integer when it is divided by
some specified positive integer.
Example If the time is now 9 oclock, what time
will it be 100 hours from now? Solution Let n
24 and m 9 100 109. Then we have 109
4(24) 13. In 100 hours it will be 13 oclock.
Recall The Division Algorithm
  • r m mod n 13 109 mod 24

52
Example
  • Evaluate these quantities
  • 17 mod 3

b) 133 mod 9
solution
solution
c) 2004 mod 101
d) 29 mod 5
solution
solution
53
Exercise 3.7
  • Evaluate these quantities.
  • 13 mod 3
  • -97 mod 11
  • 155 mod 19
  • -221 mod 23
  • 3 mod 6

54
Congruent
m and r not congruent modulo n
m mod n r mod n
congruent to r modulo n
n is modulus
55
Example
  • Determine whether 17 is congruent to 5 modulo 6
  • Determine whether 24 and 14 are congruent modulo
    6.

solution
solution
56
Exercise 3.6
  • Decide whether each of these integers is
    congruent to 5 modulo 17.
  • 80
  • 103
  • -29
  • -122

57
Mod-n Function
  • Example
  • because 16 5(3) 1 and
  • because 156 22(7) 2 and
  • because 14 4(3) 2 and

58
Exercise 3.6
  • If f is the mod-7 function, compute each of the
    following.
  • f (17)
  • f (48)
  • f (1207)
  • f (130)
  • f (93)
  • f (169)

59
Example
  • If f is the mod-7 function, solve f (n) 2.

solution
60
Exercise 3.6
  • If g is the mod-6 function, solve each of the
    following.
  • g (n) 3
  • g (n) 1

61
Example
  • Solve the following congruences if possible.
    If no solution exists, explain why not.

solution
62
Exercise 3.6
  • Solve each of the following congruences if
    possible. If no solution exists, explain why not.

63
Applications Of Congruences
  • Hashing Functions
  • The use of congruences to assign memory locations
    to computer files
  • Pseudorandom Numbers
  • The generation of pseudorandom numbers
  • Cryptography
  • Cryptosystems based on modular arithmetic

64
1. Hashing Functions
MOTIVATION
The central computer of a university maintains
records for each student. How can memory
locations be assigned so that student records can
be retrieved quickly?
THE SOLUTION
Use the suitable Hashing Function
  • Many different hashing functions are used so that
    files can be quickly located .
  • One of the most common is the function
  • where m is the number of available memory
    locations and k is a key which uniquely
    identifies each records.

65
Example
Hashing Function
If the number of available memory locations are
111
66
Exercise 3.6
  • Which memory locations are assigned by the
    hashing function h (k) k mod 101 to the records
    of students with this ID numbers?
  • 104578690
  • 432222187
  • 372201919
  • 501338753

67
Exercise 3.6
  • A parking lot has 31 visitor spaces, numbered
    from 0 to 30.Visitors are assigned parking spaces
    using the hashing function h (k) k mod 31,
    where k is the number formed from the first three
    digits on their license plates.
  • Which spaces are assigned by the hashing
    function to cars that have these first three
    digits on their license plates?
  • 317, 918, 007, 100, 111, 310

68
2. Pseudorandom Numbers
DEFINITION
Random numbers generated by systematic methods
that are not truly random
THE PROCEDURE
Use the Linear Congruential Method
  • Choose four integers modulus m, multiplier a,
    increment c, and seed x0 with 2 a lt m, 0 c lt
    m , and 0 x0 lt m
  • Generate a sequence of pseudorandom number xn
    with 0 xn lt m for all n, by successively
    using the congruence

69
Example
  • The sequence of pseudorandom numbers generated by
    choosing m 9, a 7, c 4, and x0 3 can be
    found as follows
  • Because x9 x0 3, thus these sequence contains
    9 different numbers before repeating as below
  • 3, 7, 8, 6, 1, 2, 0, 4, 5, 3, 7, 8, 6, 1, 2, 0,
    4, 5, 3,

70
Exercise 3.6
  • What sequence of pseudorandom numbers is
    generated using the linear congruential generator
  • with seed 2?

71
3. Cryptography
FOUNDER
Use by Julius Caesar to write a secret messages
by shifting each letter 3 letters forward in
alphabet.
ENCRYPTION
The process of making secret message
STEPS (Caesar cipher )
  • Replace each letter by an integer from 0 to 25,
    based on its position in the alphabet.
  • Replace each of these numbers p by f (p) (p
    3) mod 26
  • Substitute the letters that correspond to these
    numbers.

72
STEP 1 (Caesar Cipher )
73
Example
74
Example
75
Exercise 3.6
  • Encrypt the message DO NOT PASS GO by
    translating the letters into numbers, applying
    the encryption function given, and then
    translating the numbers back into letters.
  • (the
    Caesar cipher)

76
Exercise 3.6
  • Decrypt these messages encrypted using the Caesar
    cipher.
  • EOXH MHDQV
  • WHVW WRGDB
  • HDW GLP VXP
  • L DP ILQH

77
3.8 THE CHINESE REMINDER THEOREM
Lesson outcome Find the smallest nonnegative
integer that satisfies the given system of
congruences.
78
Motivation
Puzzle
Asked by a Chinese mathematician Sun-Tsu in the
first century.
There are certain things whose number is unknown.
When divided by 3, the remainder is 2 when
divided by 5, the remainder is 3 and when
divided by 7, the remainder is 2. What will be
the number of things?
  • This puzzle can be translated into the following
    question
  • What are the solutions of the systems of
    congruences

79
The Chinese Remainder Theorem
It follows that
80
Example
  • Solve the system

81
Example Sun-Tsu Puzzle
  • What are the solutions of the systems of
    congruences

82
Exercise 3.7
  • In each case, find the smallest nonnegative
    integer that satisfies the given system of
    congruences.
  • c)

83
Thank You
Write a Comment
User Comments (0)
About PowerShow.com