Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 32

DISCRETE MATHEMATICS AND APPLICATIONS

(BUM1233)

CHAPTER 1: NUMBER TEORY


CHAPTER 1:
NUMBER THEORY

Intan Sabariah Binti Sabri


(intansabariah@ump.edu.my)
CONTENTS

CHAPTER 1: NUMBER TEORY


1.1 Factorability
1.2 Primes
1.3 The Division Algorithm
1.4 Greatest Common Divisors (GCD)
1.5 Least Common Multiples (LCM)
1.6 Euclidean Algorithm
1.7 Modular Arithmetic
1.8 Application of Congruences
1.9 The Chinese Remainder Theorem
INTRODUCTION

CHAPTER 1: NUMBER TEORY


• Number Theory - branch of mathematics involving
integers and their properties.

• The basic concepts of number theory developed in


this chapter are used widely throughout computer
science.
1.1 FACTORABILITY

CHAPTER 1: NUMBER THEORY


Lesson Outcome:
Determine the divisibility of integers.
Division in the integers

CHAPTER 1: NUMBER TEORY


• When an integer is divided by a nonzero integer, the
quotient may or may not be an integer.

Example:

15 13
5 or  4.3333
3 3
Integer Not an integer
Division in the integers

CHAPTER 1: NUMBER TEORY


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
• b is a multiple of a.

a | b denotes that a divides b. a | bdenotes that a does not divide b.

Remark:
We can express a | b using quantifiers such as c, ac  b
Example

CHAPTER 1: NUMBER THEORY


Determine whether 4 | 9 and 7 | 28.

4 | 9 FALSE since 9/4 is not an integer.


4c  9

7 | 28 TRUE since 28/7 is an integer.


7c  28
Theorem (here)*

CHAPTER 1: NUMBER TEORY


Let a, b and c be integers. Then,
i. if a|b and a|c, then a|(b + c) ;
ii. if a|b, then a|bc for all integers c;
iii. if a|b and b|c, then a|c.
Example:
Exercises 1.1

CHAPTER 1: NUMBER TEORY


1. Determine whether:
a) 7 | 21 c) 12 |-144
b) 4 | 15

2. Does 13 divide each of these number?


a) 79
b) 113
c) 5954

3. Show that if a is an integer other than 0, then


a) 1 divides a
b) a divides 0
1.2 PRIMES

CHAPTER 1: NUMBER THEORY


Lesson Outcome:
Determine the prime factorization of an integer.
Prime

CHAPTER 1: NUMBER TEORY


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 < a < n. (EXAMPLE: 12 IS COMPOSITE)
Prime

CHAPTER 1: NUMBER TEORY


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 1.

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.
Prime Factorization

CHAPTER 1: NUMBER TEORY


• Theorem 1:The 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

. n

• Theorem 3:
•There are infinitely many primes.
Prime Factorization

CHAPTER 1: NUMBER TEORY


The prime factorization of 100, 641, 999, 1024 and 7007 is given by:

2 2
100  2  2  5  5  2 5
641  641
999  3  3  3  37  33  37
1024  2  2  2  2  2  2  2  2  2  2  210
2
7007  7  7 11 13  7 11 13
Exercises 1.2

CHAPTER 1: NUMBER TEORY


1. Determine whether each of these integers is prime.

a) 119 c) 101
b) 277 d) 1113

2. Find the prime factorization of these integers.

a) 39 d) 238
b) 113 e) 96
c) 5954 f) 101
1.3 The Division Algorithm

CHAPTER 1: NUMBER THEORY


Lesson Outcome:
Find the quotient and remainder from a division of integers.
The Division Algorithm

CHAPTER 1: NUMBER TEORY


Case 1: If m  0,
If m, n  , and n  0, we can write m  qn  r where q, r  , 0  r  n.
Case 2 : If m  0,
If m, n  , and n  0, then r  r  n and q  q  1.
m– dividend, n– divisor, q – quotient, r – remainder
q = m div n r = m mod n
Examples

