Discrete Mathematics Chapter 4 Number Theory. Discrete Mathematics Chapter 4 Number Theory.

Slides:



Advertisements
Similar presentations
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
Advertisements

1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
Quotient-Remainder Theory, Div and Mod
Chapter II. THE INTEGERS
Congruence of Integers
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
BY MISS FARAH ADIBAH ADNAN IMK
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Divisibility October 8, Divisibility If a and b are integers and a  0, then the statement that a divides b means that there is an integer c such.
Integers Number Theory = Properties of Integers
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
Mathematics of Cryptography Part I: Modular Arithmetic
February 24, 2015Applied Discrete Mathematics Week 4: Number Theory 1 Modular Arithmetic Let a be an integer and m be a positive integer. We denote by.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Copyright © Curt Hill Divisibility and Modular Arithmetic A Topic in Number Theory.
CompSci 102 Discrete Math for Computer Science
Copyright © 2009 Pearson Education, Inc. Chapter 5 Section 1 - Slide 1 Chapter 1 Number Theory and the Real Number System.
Number Theory 이재원 School of Information Technology Sungshin W. University.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Chapter 4 With Question/Answer Animations. Section 4.1.
Math 409/409G History of Mathematics Books VII – IX of the Elements Part 1: Divisibility.
Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Slide Copyright © 2009 Pearson Education, Inc. Unit 1 Number Theory MM-150 SURVEY OF MATHEMATICS – Jody Harris.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Discrete Mathematics 4. NUMBER THEORY Lecture 7 Dr.-Ing. Erwin Sitompul
Discrete Mathematics
Divisibility and Modular Arithmetic
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
Module #9 – Number Theory 6/11/20161 Chapter 3 Algorithms, Integers and Matrices.
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Slide Copyright © 2009 Pearson Education, Inc. Slide Copyright © 2009 Pearson Education, Inc. Chapter 1 Number Theory and the Real Number System.
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Agenda Review:  Relation Properties Lecture Content:  Divisor and Prime Number  Binary, Octal, Hexadecimal Review & Exercise.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
Number-Theoretic Algorithms
CMPS 2433 – Coding Theory Chapter 3
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division
Lecture 4 The Euclidean Algorithm
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
Mathematics of Cryptography
B504/I538: Introduction to Cryptography
CSE15 Discrete Mathematics 03/15/17
Introduction to Cryptography
Integers and Division Section 3.4.
CMSC Discrete Structures
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Applied Discrete Mathematics Week 3: Algorithms
Applied Discrete Mathematics Week 4: Number Theory
Foundations of Discrete Mathematics
Week #5 – 23/25/27 September 2002 Prof. Marie desJardins
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
Copyright © Zeph Grunschlag,
Divisibility and Modular Arithmetic
Applied Discrete Mathematics Week 10: Introduction to Counting
Number Theory.
Number Theory.
Number Theory: Prime & Composite Numbers
Sets, Combinatorics, Probability, and Number Theory
Presentation transcript:

Discrete Mathematics Chapter 4 Number Theory

Chapter 4 Number Theory Integers Integers are whole numbers, without any fractional or decimal components. Example: 8, 21, 8765, –34, 0. They are in opposite to real numbers, which posses decimal components. Example: 8.0, 34.25, 0.02, 3.2222

Chapter 4 Number Theory Division of Integers Suppose a and b are integers, a  0, then a divides b without remaining if there exists an integer c such that b = ac. Notation: a | b if b = ac, c  Z and a  0. Example: 4 | 12 because 12/4 = 3 (integer) or 12 = 4  3. 4 | 13 because 13/4 = 3.25 (not integer).

Chapter 4 Number Theory Euclidean Theorem Suppose m and n are integers, n > 0. If m is divided by n then there exists a unique integer q (quotient) and r (remainder), such that m = nq + r where 0  r < n. m is called dividend, while d is called divisor. Example: 1987/97 = 20, remaining 47 1987 = 9720 + 47 25/7 = 3, remaining 4 25 = 73 + 4 –25/7 = –4, remaining 3 –25 = 7(–4) + 3 But not –25 = 7(–3) – 4, because the remainder will be r = –4, while the condition is 0  r < n)

Greatest Common Divisor (GCD) Chapter 4 Number Theory Greatest Common Divisor (GCD) Suppose a and b are non-zero integers. The Greatest Common Divisor (GCD) of a and b is the greatest possible integer d such that d | a and d | b. In this case, it can be written as GCD(a,b) = d. Example: Determine GCD(45,36) ! Divisors of 45: 1, 3, 5, 9, 15, 45. Divisors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36. Common divisors of 45 and 36 are 1, 3, 9. For the enumeration above, it can be concluded that GCD(45,36) = 9.