CHAPTER 1: NUMBER TEORY


1) What are the quotient and remainder when 101 is divided by 11?
Solution: 101 = 11 · 9 + 2,
the quotient is 9 = 101 div 11 and
the remainder is 2 = 101 mod 11

2) 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

3) Find the quotient and remainder when m = 17 and n = 3


Solution: 17  5(3)  2 so q  5 and r  2
Exercises 1.3

CHAPTER 1: NUMBER TEORY


1. Find the quotient and remainder when
a) m = 4 and n = 10
b) m = -13 and n = 5

2. What are the quotient and remainder when

a) 44 is divided by 8?
b) 777 is divided by 21?
c) -2002 is divided by 87?
1.4 Greatest Common Divisor
(GCD)

CHAPTER 1: NUMBER THEORY


Lesson Outcome:
Find the greatest common divisor of two integers.
Greatest Common Divisor (GCD)

CHAPTER 1: NUMBER TEORY


DEFINITION:

• If a, b, and k are in Z , 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, such that
d = gcd (a, b).

TIPS
The largest integer that divides both of two integers is
called GREATEST COMMON DIVISOR of these integers
Greatest Common Divisor (GCD)

CHAPTER 1: NUMBER TEORY


Euclidean
Algorithm
Greatest
Common
Prime Divisor
Factorization (GCD)

List down
Example

CHAPTER 1: NUMBER TEORY


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
Example

CHAPTER 1: NUMBER TEORY


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.


Exercises 1.4

CHAPTER 1: NUMBER TEORY


1. Find GCD(60,100).

2. What is the greatest common divisor of 34 and 58?

3. Find GCD(45,33).

4. What is the greatest common divisor of 77 and 128?


Relatively Prime

CHAPTER 1: NUMBER TEORY


If GCD (a, b) = 1, we say that a and b are relatively prime.

Example:
What is the greatest common divisor of 19 and 22?
Solution:
Divisors of 19 : 1, 19 Relatively
Divisors of 22 : 1, 2, 11, 22 Prime

Hence, GCD (19, 22) = 1.


Pairwise Relatively Prime

CHAPTER 1: NUMBER TEORY


The integers a ,a ,…,a are pairwise relatively prime
1 2 n

if GCD (a , b ) = 1, whenever 1 ≤ i < j ≤ n.


i j

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 > 1, we see that 10, 19, and 24 are not pairwise
relatively prime.
Exercises 1.4

CHAPTER 1: NUMBER TEORY


Determine whether the integers in each of these
sets are pairwise relatively prime.

a) 11, 15, 19
b) 14, 15, 21
c) 12, 17, 31, 37
d) 7, 8, 9, 11
Finding the GCD by Prime Factorization

CHAPTER 1: NUMBER TEORY


• 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:


a  p1a1 p2a2 ... pnan b  p1b1 p2b2 ... pnbn
Then GCD (a, b) is given by:
min( a1 ,b1 ) min( a2 ,b2 ) min( an ,bn )
GCD( a, b)  p 1 p
2 ... p
n

TIPS
min (a, b) represents the minimum of the two integers a and b
Example

CHAPTER 1: NUMBER TEORY


What is the greatest common divisor of 120 and 500?

Solution
• The prime factorization of 120 is 120  23  3  5

• The prime factorization of 500 is 500  2 2  53

• Hence,

GCD(120, 500)  2 min(3,2)3min(1,0)5min(1,3)  2 23051  20


Exercises 1.4

CHAPTER 1: NUMBER TEORY


What are the greatest common divisors of these pairs of
integers?
7 3 3 11 5 9
a) 3 5 7 and 2 3 5

b) 11 13 17
and 29  37  55  73

c) 2331 and 2317


41  43  53 41  43  53
d) and
12 21
e)
13
3 5 17
and
2 7
Thank You

You might also like