Greatest Common Divisor (GCD) Chapter 4 Number Theory Greatest Common Divisor (GCD) Suppose m and n are integer, n > 0, such that m = nq + r, 0  r < n. Then GCD(m,n) = GCD(n,r). Example: Take the value m = 66, n = 18, 66 = 183 + 12 then GCD(66,18) = GCD(18,12) = 6.

Chapter 4 Number Theory Euclidean Algorithm Euclid (around 300 BC) is a Greek mathematician, who wrote this algorithm in his book titled, “Element.” The objective of this algorithm is to find the GCD of two integers.

Chapter 4 Number Theory Euclidean Algorithm If m and n are non-negative integers where m  n, and suppose r0 = m and r1 = n. Perform the following divisions in sequence to obtain: r0 = r1q1 + r2 0  r2  r1, r1 = r2q2 + r3 0  r3  r2, ri–2 = ri–1qi–1 + ri 0  ri  ri–1, ri–1 = riqi + 0 . . . . . . According to the statement on the previous section, GCD(m,n) = GCD(r0,r1) = GCD(r1,r2) = … = GCD(ri–2,ri–1) = GCD(ri–1,ri) = GCD(ri,0) = ri Thus, GCD of m and n is the last non-zero remainder of the above sequence of disions, namely ri.

Chapter 4 Number Theory Euclidean Algorithm Given two non-negative integers m and n (m  n), the following Euclidean Algorithm will find the greatest common divisor of m and n. Step 1: If n = 0 then m is the GCD(m,n); Finish. If n  0, proceed to Step 2. Step 2: Divide m with n and obtain r as the remainder. Step 3: Replace m with n, and n with r, then loop back to Step 1.

Euclidean Algorithm Example: Chapter 4 Number Theory Euclidean Algorithm Example: Take m = 80, n = 12, so the condition that m  n is fulfilled. 80 = 126 + 8 12 = 81 + 4 8 = 42 + 0 n = 0  m = 4 is the last non-zero remainder GCD(80,12) = 4; Finish.

Chapter 4 Number Theory Linear Combination GCD(a,b) can be expressed as a linear combination of a and b with the multiplying coefficients that can be freely chosen. Example: GCD(80,12) = 4, then 4 = (–1)80 + (7)12, where –1 and 7 are coefficients that can be freely chosen. Suppose a and b are positive integers, then there exist integers m and n such that GCD(a,b) = ma + nb.

Chapter 4 Number Theory Linear Combination Example: Express GCD(312,70) = 2 as the linear combination of 312 and 70! Applying Euclidean Algorithm: 312 = 470 + 32 (1) 70 = 232 + 6 (2) 32 = 56 + 2 (3) 6 = 32 + 0 (4) Thus, GDC(312,70) = 2 Rearrange (3) to 2 = 32 – 56 (5) Rearrange (2) to 6 = 70 – 232 (6) Insert (6) to (5) so that 2 = 32 – 5(70 – 232) = 132 – 570 + 1032 = 1132 – 570 (7) Rearrange (1) to 32 = 312 – 470 (8) Insert(8) to (7) so that 2 = 1132 – 570 = 11(312 – 470) – 570 = 11312 – 4970 Thus, GCD(312, 70) = 2

Chapter 4 Number Theory Modulo Arithmetics Suppose a is an arbitrary integer and m is a positive integer, then a mod m yields the remainder if a is divided by m a mod m = r such that a = mq + r, with 0  r < m The result of modulo m lies within the set {0,1,2,…,m–1}

Chapter 4 Number Theory Congruence Examine that 38 mod 5 = 3 and 13 mod 5 = 3, then it can be written that 38  13 (mod 5). Pronounce: 38 is congruent with 13 in modulo 5. Suppose a and b are integers and m > 0. If m divides a – b without remainder, then a  b (mod m). If a is not congruent with b in modulo m, then it is written as a  b (mod m).

Congruence Example: 17  2 (mod 3) Chapter 4 Number Theory Congruence Example: 17  2 (mod 3)  3 divides 17–2 = 15 without remainder –7  15 (mod 11)  11 divides –7–15 = –22 without remainder 12  2 (mod 7)  7 cannot divide 12–2 = 10 –7  15 (mod 3)  3 cannot divide –7–15 = –22

Congruence a  b (mod m) can be written as a = b + km (k integer). Chapter 4 Number Theory Congruence a  b (mod m) can be written as a = b + km (k integer). Example: 17  2 (mod 3)  17 = 2 + 53 –7  15 (mod 11)  –7 = 15 + (–2)11 a mod m = r can also be written as a  r (mod m). Example: 23 mod 5 = 3  23  3 (mod 5) 14 mod 8 = 6  14  6 (mod 8) –41 mod 9 = 4  –41  4 (mod 9) –39 mod 13 = 0  –39  0 (mod 13)

Congruence Theorem Suppose m is a positive integer. Chapter 4 Number Theory Congruence Theorem Suppose m is a positive integer. If a  b (mod m) and c is an arbitrary integer, then (a + c)  (b + c) (mod m) ac  bc (mod m) ap  bp (mod m) , p non-negative If a  b (mod m) and c  d (mod m), then (a + c)  (b + d) (mod m) ac  bd (mod m)

Chapter 4 Number Theory Congruence Example: Suppose 17  2 (mod 3) and 10  4 (mod 3), then according to the Congruence Theorem, 17 + 5  2 + 5 (mod 3)  22  7 (mod 3) 175  25 (mod 3)  85  10 (mod 3) 17 + 10  2 + 4 (mod 3)  27  6 (mod 3) 1710  24 (mod 3)  170  8 (mod 3)

Chapter 4 Number Theory Prime Numbers A positive integer p (p > 1) is called a prime number if its divisors are only 1 and p. For example, 23 is a prime number, because it can only be divided by 1 and 23 to get no remainder. Numbers which are not prime numbers are called composite numbers. For example, 20 is a composite number, because 20 is divisible by 2, 4, 5, and 10, besides by 1 and 20 itself.

Chapter 4 Number Theory Relatively Prime Two integers a and b are said to be relatively prime if they do not have any common factors other than 1, or, GCD(a,b) = 1. Example: 20 and 3 are relatively prime, since GCD(20,3) = 1. 7 and 11 are relatively prime, since GCD(7,11) = 1. 20 and 5 are not relatively prime, since GCD(20,5) = 5 ≠ 1.

Chapter 4 Number Theory Relatively Prime If a and b are relatively prime, then there exist integers m and n such that ma + nb = 1. Example: 20 and 3 are relatively prime because GCD(20,3) =1, so that it can be written that 220 + (–13)3 = 1 (m = 2, n = –13). 20 and 5 are not relatively prime because GCD(20,5) ≠ 1, and thus 20 and 5 cannot be written in the form of m20 + n5 = 1.

Linear Congruence The linear congruence is in the form of: Chapter 4 Number Theory Linear Congruence The linear congruence is in the form of: ax  b (mod m), where m > 0, a and b are arbitrary integers, and x is any integer. The solution can be found in the way: ax = b + km  x = (b + km) / a Try each value of k = 0, 1, 2, … and k = –1, –2, … that delivers integer value for x.

Chapter 4 Number Theory Linear Congruence Example: Determine the solutions for 4x  3 (mod 9) ! 4x  3 (mod 9)  x = (3 + k9 ) / 4 k = 0  x = (3 + 09) / 4 = 3/4  not a solution k = 1  x = (3 + 19) / 4 = 3  a solution k = 2  x = (3 + 29) / 4 = 21/4  not a solution k = 3, k = 4  no solution k = 5  x = (3 + 59) / 4 = 12  a solution … k = –1  x = (3 – 19) / 4 = –6/4  not a solution k = –2  x = (3 – 29) / 4 = –15/4  not a solution k = –3  x = (3 – 39) / 4 = –6  a solution k = –7  x = (3 – 79) / 4 = –15  a solution The set of solutions is: {3, 12, …, –6, –15, …}.

Chapter 4 Number Theory Linear Congruence Example: Determine the solutions for 2x  3 (mod 4) ! 2x  3 (mod 4)  x = (3 + k4 ) / 2 Because k4 is always an even number, then 3 + k4 will always be an odd number. If an odd number is divided by 2, then the result will be a decimal number (never be an integer). Thus, there is no value of x that can be the solution of 2x  3 (mod 4).

Chapter 4 Number Theory Homework 6 Determine GCD(216,88) and express the GCD as a linear combination of 216 and 88.

Chapter 4 Number Theory Homework 6A Determine GCD(74,16) and express the GCD as a linear combination of 74 and 16. Determine the solutions for 5x  7 (mod 11) !